pthread_create/gcc/gcc-libc bug?
Juan Carlos Franzoy
jfranzoy@yahoo.com.ar
Wed Sep 5 22:55:00 GMT 2007
Hi.
I'm having problems trying to create a thread with a user supplied
stack in a shared object. I get a "segmentation fault". The error does
not happen if there are no shared objects involved.
The detail is:
- I have a "d.cpp" source with a main() that calls my_pthread_create in a shared object "c.so"
- my_pthread_create in "c.cpp":
- I malloc 1MB + a page size bytes
- set the pointer to the pthread_attr_t object with pthread_set_stack( ptr, 1MB )
- call pthread_create
- crash!
The question is: what is the problem? Am I doing something wrong?
In the attachement I send the sources and a readme with the output of
gcc -v, uname -a and a stack trace of the failure.
Thanks.
------------------------------------------------------------
Juan Carlos Franzoy
Analista Programador
Tel: +54-11-4780-2634
mailto:JCFranzoy@ats.com.ar
http://www.ats.com.ar
------------------------------------------------------------
____________________________________________________________________________________
¡Sé un mejor ambientalista!
Encontrá consejos para cuidar el lugar donde vivimos en http://ar.yahoo.com/promos/mejorambientalista.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_create_problem.tar.gz
Type: application/x-tar
Size: 49275 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070905/d9bc87da/attachment-0001.tar>
More information about the Gcc-help
mailing list