Subject: | Segmentation fault when using ithreads / no thread-safe? |
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=linux, osvers=2.4.20-13.7smp, archname=i686-linux-thread-multi
uname='linux gorgon 2.4.20-13.7smp #1 smp mon may 12 12:31:27 edt 2003 i686 unknown '
config_args='-Dprefix=/usr/local/software/perl/5.8.2/linux_intel -Dman3dir=/usr/local/software/perl/5.8.2/linux_intel/man/man3 -Dman1dir=/usr/local/software/perl/5.8.2/linux_intel/man/man1 -Dcf_email=seb@d2.com -Duseithreads -Uinstallusrbinperl -Dd_perl_otherlibdirs -Dotherlibdirs=/usr/local/software/perl/5.8.2/linux_intel/site_perl:/usr/local/software/perl/5.8.2/site_perl:/usr/local/software/perl/site_perl -des'
hint=previous, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
[ ... truncated / for some reason huge ... ]
l/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.2.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Dec 2 2003 09:50:10
@INC:
/usr/local/software/perl/5.8.2/linux_intel/lib/5.8.2/i686-linux-thread-multi
/usr/local/software/perl/5.8.2/linux_intel/lib/5.8.2
/usr/local/software/perl/5.8.2/linux_intel/lib/site_perl/5.8.2/i686-linux-thread-multi
/usr/local/software/perl/5.8.2/linux_intel/lib/site_perl/5.8.2
/usr/local/software/perl/5.8.2/linux_intel/lib/site_perl
/usr/local/software/perl/5.8.2/linux_intel/site_perl
/usr/local/software/perl/5.8.2/site_perl
/usr/local/software/perl/site_perl
.
Crypt::RSA 1.50
[3]seb@mallet-l> uname -a
Linux mallet-l 2.4.18 #4 SMP Fri Dec 27 10:29:56 PST 2002 i686 unknown
[3]seb@mallet-l> /job/SYSTEMS/3PS/perl/5.8.2/linux_intel/bin/perl -e 'use threads; use Crypt::RSA; my $thread= threads->create(sub { sleep(1); }); $thread->join(); exit();'
Segmentation fault (core dumped)
There's no core to be found though.
Could be PARI also, i guess.
If i use RSA in threads i get Segmentation faults during execution.
I currently only use it in my main thread, and do 'use Crypt::RSA' only _after_ creating the threads, and it seems to work but sporadically i get more Segmentation Faults. Not sure if from same cause though.