Invalid assertion in arm_read_memory_func
Bug #1724485 reported by
Christophe Lyon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Richard Henderson |
Bug Description
Hi,
I think there is an invalid assertion in arm_read_
assert(info->endian == BFD_ENDIAN_LITTLE)
I face it in the following use case: target armeb-linux (I use qemu user mode), -d in_asm -cpu any.
At some point during program startup, glibc's _dl_new_object calls strlen, which is written in thumb2 mode (armv6t2). So print_insn_arm() calls arm_read_
If I remove the assert, execution continues OK.
With the assert, I get the error message from the assert, and qemu then stalls.
Can you confirm the assert can be removed? Or if not, explain me how to avoid/fix the subsequent qemu stall?
Thanks
Changed in qemu: | |
assignee: | nobody → Richard Henderson (rth) |
Changed in qemu: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The tarball contains: linux-armhf. so.3
scoped1.exe
etc/ld.so.cache
lib/libm.so.6
lib/libstdc++.so.6
lib/lib.c.so.6
lib/ld-
lib/libgcc_s.so.1
I can reproduce the problem with qemu-2.10.1: PATH=$PWD/ lib -cpu any -R 0 -d in_asm -L $PWD $PWD/scoped1.exe
qemu-armeb -E LD_LIBRARY_
Removing '-d in_asm' works OK, because the offending assert is triggered while disassembling.
BTW, the program (scoped1.exe) does abort, it is a GCC testcase I was trying to debug ;-)
Removing the assert lets execution continue, but the disassembly is incorrect. Without the assert, I see:
IN: strlen
0x40a1a880: f000 f890 bl 0x40a1a9a4
0x40a1a884: 4502 cmp r2, r0
but strlen normally starts with a pld instruction.
So probably print_insn_arm needs also a change like
given = (b[1]) | (b[0] <<8)<<16 | given;
instead of
given = (b[1]) | (b[0] <<8)|(given << 16);