# Attach to an external thread end with core dump

**URL:** <https://www.ruby-forum.com/t/attach-to-an-external-thread-end-with-core-dump/196401>\
**Category:** Ruby\
**Created:** [October 12, 2010, 8:23pm UTC](https://www.ruby-forum.com/t/attach-to-an-external-thread-end-with-core-dump/196401 "2010-10-12T20:23:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rantanplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rantanplan](https://www.ruby-forum.com/u/rantanplan)\
**Post date:** [October 12, 2010, 8:23pm UTC](https://www.ruby-forum.com/t/attach-to-an-external-thread-end-with-core-dump/196401/1 "2010-10-12T20:23:32Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

I have an problem …  
I create an external thread with pthread\_create and  
create new ruby objects in this thread. it seems  
to work until the GC is running.

#0 mark\_locations\_array (objspace=0x603d30, th=0x6039b0) at  
…/gc.c:1315  
#1 gc\_mark\_locations (objspace=0x603d30, th=0x6039b0) at …/gc.c:1331  
#2 mark\_current\_machine\_context (objspace=0x603d30, th=0x6039b0) at  
…/gc.c:2128  
#3 0x00007ffff7a2b665 in garbage\_collect (objspace=0x603d30) at  
…/gc.c:2177  
#4 0x00007ffff7a2c247 in rb\_newobj\_from\_heap () at …/gc.c:1014  
#5 rb\_newobj () at …/gc.c:1097  
#6 0x00007ffff7a2c306 in rb\_data\_typed\_object\_alloc (klass=6638120,  
datap=0x808040, type=0x7ffff7dbf200) at …/gc.c:1132  
#7 0x00007ffff7a1c5a8 in mnew (klass=6363200, obj=6319120, id=, mclass=6638120, scope=0) at …/proc.c:967  
#8 0x00007ffff7b2c3ad in vm\_call\_cfunc (th=0x6039b0,  
cfp=0x7ffff7fd7e00, num=, blockptr=,  
flag=, id=, me=0x6ffdb0,  
recv=6319120) at …/vm\_insnhelper.c:401  
#9 vm\_call\_method (th=0x6039b0, cfp=0x7ffff7fd7e00, num=, blockptr=,  
flag=, id=, me=0x6ffdb0,  
recv=6319120) at …/vm\_insnhelper.c:523  
#10 0x00007ffff7b20fc8 in vm\_exec\_core (th=,  
th=) at insns.def:1006  
#11 0x00007ffff7b26951 in vm\_exec (th=0x6039b0) at …/vm.c:1145  
#12 0x00007ffff7b27c54 in vm\_call0 (th=0x6039b0, recv=6319120, id=12565,  
argc=0, argv=0x0, me=) at …/vm\_eval.c:66  
#13 0x00007ffff7a1bedb in rb\_method\_call (argc=0, argv=0x0,  
method=) at …/proc.c:1421  
#14 0x00007ffff7a174cb in rb\_rescue2 (b\_proc=0x7ffff6565ca0  
, data1=6319000, r\_proc=0x7ffff6565cb0 ,

the debugger has an extremely high stack-end in the thread struct:

machine\_stack\_start → 8  
machine\_stack\_end → 140737348020529  
machine\_stack\_maxsize → 7340032

- → well it seems that a “initialization” have to run first
- → is a hint available?

thanks for help, Andreas O.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v2.0.15 (GNU/Linux)  
Comment: Using GnuPG with SUSE - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iQEcBAEBAgAGBQJMtKWhAAoJEGTcPijNG3/AjjAH/1GeQg3RRO6jW/2xALT9q3l0  
MQ+bZPh5G5zpmm6DgaMgEqnZIntohPzF+4KOBh56WG7xcEB7DZfHH/ucfICyo05x  
UTIhX0r/6eMTmkdh+mrgPCoxUciMgv0gIHBLjcrwuS7jmEKJJdyi2sCuaf4WGIut  
+GGJYxekbmA08zPIYU0fGslbQCzVC7fwSUArw7xwIwLhDhslm0/H8cJhr1HT57rw  
xzlYCTxBfN0jjN4IyDsqSSDzeMRdMGO3tEAeDdH4+xCUF6nhrBzRiyD1aFOT9Y4i  
bQdWK0mZDWQmEC604Bf8M4DN0GoGwN+o1+f15Omxyous5LGM9P9lG4AxqTGB+AE=  
=lhZD  
-----END PGP SIGNATURE-----
