thread_local vector segmentation fault at end of program in C++ thread_local vector segmentation fault at end of program in C++ multithreading multithreading

thread_local vector segmentation fault at end of program in C++


It is setup dependent; I have successfully compiled and run your example program on Windows 7 (64 bit) with the 64 bit MinGW. Perhaps it is related to the fact that you use the 32 bit MinGW installation on 64 bit platform? My g++ -v gives the following (same version and thread model as yours, different arch):

Using built-in specs.COLLECT_GCC=g++Target: x86_64-w64-mingw32Thread model: posixgcc version 5.2.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)