This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exceptions and multithreading
- To: egcs at cygnus dot com
- Subject: Re: Exceptions and multithreading
- From: Sai-Lai Lo <S dot Lo at orl dot co dot uk>
- Date: Fri, 19 Jun 1998 13:59:27 +0100 (BST)
- CC: leven at lpr dot e-technik dot tu-muenchen dot de
- References: <19980527174754.42696@gonzo.lpr.e-technik.tu-muenchen.de>
>>>>> Peter Leven writes:
> I have found that exception handling is not entirely thread safe on DEC
> alpha (OSF1-4.0b) (unless it is only used on one thread or not at all).
> The following is the smallest example I could generate. If BUG_EXERCISE
> is 0, exceptions are not used, and the program exits normally. If
> BUG_EXERCISE is 1, exception handling is turned on, and the programs gets a
> signal SEGV between calls to the destructor of the the object DummyThr (the
> destructor ``two'' is called, but not the destructor for ``one''). Source
> code for the example, compiler output, and sample output when run under gdb
> are attached.
> I`m using egcs-19980525 (which reports itself as being:
> GNU C++ version egcs-2.91.33 19980525 (gcc2 ss-980502 experimental))
> Platform is: alphaev5-dec-osf4.0b
> Just for additional information, I have attached the test results at the
> end of this email.
I see the same problem running your test code on alpha linux egcs-19980502.
We've been using egcs-19980302 on x86 linux to compile omniORB2 programs
quite successfully. On alpha linux, we've only been successful by patching
egcs-1.0 with Teema Torma's patch. None of the 1998* snapshots produce
multithreaded code that runs reliable. I guess on alphx linux (and DU)
setjmp/longjmp is used to implement exception handling. This is different
from the mechanism used on x86 linux. I hope someone with a better
understanding of the egcs internals could fix the problem before egcs-1.1
is released.
Sai-Lai Lo