avast / avast/retdec

"incompatible iterators between map/set reported" by debug build in MS Visual Studio

Open
#851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

When a debug build is executed on a sample from `retdec-regression-tests`, an ASSERT is raised. That happens on a debug build in MS Visual Studio.
Sample: `retdec-regression-tests\bugs\bin2llvmir-type-recovery-analysis-segfault\Presentation`
Command: `retdec-decompiler.exe Presentation -k --backend-no-opts`
Call Stack:
```
> retdec-decompiler.exe!std::_Tree_const_iterator > >::operator==(const std::_Tree_const_iterator > > & _Right) Line 275 C++
retdec-decompiler.exe!retdec::capstone2llvmir::Capstone2LlvmIrTranslatorArm_impl::translateLdrd(cs_insn * i, cs_arm * ai, llvm::IRBuilder & irb) Line 1550 C++
retdec-decompiler.exe!retdec::capstone2llvmir::Capstone2LlvmIrTranslatorArm_impl::translateInstruction(cs_insn * i, llvm::IRBuilder & irb) Line 100 C++
retdec-decompiler.exe!retdec::capstone2llvmir::Capstone2LlvmIrTranslator_impl::translateOne(const unsigned char * & bytes, unsigned __int64 & size, retdec::common::Address & a, llvm::IRBuilder & irb) Line 262 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::translate(std::pair & bytes, retdec::common::Address & addr, llvm::IRBuilder & irb) Line 351 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::decodeJumpTarget(const retdec::bin2llvmir::JumpTarget & jt) Line 300 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::decode() Line 153 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::run() Line 117 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::runCatcher() Line 89 C++
retdec-decompiler.exe!retdec::bin2llvmir::Decoder::runOnModule(llvm::Module & m) Line 59 C++
retdec-decompiler.exe!`anonymous namespace'::MPPassManager::runOnModule(llvm::Module & M) Line 1744 C++
retdec-decompiler.exe!llvm::legacy::PassManagerImpl::run(llvm::Module & M) Line 1857 C++
retdec-decompiler.exe!llvm::legacy::PassManager::run(llvm::Module & M) Line 1889 C++
retdec-decompiler.exe!retdec::decompile(retdec::config::Config & config, std::basic_string,std::allocator > * outString) Line 518 C++
retdec-decompiler.exe!decompile(retdec::config::Config & config, ProgramOptions & po) Line 955 C++
retdec-decompiler.exe!main(int argc, char * * argv) Line 1053 C++
```
![image](https://user-images.githubusercontent.com/3244359/93206219-59dc9600-f759-11ea-8283-b0a091594cb2.png)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the assertion with the listed retdec-regression-tests sample and command in a debug MS Visual Studio build. Start at Capstone2LlvmIrTranslatorArm_impl::translateLdrd around line 1550, following the call chain through translateInstruction and Decoder::translate; done means the sample no longer triggers the incompatible map/set iterator assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.