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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++ debugging, was:Re: Heads up: Several thousand g++ andlibstdc++ test failures on sparc[64]


Pétur Runólfsson wrote:


1) The problem also shows up on i386-pc-solaris2.9
http://gcc.gnu.org/ml/gcc-testresults/2003-10/msg00348.html
so it's a Solaris problem, not a Sparc problem.

Aha, wasn't aware of.

2) The testcases testsuite/thread/pthread*.cc are not failing. This of course doesn't mean they are succeeding, but it's a strong hint. These testcases contain: // { dg-options "-D_GLIBCXX_ASSERT -pthreads" { target *-*-solaris* } } so it seems that compiling with -pthreads fixes the problem.

My current theory is that __gthread_active_p() is for some reason
returning true when it should return false on Solaris. This should
be easy to check.

Hm, still not that easy to check, tried the thing below :) I don't seem to be able to set breakpoints in this code, sigh.

If this is the case, then there are two options for fixing the bug.

1) Fix gthr on Solaris.

2) Change use of __gthread_active_p() and __gthread_once() from:

[snip]


that is, the "else" is removed, everything else is as before.

Bingo, did that and now it seems much better. Wow!!!


So long as __gthread_active_p() always returns true when thread support is enabled (and this seems to be the case since the pthread*.cc test cases succeed), this should be threadsafe.

I do a sync and rebuild the libstdc++ now. Afterwards I run the suite again.


Thanks again!


Regards, Andreas





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