Aarchxx: ASSERT not implemented. arm-32 bit normalize_ldm_instr
Created by: bernhardklein
Hey together,
in the discussion instrumentalize external module we found out that a part in the normalize_ldm_instr()
in dynamorio/core/arch/archxx/mangle.c
is not implemented.
When I run dynamorio with my binary, a GEMM I created with the code generation tool TVM, it crashes when the program (gemm-run-on-pi-wo-pack) tries to load the external libraries (gemm6.so) and (libtvm_runtime.so). For the case someone want to reproduce the exact same situation, I have attached the binaries.
The debug command
drrun -debug -- ./gemm-run-on-pi-wo-pack
gives a hint what happens:
<Starting application .../gemm-run-on-pi-wo-pack (6617)>
<Initial options = -no_dynamic_options -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >
<Paste into GDB to debug DynamoRIO clients:
set confirm off
add-symbol-file '.../dynamorio/build/lib32/debug/libdynamorio.so' 0x76bd8208
>
<get_memory_info mismatch! (can happen if os combines entries in /proc/pid/maps)
os says: 0x76b7e000-0x76b7f000 prot=0x00000003
cache says: 0x76b7e000-0x76b81000 prot=0x00000003
>
<(1+x) Handling our fault in a TRY at 0x76d928fc>
[<Application ../gemm-run-on-pi-wo-pack (6617). Internal Error: DynamoRIO debug check failure: Not implemented @.../dynamorio/core/arch/aarchxx/mangle.c:2390 !(write_pc && !writeback && instr_writes_to_reg(instr, base, DR_QUERY_INCLUDE_ALL))
(Error occurred @4609 frags)
version 8.0.18443, custom build
-no_dynamic_options -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct
0x76c44db3 0xdf6078af>
Looking at this position in the code we see the comment that something is not yet implemented.
The target platform is a Raspberry Pi 3B+ Compute Module (BCM2837 ARMv8). Its an ARM 32-bit device running a Raspbian GNU/Linux 9 (stretch)
as operating system with Linux kernel 4.9.76.
I work with the dynamorio commit 5fa9faec which is the current head on June 30th.
Does anyone know about this not implemented part? How much effort do you think it is to add the missing code?
Many thanks to @johnfxgalea and @derekbruening to get so far.