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]
Other format: [Raw text]

Re: Segmentation fault in openmp simple routine from libgomp testsuite.


On Tue, Mar 07, 2006 at 12:34:05PM -0500, Diego Novillo wrote:
> #0  0x00000000 in ?? ()
> #1  0x0804d112 in find_unit_1 (n=6, do_create=1)

The problem here is a combination of factors: static linking
and weak symbol references via gthr.h.

The direct cause is that pthread_mutex_trylock isn't pulled
from the libpthread.a archive becuase there's only a weak
reference to it.  Which means that we got some, but not all,
of the thread symbols that we need.

Essentially, the gthr.h weak symbol scheme only really works
for shared libraries.

The only sure-fire fix I can think of is to actually build
two static versions of libgfortran -- one threaded and one
not threaded.  I'm not sure this is worth the effort, really.
I'd be more inclined to put a couple of checks in such that
the static libgfortran only runs non-threaded, and force
people to use shared libgfortran for OpenMP.


r~


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