qiling icon indicating copy to clipboard operation
qiling copied to clipboard

Missing function `handle_bnj_arm`

Open Emiluren opened this issue 1 year ago • 8 comments

I got a crash in branch_predictor_arm.py where it tries to call handle_bnj_arm.

  [...]
  File "/home/emil/.local/lib/python3.12/site-packages/qiling/debugger/qdb/branch_predictor/branch_predictor_arm.py", line 163, in predict
    n2_addr = handle_bnj_arm(ql, next_addr)
              ^^^^^^^^^^^^^^
NameError: name 'handle_bnj_arm' is not defined

I didn't find any definition and no other use of it in the codebase. Is it an old function that has been removed?

Emiluren avatar Jul 08 '24 11:07 Emiluren

Hi, this function handle_bnj_arm should be predict i will try to make a fix for this, pls test it for me once done it thx

ucgJhe avatar Jul 13 '24 14:07 ucgJhe

pls test this #1483 and report it here thx

ucgJhe avatar Jul 13 '24 14:07 ucgJhe

Hm, I ran into a different problem when trying to test. Now qdb doesn't open for me using this:

    ql.debugger = 'qdb'
    ql.debug_stop = True

I was running on master before. Using git bisect I figured out I start having problems at 6799389

Emiluren avatar Jul 15 '24 13:07 Emiluren

can you provide the sample binary for fixing this ?

ucgJhe avatar Jul 16 '24 01:07 ucgJhe

Here is my script and the program I'm trying to run: qdb_issue.zip

My scripts runs the program until the start of main and then makes a snapshot to start faster next time. Also I run without multithread after loading the snapshot but it doesn't make a difference regarding qdb if run with it on. It only crashes with different errors, either 'NoneType' object has no attribute 'cur_thread' or illegal instruction.

Emiluren avatar Jul 18 '24 14:07 Emiluren

With qdb I was going to set a breakpoint at 0x91742baa and step once from there. That triggers the handle_bnj_arm error.

Emiluren avatar Jul 19 '24 07:07 Emiluren

With qdb I was going to set a breakpoint at 0x91742baa and step once from there. That triggers the handle_bnj_arm error.

hi i couldn't repro the error u got cuz a missing library error while loading shared libraries: libecore_evas.so.1: cannot open shared object file: No such file or directory

image

could you pls check again for me ?

ucgJhe avatar Jul 20 '24 08:07 ucgJhe

Oops, sorry. I must have accidentally tested with my snapshot file. There were a whole bunch of libs missing.

Here they are: missing_libs.tar.gz. Just put them in rootfs/lib. (This actually xz compressed to get under Github's 25 MB limit but they don't support xz files so I had to rename it...)

Emiluren avatar Jul 22 '24 08:07 Emiluren

Fixed by #1521

elicn avatar Jan 23 '25 16:01 elicn