Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several MIPS regression tests fail with "decoder.cpp: Assertion `isa<BranchInst>(res.branchCall->getNextNode())' failed" #335

Closed
s3rvac opened this issue Jun 10, 2018 · 2 comments

Comments

@s3rvac
Copy link
Member

s3rvac commented Jun 10, 2018

When running regression tests with the Debug build of RetDec on the current master (1da7146), several MIPS tests fail with the following error:

retdec-bin2llvmir: src/bin2llvmir/optimizations/decoder/decoder.cpp:1424:
    void retdec::bin2llvmir::Decoder::handleDelaySlotLikely():
    Assertion `isa<BranchInst>(res.branchCall->getNextNode())' failed.
retdec-decompiler.sh: line 1264:  6781 Aborted   "$BIN2LLVMIR" "${BIN2LLVMIR_PARAMS[@]}" -o "$OUT_BACKEND_BC"
Error: Decompilation to LLVM IR failed

Here is a list of failing tests:

bugs.error-no-instructions-were-decoded.TestMips (mips-elf-e8e3b30ff295c1eac0cc06e1c8b1dc5e -k)     [ FAIL ]  (0.96s)
bugs.gcc-function-detection.gzip.mips.Test (gzip-strip -k)                                          [ FAIL ]  (1.45s)
bugs.llvmir-syntax-obj-defined-with-type.Test (mips-elf-fd27a58c009f1700499804d6f8a35981)           [ FAIL ]  (0.92s)

Steps to reproduce

  • Checkout the current master and build RetDec in the Debug mode.
  • Run the following commands:
$ wget https://github.com/avast-tl/retdec-regression-tests/raw/ec7d65bc95741aff954ae195ee9b1d247557867e/bugs/gcc-function-detection/gzip/mips/gzip-strip
$ retdec-decompiler.sh gzip-strip

The decompilation fails with the above error. The decompilation is expected to succeed (see this regression test).

Notes

  • This error only appears with the Debug build of RetDec (in the Release build, assertions are disabled).
  • This error is also present in the v3.1 release.
  • This error was introduced by 3764c16 (prior to this commit, the decompilation finishes successfully).

Configuration

  • Commit: 1da7146 (current master)
  • 64b Arch Linux, GCC 8.1.0, Debug build of RetDec
@MerovingianByte
Copy link

When it says "partial bin2llvmir refactorization", does it mean there is more refactorization on the way?

@PeterMatula
Copy link
Collaborator

Yes, so far, I was able to refactor only some bin2llvmir passes, some of the others are still pretty bad. I'm nowhere near satisfied with the codebase quality of this most crucial RetDec part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants