12-21-2015, 11:02 PM
Actually it's a problem with how Linux handles creating new processes. It does so by using fork(), which duplicates the current process, and then exec(), which replaces the current binary with another binary. It works pretty well for traditional programs, but doesn't cooperate too well with threads - only the thread calling the fork() function is copied, the rest of the threads are thrown away in the copy of the executable, which means that if any of those threads held any mutexes, those mutexes will be locked forever in the child process. If one of those mutexes just happens to be something important, such as CRT's mutex for memory allocations, we're in trouble.