shared library using pthreads



hi,
i have written a shared library for a garbage collector. i want to
multithread it.
when i compile the user program as
gcc test.cpp -lgc -ldl
the program executes in the desired manner. (__note__ i am not using
any threading features as yet)
but if i compile it as gcc test.cpp -lgc -ldl -pthread , it gives no
errors but on executing gives segmentation fault. why is it so?

__note__ i have written a wrapper routine for malloc and i think it is
aborting wen the user program is calling malloc.

thanx in advance,

.



Relevant Pages

  • Re: shared libraries using pthreads
    ... multithread it. ... when i compile the user program as ... gcc test.cpp -lgc -ldl ...
    (comp.programming.threads)
  • shared libraries using pthreads
    ... multithread it. ... when i compile the user program as ... gcc test.cpp -lgc -ldl ... aborting wen the user program is calling malloc. ...
    (comp.programming.threads)
  • writing shared libraries for linux
    ... multithread it. ... when i compile the user program as ... gcc test.cpp -lgc -ldl ... aborting wen the user program is calling malloc. ...
    (comp.os.linux.misc)
  • Re: shared libraries using pthreads
    ... > i have written a shared library for a garbage collector. ... > multithread it. ... > when i compile the user program as ... > aborting wen the user program is calling malloc. ...
    (comp.programming.threads)
  • Re: writing shared libraries for linux
    ... > any threading features as yet) but if i compile it as ... > it is aborting wen the user program is calling malloc. ... Try to use proper capitalization. ... I suspect your malloc wrapper is the problem, ...
    (comp.os.linux.misc)