radareorg / radeco

radare2-based decompiler and symbol executor
368 stars 51 forks source link

thread ... panicked at 'lastsz unset!', .../esil-rs-dc8b478bbfee1278/d93e34a/src/parser.rs:251:31 #295

Open rfalke opened 5 years ago

rfalke commented 5 years ago

Version: eb2c40d Exe: https://github.com/rfalke/decompiler-subjects/blob/master/from_holdec/dmi/cfg/ia32_elf/subject.exe

Command:

$ RUST_BACKTRACE=full radeco --batch subject.exe
thread '<unnamed>' panicked at 'lastsz unset!', .../.cargo/git/checkouts/esil-rs-dc8b478bbfee1278/d93e34a/src/parser.rs:251:31
stack backtrace:
   0:     0x5630d4601032 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h7ff7529d8173ea66
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x5630d45f28fb - std::panicking::default_hook::{{closure}}::hce77199586520678
                               at libstd/sys_common/backtrace.rs:71
   2:     0x5630d45f1a52 - std::panicking::rust_panic_with_hook::ha62923fe65b493cc
                               at libstd/panicking.rs:227
                               at libstd/panicking.rs:476
   3:     0x5630d44605a6 - std::panicking::begin_panic::h6ebe8a8a303eed0c
   4:     0x5630d43baaf2 - <radeco_lib::frontend::ssaconstructor::SSAConstruct<'a, T>>::run::h5c4a3d5dd709819b
   5:     0x5630d43b3a27 - <radeco_lib::frontend::ssaconstructor::SSAConstruct<'a, T>>::construct::h0410a887fec16b3b
   6:     0x5630d43fc080 - rayon::iter::plumbing::bridge_producer_consumer::helper::hcb4f6116a0e87658
   7:     0x5630d43fc58c - rayon_core::join::join_context::{{closure}}::h50f7661db6a3b88d
   8:     0x5630d43fc1cb - rayon::iter::plumbing::bridge_producer_consumer::helper::hcb4f6116a0e87658
   9:     0x5630d43fc58c - rayon_core::join::join_context::{{closure}}::h50f7661db6a3b88d
  10:     0x5630d43fc1cb - rayon::iter::plumbing::bridge_producer_consumer::helper::hcb4f6116a0e87658
  11:     0x5630d43fc3f6 - rayon_core::join::join_context::{{closure}}::h50f7661db6a3b88d
  12:     0x5630d43fc1cb - rayon::iter::plumbing::bridge_producer_consumer::helper::hcb4f6116a0e87658
  13:     0x5630d43fc3f6 - rayon_core::join::join_context::{{closure}}::h50f7661db6a3b88d
  14:     0x5630d43c5c28 - <rayon_core::job::StackJob<L, F, R> as rayon_core::job::Job>::execute::h226e77b5cd35f416
  15:     0x5630d445c354 - rayon_core::registry::WorkerThread::wait_until_cold::hea5ee0f9766359f4
  16:     0x5630d445c8d8 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7edb8cc1b8934905
  17:     0x5630d445df2d - <F as alloc::boxed::FnBox<A>>::call_box::h9bf477dda44466fb
  18:     0x5630d45f427a - std::sys::unix::thread::Thread::new::thread_start::hee6511eb80027626
                               at liballoc/boxed.rs:682
  19:     0x7fab2637f739 - start_thread
  20:     0x7fab25ea2e7e - clone
  21:                0x0 - <unknown>

I also didn't have much luck with other binaries.

chinmaydd commented 5 years ago

Hi @rfalke, looks like esil.rs was panicking while parsing: ebp,ebp,$z,zf,=,$p,pf,=,$s,sf,=,$0,cf,=,$0,of,=.

But with r2 from git, this issue seems to be resolved.

$ r2 -v
radare2 3.1.0-git 20092 @ linux-x86-64 git.3.0.1-83-g287d9df
commit: 287d9df648143d2d00d8720b611ea4c0fe82e0ea build: 2018-10-29__23:24:55
$ radeco 
>> load subject.exe
Warning: invalid bb jump/fail pair
WARNING: r_anal_fcn_cc: assertion 'result > 0' failed (line 1991)
Warning: invalid bb jump/fail pair
WARNING: r_anal_fcn_cc: assertion 'result > 0' failed (line 1991)
[*] Fixing Callee Information
>> 

However, SSA verification is failing for sym.register_tm_clones which needs to be looked into.

XVilka commented 5 years ago

@rfalke can you confirm that bug is fixed now?