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


> 
> 
> --y0ulUmNC+osPPQO6
> Content-Type: text/plain; charset=us-ascii
> Content-Description: Exception bug
> 
> Hello,
> 
> 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 tried your code on Linux/x86/glibc 2.0.7 with egcs 1.0.3a. It seems
ok to me. But Linux/x86 uses DWARF for exception and glibc 2 is MT-safe.
I don't know if they make any differences.


H.J.
---
Created object 10
Created object 20
Starting thread
Counting...10...1
Starting one 1
Starting thread
Counting...20...1
Starting two 1
Counting...10...2
Counting...20...2
Counting...10...3
Counting...20...3
Counting...10...4
Counting...20...4
Counting...10...5
Counting...20...5
Counting...10...6
Counting...20...6
Counting...10...7
Counting...20...7
Counting...10...8
Counting...20...8
Counting...10...9
Counting...20...9
Counting...10...10
Counting...20...10
String for 10 was Construct this!
Done with 10
Noticed death of one...Thread not running...
What a joint...
done stopping it.
Counting...20...11
Counting...20...12
Counting...20...13
Counting...20...14
Counting...20...15
Counting...20...16
Counting...20...17
Counting...20...18
Counting...20...19
Counting...20...20
String for 20 was Construct this!
Done with 20
Noticed death of two...Thread not running...
What a joint...
done stopping it.
String value is This is a string!
We are outa here...
Destroying object 20
Thread not running...
done destroying object 20
Destroying object 10
Thread not running...
done destroying object 10
Reached end of main.


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