ASSERT (find_heap_unit) when dumping traces that contain annotations
Recent native_exec regression fixes (#2371 (closed), #2372 (closed), #2375) added annotations to improve the tests, which resulted in some nightly test failures:
http://dynamorio.org/CDash/testDetails.php?test=248825&build=22254
Test: code_api,tracedump_text,tracedump_origins|common.nativeexec (Failed)
all done
<Application /work/dr/nightly/run/build_debug-internal-32/suite/tests/bin/common.nativeexec (13915). Internal Error: DynamoRIO debug check failure: /work/dr/nightly/src/core/heap.c:3735 find_heap_unit(tu, p, alloc_size) != NULL
(Error occurred @984 frags)
Can't repro on laptop but can repro on desktop.
#1 0x710e6944 in internal_error (file=0x712d3e00 "/work/dr/nightly/src/core/heap.c", line=3735, expr=0x712d7248 "find_heap_unit(tu, p, alloc_size) != NULL")
at /work/dr/nightly/src/core/utils.c:177
#2 0x7116324d in common_heap_free (tu=0x46e0e098, p_void=0x46e8e164, size=12, which=ACCT_IR) at /work/dr/nightly/src/core/heap.c:3733
#3 0x7115e08b in common_global_heap_free (tu=0x46e0e098, p=0x46e8e164, size=12, which=ACCT_IR) at /work/dr/nightly/src/core/heap.c:2676
#4 0x7115e214 in global_heap_free (p=0x46e8e164, size=12, which=ACCT_IR) at /work/dr/nightly/src/core/heap.c:2704
#5 0x7116361c in heap_free (dcontext=0xffffffff, p=0x46e8e164, size=12, which=ACCT_IR) at /work/dr/nightly/src/core/heap.c:3768
#6 0x711eefa3 in instr_free (dcontext=0xffffffff, instr=0x46e8d884) at /work/dr/nightly/src/core/arch/instr_shared.c:191
#7 0x711eecf5 in instr_destroy (dcontext=0xffffffff, instr=0x46e8d884) at /work/dr/nightly/src/core/arch/instr_shared.c:106
#8 0x711fb57d in instrlist_clear (dcontext=0xffffffff, ilist=0x46ebff10) at /work/dr/nightly/src/core/arch/instrlist.c:97
#9 0x711fb5b4 in instrlist_clear_and_destroy (dcontext=0xffffffff, ilist=0x46ebff10) at /work/dr/nightly/src/core/arch/instrlist.c:105
#10 0x7120f998 in disassemble_app_bb (dcontext=0xffffffff, tag=0x804963f <dynamorio_annotate_running_on_dynamorio> "U\211\345\353\f\241\234\060", outfile=4000)
at /work/dr/nightly/src/core/arch/disassemble_shared.c:1414
#11 0x7109010e in output_trace (dcontext=0xffffffff, pt=0x46e2db24, f=0x46ed9d44, deleted_at=-1) at /work/dr/nightly/src/core/fragment.c:7268
#12 0x7107c9e5 in fragment_exit () at /work/dr/nightly/src/core/fragment.c:1603
#13 0x7106af5f in dynamo_shared_exit (toexit=0x0) at /work/dr/nightly/src/core/dynamo.c:974
#14 0x7106b424 in dynamo_process_exit_cleanup () at /work/dr/nightly/src/core/dynamo.c:1305
#15 0x7106b59d in dynamo_process_exit () at /work/dr/nightly/src/core/dynamo.c:1361
#16 0x712416e8 in cat_done_saving_dstack () at /work/dr/nightly/src/core/arch/x86/x86.asm:625
Looks like something related to annotation handling. I do not know precisely what the problem is but it seems unrelated to native_exec and solely to do with handling this annotation as an app bb for trace dumping.