ASSERT rank order violation client_aux_libs acquired after all_memory_areas in fuzz_custom_mutator test
This consistently happens on Ubuntu20 in the Dr. Memory fuzz_custom_mutator test (xref DynamoRIO/drmemory#2417).
2021-09-06T16:58:18.6490346Z 83: <rank order violation client_aux_libs(readwrite)@/home/runner/work/drmemory/drmemory/dynamorio/core/lib/instrument.c:699 acquired after all_memory_areas(readwrite)@/home/runner/work/drmemory/drmemory/dynamorio/core/unix/memcache.c:100 in tid:43de>
(gdb) bt
#0 report_dynamorio_problem (dcontext=0x5, dumpcore_flag=0, exception_addr=0xffffffff <error: Cannot access memory at address 0xffffffff>, report_ebp=0x7ffde3c06650 "\260f\300\343\375\177",
fmt=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>) at /home/bruening/drmemory/git/src/dynamorio/core/utils.c:2094
#1 0x00007ffff7c58ef0 in d_r_internal_error (file=0x7ffff7ec31d0 "/home/bruening/drmemory/git/src/dynamorio/core/utils.c", line=615,
expr=0x7ffff7ec3e78 "(dcontext->thread_owned_locks->last_lock->rank < lock->rank || first_client || both_client) && \"rank order violation\"")
at /home/bruening/drmemory/git/src/dynamorio/core/utils.c:179
#2 0x00007ffff7c5b126 in deadlock_avoidance_lock (lock=0x7ffde3beb108, acquired=true, ownable=false) at /home/bruening/drmemory/git/src/dynamorio/core/utils.c:615
#3 0x00007ffff7c5c2f5 in d_r_read_lock (rw=0x7ffde3beb108) at /home/bruening/drmemory/git/src/dynamorio/core/utils.c:1215
#4 0x00007ffff7d11c79 in vmvector_overlap (v=0x7ffde3beb0f0, start=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", end=0x7ffff7af3001 "libc-ld.so.cache1.1\255\003")
at /home/bruening/drmemory/git/src/dynamorio/core/vmareas.c:1998
#5 0x00007ffff7d63588 in is_in_client_lib (addr=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003") at /home/bruening/drmemory/git/src/dynamorio/core/lib/instrument.c:908
#6 0x00007ffff7e7c0c8 in memcache_query_memory (pc=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", out_info=0x7ffde3c06ba0) at /home/bruening/drmemory/git/src/dynamorio/core/unix/memcache.c:376
#7 0x00007ffff7e54dd7 in query_memory_ex (pc=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", out_info=0x7ffde3c06ba0) at /home/bruening/drmemory/git/src/dynamorio/core/unix/os.c:9554
#8 0x00007ffff7e54e00 in query_memory_cur_base (pc=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", info=0x7ffde3c06ba0) at /home/bruening/drmemory/git/src/dynamorio/core/unix/os.c:9561
#9 0x00007ffff7d18c0e in app_memory_pre_alloc (dcontext=0x7ffde3be0080, base=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", size=74195, prot=1, hint=false, update_areas=true, image=false)
at /home/bruening/drmemory/git/src/dynamorio/core/vmareas.c:6025
#10 0x00007ffff7d18c86 in app_memory_allocation (dcontext=0x7ffde3be0080, base=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", size=74195, prot=1, image=false, comment=0x7ffff7f203a0 "mmap2")
at /home/bruening/drmemory/git/src/dynamorio/core/vmareas.c:6088
#11 0x00007ffff7e5127d in process_mmap (dcontext=0x7ffde3be0080, base=0x7ffff7af3000 "glibc-ld.so.cache1.1\255\003", size=74195, prot=1, flags=2, map_type=0x7ffff7f203a0 "mmap2")
at /home/bruening/drmemory/git/src/dynamorio/core/unix/os.c:8076
#12 0x00007ffff7e51d8d in post_system_call (dcontext=0x7ffde3be0080) at /home/bruening/drmemory/git/src/dynamorio/core/unix/os.c:8301
#13 0x00007ffff7c4ec6d in handle_post_system_call (dcontext=0x7ffde3be0080) at /home/bruening/drmemory/git/src/dynamorio/core/dispatch.c:2196
#14 0x00007ffff7c45240 in dispatch_enter_dynamorio (dcontext=0x7ffde3be0080) at /home/bruening/drmemory/git/src/dynamorio/core/dispatch.c:894
#15 0x00007ffff7c408ab in d_r_dispatch (dcontext=0x7ffde3be0080) at /home/bruening/drmemory/git/src/dynamorio/core/dispatch.c:160