On Fri, 18 Dec 2020, Jeremy Drake via Mingw-w64-public wrote:
> Have there been any further ideas on this? I am concerned the current
> state of affairs, accessing freed memory during tls destruction of objects
> in the .exe module, could cause crashes in objects more complicated than
> simple logging test cases.
>
MSYS2 just updated its version of mingw-w64 (though it has not yet been
deployed), and the version built there still has this problem. It mostly
appears to work, but when tlstest-main is run under gdb:
(note the s=0xfeeefeee in frame #1)
...
main, thread2 work done
thread 9120 finishing
lib global tls dtor from thread 9120, now on 9120
lib local tls dtor from thread 9120, now on 9120
Thread 5 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3240.0x23a0]
0x75ac9c9c in strlen () from C:\WINDOWS\System32\msvcrt.dll
=> 0x75ac9c9c <strlen+12>: 8a 01 mov al,BYTE PTR [ecx]
(gdb) bt
#0 0x75ac9c9c in strlen () from C:\WINDOWS\System32\msvcrt.dll
#1 0x00403458 in __pformat_puts (
s=0xfeeefeee <error: Cannot access memory at address 0xfeeefeee>,
stream=stream@entry=0x119fca8)
at
C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/stdio/mingw_pformat.c:558
#2 0x0040512e in __mingw_pformat (flags=<optimized out>, flags@entry=24576,
dest=<optimized out>, dest@entry=0x75af4640 <msvcrt!_iob+64>,
max=<optimized out>, max@entry=0,
fmt=0x40a05e " dtor from thread %d, now on %d\n",
fmt@entry=0x40a05c "%s dtor from thread %d, now on %d\n",
argv=<optimized out>, argv@entry=0x119fd5c "î_î_î_î_ #")
at
C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/stdio/mingw_pformat.c:2482
#3 0x00402ff9 in __mingw_vfprintf (stream=0x75af4640 <msvcrt!_iob+64>,
fmt=0x40a05c "%s dtor from thread %d, now on %d\n",
argv=0x119fd5c "î_î_î_î_ #")
at
C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/stdio/mingw_vfprintf.c:54
#4 0x00408abd in fprintf(_iobuf*, char const*, ...) ()
#5 0x00408b72 in Hello::~Hello() ()
#6 0x00402915 in run_dtor_list (ptr=<synthetic pointer>)
at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/tls_atexit.c:59
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public