On multiprocessor Solaris Sparc machines, if multiple threads are concurrently throwing exceptions, and another thread is calling exit() or returning from main(), there are messages such as: terminate called recursively terminate called after throwing an instance of ' And sometimes core is dumped with an abort signal. I have been able to reproduce this on a number of different gcc versions (4.2.0, 4.1.2, 2.95.2). You can find the code I use to reproduce it at: http://www.csug.rochester.edu/users/ugrads/asveikau/exception_bug.cc Note that running it once without incident does not mean the system is unaffected by the bug; keep running it until it dumps core. The code runs file on: SunPRO C++ on the affected systems, gcc 4.1.1 on i386 linux, and gcc 3.2.3 on i386 linux. This is why I concluded that the issue is specific to either gcc on Solaris or gcc on Sparc. Since it works fine on Sun's compiler, I don't think it is Solaris's fault. I don't have access to sparc linux or x86 solaris, so I couldn't narrow it down beyond that.
Created attachment 13703 [details] Code that reproduces the problem
Hmm, shouldn't the unwinder using pthreads mutex's already? What is the output of "gcc -v" is the thread model set to single?
I can reproduce with mainline on a bi-processor machine (Sun-Fire-V240) running Solaris 10 but neither on a bi-processor machine (Sun-Fire-V240) runnning Solaris 9 nor on a quadri-processor machine (Sun-Fire-V440) running Solaris 8.