This is the mail archive of the
mailing list for the GCC project.
Re: Segmentation fault in openmp simple routine from libgomp testsuite.
- From: Richard Henderson <rth at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: FX Coudert <fxcoudert at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, Benjamin Réveillé <benjamin dot reveille at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 7 Mar 2006 11:15:59 -0800
- Subject: Re: Segmentation fault in openmp simple routine from libgomp testsuite.
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <440DC40D.firstname.lastname@example.org>
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.