problem using an external thread with ruby

Discussion in 'Ruby' started by Andreas Otto, Oct 14, 2010.

  1. Andreas Otto

    Andreas Otto Guest

    -----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=<value
    optimized out>, mclass=6638120, scope=0) at ../proc.c:967
    #8 0x00007ffff7b2c3ad in vm_call_cfunc (th=0x6039b0,
    cfp=0x7ffff7fd7e00, num=<value optimized out>, blockptr=<value optimized
    out>,
    flag=<value optimized out>, id=<value optimized out>, me=0x6ffdb0,
    recv=6319120) at ../vm_insnhelper.c:401
    #9 vm_call_method (th=0x6039b0, cfp=0x7ffff7fd7e00, num=<value
    optimized out>, blockptr=<value optimized out>,
    flag=<value optimized out>, id=<value optimized out>, me=0x6ffdb0,
    recv=6319120) at ../vm_insnhelper.c:523
    #10 0x00007ffff7b20fc8 in vm_exec_core (th=<value optimized out>,
    th=<value optimized out>) 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=<value optimized out>) at ../vm_eval.c:66
    #13 0x00007ffff7a1bedb in rb_method_call (argc=0, argv=0x0,
    method=<value optimized out>) at ../proc.c:1421
    #14 0x00007ffff7a174cb in rb_rescue2 (b_proc=0x7ffff6565ca0
    <ProcCallMethod>, data1=6319000, r_proc=0x7ffff6565cb0 <sRescueError>,


    the debugger display 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 Otto
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

    iQEcBAEBAgAGBQJMtprdAAoJEGTcPijNG3/ATG0IAJBdgdnptf8LfUIQDmW1jJp5
    pnmf8cYOSwh1HCI7+7iYYo90QUU5u1BNVwDXC4v7NwP++Opv3RNxTA+0+UMYy4dw
    N+5bxnIsjEML8RKtxlmtbb6xaPJI/AFmoiELM4gohWsbdvmCR9Ic0WJq/gP9pJkQ
    CRVgPHVlJl/bcArJP7w5zp8jaUUQ8hvgKvbd3UMRwYLZIi8buv6OfljePOoK+GAz
    kaOcWjCap3G/Tf2ymDPpuLCLw+S6Zabw+wLabBi++iN4vl5kR4qLt0BWKAfhp6Sj
    MPE6VKyHMPonYQ5QuJ6PHpuwmLwmG28YVL5J8Tr6xyLawAB8I+DIgN5XYv4R7Dc=
    =Tlka
    -----END PGP SIGNATURE-----
     
    Andreas Otto, Oct 14, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    14,183
    Matt Humphrey
    Apr 22, 2005
  2. Scott Allen
    Replies:
    8
    Views:
    10,983
    Scott Allen
    May 2, 2004
  3. Vincenzo Piombo
    Replies:
    1
    Views:
    169
  4. Bill Kelly
    Replies:
    5
    Views:
    241
    Joel VanderWerf
    Mar 1, 2006
  5. Mellow Crow
    Replies:
    6
    Views:
    425
    Richard Cornford
    Nov 4, 2005
Loading...

Share This Page