This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Exceptions and multithreading


>>>>> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]