public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Linux-PPC egcs-1.1b g++ still not thread safe
@ 1998-09-08 10:53 Troy Benjegerdes
  1998-09-09  3:45 ` Martin von Loewis
  0 siblings, 1 reply; 2+ messages in thread
From: Troy Benjegerdes @ 1998-09-08 10:53 UTC (permalink / raw)
  To: egcs-bugs

I saw a web page regarding egcs 1.1, which says c++ exception handling is
now thread safe on x86.

I can verify that it still doesn't work on PPC.

I am getting segfaults in a particular function epilogue in which it
appears to be attempting to change or load some exception-related
variable, which some other thread has already conveniently trashed.

A snip of the offending assembly follows:

0x18211e0 <func__5cpmani+888>:  bl      0x19dacfc <IOMGR_Select>
0x18211e4 <func__5cpmani+892>:  addi    r9,r27,4
0x18211e8 <func__5cpmani+896>:  lwz     r11,0(r9)
0x18211ec <func__5cpmani+900>:  addi    r9,r11,4
0x18211f0 <func__5cpmani+904>:  lwz     r11,0(r9)
0x18211f4 <func__5cpmani+908>:  lwz     r0,0(r11)  

It crashes at 0x18211f4 with r11=0. The IOMGR_Select function is the last
function in the source, and in this case is a 60 second delay for the
current thread. This is from the Coda filesystem package, which uses it's
own user level threads library. 

I also just found out that if I use the '-fno-exceptions' flag, everything
appears to work.

--------------------------------------------------------------------------
| Troy Benjegerdes    |    troybenj@iastate.edu    |    hozer@drgw.net   |
|    Unix is user friendly... You just have to be friendly to it first.  |
| This message composed with 100% free software.    http://www.linux.org |
--------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linux-PPC egcs-1.1b g++ still not thread safe
  1998-09-08 10:53 Linux-PPC egcs-1.1b g++ still not thread safe Troy Benjegerdes
@ 1998-09-09  3:45 ` Martin von Loewis
  0 siblings, 0 replies; 2+ messages in thread
From: Martin von Loewis @ 1998-09-09  3:45 UTC (permalink / raw)
  To: hozer; +Cc: egcs-bugs

> It crashes at 0x18211f4 with r11=0. The IOMGR_Select function is the last
> function in the source, and in this case is a 60 second delay for the
> current thread. This is from the Coda filesystem package, which uses it's
> own user level threads library. 

Ahh! Of course, the thread-safe exception support requires knowledge
about the thread package being used. For example, the current
exception is stored in thread-local storage. Different packages
provide different APIs to access this storage, if they provide API at
all.

So in order to use it, you'd have to adapt egcs to that thread
package. Please look at gcc/gthr-posix.h how the POSIX threads
adaptation works. If you don't want to adapt it, you might be better
of using -fno-exceptions, indeed. Please note that you might need to
recompile all the libraries.

Regards,
Martin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-09-09  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-08 10:53 Linux-PPC egcs-1.1b g++ still not thread safe Troy Benjegerdes
1998-09-09  3:45 ` Martin von Loewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).