Hello,

I've written an application which uses pthreads, but I've run in­
to some portability issues between Linux and Solaris. So I decid­
ed to try Pth. Great package indeed. But here is my show stopper:
pth_init() seg faults for me (pth 1.3.6, kernel 2.2.13/14,  glibc
2.1).

I'm  using autoconf (2.13), automake (1.4) and libtool (1.3.3) to
manage the build environment, and I've integrated the locally in­
stalled  pth (in /usr) in autoconf as per the instructions in the
pth manual page. While trying to isolate the problem, I  prepared
the following elementary program:

        #include <pth.h>
        #include <stdlib.h>
        #include <stdio.h>

        int     main(int argc, char *argv[]) {
                pth_init();
                fprintf(stderr, "pth initialized0);
                exit(EXIT_SUCCESS);
        }

which  does  not  reference  any  of the application specific li­
braries.  The application links with tcl8.0, pthread  (not  pth),
and  some application specific libraries. To prevent any possible
side effects of these libraries, I modified the link step to only
include operating system libraries:

    gcc -g -O2 -I/usr/include -L/usr/lib -o .libs/testpth testpth.o \
        -lcrypt -lm -ldl -lnsl -lm -ldl -lcrypt -lm -ldl -lpth -Wl,--rpath \
        -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/lib:/lib:/lib

The  generated binary .libs/testpth works OK, but when libtool is
used to execute it, libtool  generates  a  new  binary  .libs/lt-
testpth  which  seg  faults inside pthread_sighandler in the file
signals.c on line 86.  I don't want to decide whether this  is  a
pth bug or someone else's fault.

When I link manually using

    gcc -o testpth testpth.o -lpth

the resulting binary works as it is supposed to.

Comparing  the  output  of  ldd  or  strace  for the two binaries
(testpth and lt-testpth) shows that testpth  only  maps  the  li­
braries     you     would     expect:     /etc/ld.so.cache    and
/usr/lib/libpth.so.13. The binary lt-testpth however links  quite
a few other libraries, in particular libpthread.

I agree that this is probably rather a libtool problem than a pth
problem.  However, pth routinely coexists with pthreads, so there
is  a  small chance that it knows how to work around the problem.
Is there any way to configure pth so that it can live in  harmony
with linux pthreads?

Mit herzlichem Gruss

                                        Andreas Mueller

--
Dr. Andreas Mueller, Beratung und Entwicklung
CH-6685 Bosco/Gurin               Switzerland
Tel: +41 91 7607106       Fax: +41 91 7607107
[EMAIL PROTECTED]


______________________________________________________________________
GNU Portable Threads (Pth)            http://www.gnu.org/software/pth/
User Support Mailing List                            [EMAIL PROTECTED]
Automated List Manager (Majordomo)           [EMAIL PROTECTED]

Reply via email to