https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91256
--- Comment #1 from Danack at basereality dot com --- As a bit more info - for the sake of debugging I added a sleep command in the Imagick code just after where it tells the ImageMagick library to shut itself down. This seems to 'make the segfault go away'. I have a strong suspicion this is a race condition between the thread local storage being used by OpenMP in the threads it has created and the main program thread. Any suggestions on how to investigate/block that? e.g. is there a function I can call to check if all of the OpenMP created threads have terminated yet?