CRASH private lib fini unaligned stack
Running 32-bit drmemtrace reliably hits this crash on my system:
Thread 1 "drmemtrace.sign" received signal SIGSEGV, Segmentation fault.
0xf777e732 in ?? ()
(gdb) x/8i $pc
=> 0xf777e732 <__cxa_finalize+258>: pxor (%esp),%xmm0
0xf777e737 <__cxa_finalize+263>: movd %xmm0,%edx
0xf777e73b <__cxa_finalize+267>: psrlq $0x20,%xmm0
0xf777e740 <__cxa_finalize+272>: movd %xmm0,%eax
0xf777e744 <__cxa_finalize+276>: or %edx,%eax
0xf777e746 <__cxa_finalize+278>: jne 0xf777e66d <__cxa_finalize+61>
(gdb) x/4wx $esp
0x48456868: 0x0000004a 0x00000000 0xf7fa7000 0xf7fa7000
(gdb) memquery $esp
48449000-48457000 rw-p 00000000 00:00 0
(gdb) bt
#0 0xf777e732 in __cxa_finalize ()
#1 0xf7be60d3 in __do_global_dtors_aux ()
#2 0xf7e985fa in privload_call_lib_func (func=0xf7be60a0 <__do_global_dtors_aux>) at .../dr/git/src/core/unix/loader.c:980
#3 0xf7e97a24 in privload_call_entry (privmod=0x48427e30, reason=2) at .../dr/git/src/core/unix/loader.c:649
#4 0xf7db938b in privload_unload (privmod=0x48427e30) at .../dr/git/src/core/loader_shared.c:615
#5 0xf7db81bf in unload_private_library (modbase=0xf7bd5000 "\177ELF\001\001\001\003") at .../dr/git/src/core/loader_shared.c:274
#6 0xf7e707ba in unload_shared_library (lib=0xf7bd5000) at .../dr/git/src/core/unix/os.c:3912
#7 0xf7dc085a in instrument_exit () at .../dr/git/src/core/lib/instrument.c:889
#8 0xf7c6e4fd in dynamo_shared_exit (toexit=0x0) at .../dr/git/src/core/dynamo.c:1024
#9 0xf7c6e9ef in dynamo_process_exit_cleanup () at .../dr/git/src/core/dynamo.c:1349
#10 0xf7c6eb68 in dynamo_process_exit () at .../dr/git/src/core/dynamo.c:1404
(gdb) p privmod->name
$3 = 0xf7be1e9c "libdrmemtrace.so"
Looks like stack alignment: esp is not 16-byte-aligned.