Hi,

At Mon, 20 Jun 2005 04:18:45 +0900,
Michel Pastor wrote in [ruby-core:05253]:
> >   $ ruby -e 'p [0x202d2020, 0x6b636f6c, 1652043808, 1630680375,
>   979578930, 1853190688, -1073872838, 134667905].pack("V*").split(/\0/,2)[0]'
>   "  - lock 0xb752a20c: run:"
> 
> Could you please explain a little this test, I am curious

Showed that the pointer seems pointing string but not a struct
thread.

> > Could you show *(curr->next) and *(curr->next->node) instead?
> 
> (gdb) p *(curr->next)
> $10 = {next = 0x8109f38, prev = 0x82fbd00, context = {{__jmpbuf = {-1208518304, 96, 3951, -1209671504, -1217768592, -1073748120}, __mask_was_saved = 134598989, __saved_mask = {__val = {3951, 3951, 3221219160, 
>           134949991, 7273, 0, 3221219176, 3085261372, 7273, 3221219192, 3221219208, 134555027, 3085258832, 1, 3221219344, 7273, 7273, 3085261372, 3221219856, 0, 3085228132, 0, 0, 41901, 3221219236, 
>           3221219296, 3221219272, 3, 3221219300, 3085261372, 3085259932, 7273}}}}, result = 0, stk_len = 0, stk_max = 0, stk_ptr = 0x0, stk_pos = 0xbffee42c, frame = 0x0, scope = 0x0, dyna_vars = 0x0, 
>   block = 0x0, iter = 0x0, tag = 0x0, klass = 0, wrapper = 0, cref = 0xb7dfd244, flags = 0, node = 0xbfffe880, tracing = 0, errinfo = 4, last_status = 0, last_line = 0, last_match = 4, safe = 1, 
>   status = THREAD_RUNNABLE, wait_for = 0, fd = -1209706464, readfds = {__fds_bits = {0 <repeats 32 times>}}, writefds = {__fds_bits = {0 <repeats 32 times>}}, exceptfds = {__fds_bits = {
>       0 <repeats 32 times>}}, select_value = 0, delay = 0, join = 0x0, abort = 0, priority = 0, thgroup = 3077196864, locals = 0x0, thread = 3075645964}

This doesn't seem corrupt, but in the middle of initialization.

The cause was quite simple, GC run during saving thread context
and thread scheduling occurred.

#24 0x0806e9c5 in garbage_collect () at gc.c:1196
#25 0x0806efe4 in ruby_xmalloc (size=69292) at gc.c:119
#26 0x0805767d in rb_thread_save_context (th=0x872fc38) at eval.c:9920
#27 0x08067368 in rb_thread_start_0 (fn=0x8067480 <rb_thread_yield>, arg=0xb752a220, th=0x872fc38) at eval.c:11512

Hmmm, but I wonder how it can be fixed.

-- 
Nobu Nakada