[Gambas-devel] Problem while running gbx2/3 with gdb

Laurent Carlier lordheavym at ...176...
Sat Aug 30 11:44:11 CEST 2008


Le Saturday 30 August 2008 07:58:02 Benoit Minisini, vous avez écrit :
> > First, you must run gbx3 with the "-p" option to prevent it from forking
> > at startup. then, I don't see that gdb has crashed, but just breaked. So
> > maybe you can continue the program?
>
> I read your bug report: what prevents gbx from being linked with
> "-lphtread"? It is already the case on BSD systems.

Here is some replies from gdb ML:

--8<--
Are you dlopen()ing a library which is linked against libpthread.so
into a program which isn't?

Very few OSes support processes "suddenly" becoming multithreaded
(I know only of Solaris 10 and AIX 5).

If you do that on Linux, you should expect all kinds of trouble,
because e.g. glibc very early on decides whether pthreads are
present, and permanently switches to thread-unsafe behavior if they
are not.

Cheers,
--8<--
> If you do that on Linux, you should expect all kinds of trouble,
> because e.g. glibc very early on decides whether pthreads are
> present, and permanently switches to thread-unsafe behavior if they
> are not.

I'm pretty sure that's not correct.  It checks at each runtime spot,
not initialization time - a lot of the complexity in glibc is to
support this.
--8<--

So as you do with gbx2, it seem reasonnable to add libthread linking. The 
problem seem really tied to some glibc/ldconfig magic.

++





More information about the Devel mailing list