This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Thread problem in XS code on Linux


I suspect I am not linking properly.  The symptom is that malloc/free
does not seem to behave in a thread safe manner.  In a XS module the
code uses the pthread library to create a couple of threads, in the
threads lots of mallocs and frees are performed.  The code will fail
from Segmentation fault.  The sample code attached behaves the same on
two differt machines.  The first is a dual cpu x86 box running RedHat
6.0 Linux with a hand build kernel 2.2.16, perl rpm is perl-5.00503-11,
and glibc rpm is glibc-2.1.3-21.  The second machine is a dual cpu x86
box running RedHat 6.1 Linux, stock kernel 2.2.12-20smp,
perl-5.00503-11, and glibc-2.1.2-11.
 
To compile edit makefile and type make.  Run test with 'perl test.pl'.

Thanks,
James Boorn

TT.tgz


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