First of all, thanks so much to all those that have helped with 
improving the state of --enable-pthread support. That said, I'm 
encountering another issue...

Every once in a while my app will hang for period (seems to average 
around 30 minutes), and then it will continue as though nothing 
happened. It's hard to catch it in the act, but last time I did, I 
quickly found out from ps that it's hanging in:

   WCHAN
   wait_for_tcp_memory

Attaching to the process with GDB seems to unhang it as soon as I 
continue it, but I grabbed the following backtrace first that hopefully 
is indicative of the actual place that it's hanging:

   #0  0x4018892b in write () from /lib/libc.so.6
   #1  0x401ee290 in sys_sigabbrev () from /lib/libc.so.6
   #2  0x40128cee in _IO_do_write () from /lib/libc.so.6
   #3  0x4012a450 in _IO_file_xsputn () from /lib/libc.so.6
   #4  0x4011f80f in fwrite () from /lib/libc.so.6
   #5  0x08078843 in rb_io_fwrite (
       ptr=0x8808f80 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 
Transitional//EN\">\n<HTML>\n  <HEAD>\n    <META 
HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; 
charset=ISO-8859-1\">\n    <TITLE>CharacterLink 
Protection</TITLE>\n"..., len=12549, f=0x8516fa8) at io.c:396
   #6  0x080789c3 in io_write (io=1083762312, str=1083395412) at io.c:431
   #7  0x0806ba1f in call_cfunc (func=0x80788d4 <io_write>, 
recv=1083762312, len=1, argc=1,
       argv=0xbffeae90) at eval.c:4938
   #8  0x0805e405 in rb_call0 (klass=1075936164, recv=1083762312, 
id=7249, oid=7249, argc=1,
       argv=0xbffeae90, body=0x4021762c, nosuper=0) at eval.c:5066
   #9  0x0805ef58 in rb_call (klass=1075936164, recv=1083762312, 
mid=7249, argc=1, argv=0xbffeae90,
       scope=1) at eval.c:5287
   #10 0x0805f146 in rb_funcall (recv=1083762312, mid=7249, n=1) at 
eval.c:5352
   #11 0x08078a3f in rb_io_write (io=1083762312, str=1083395412) at 
io.c:447
   #12 0x08078a62 in rb_io_addstr (io=1083762312, str=1083395412) at 
io.c:454
   #13 0x0806ba1f in call_cfunc (func=0x8078a4c <rb_io_addstr>, 
recv=1083762312, len=1, argc=1,
       argv=0xbffeb1d0) at eval.c:4938
   #14 0x0805e405 in rb_call0 (klass=1075936164, recv=1083762312, 
id=334, oid=334, argc=1,
       argv=0xbffeb1d0, body=0x4021753c, nosuper=0) at eval.c:5066
   #15 0x0805ef58 in rb_call (klass=1075936164, recv=1083762312, 
mid=334, argc=1, argv=0xbffeb1d0,
       scope=0) at eval.c:5287
   #16 0x08058b0a in rb_eval (self=1083761812, n=0x40646338) at 
eval.c:3076
   #17 0x0805ea0f in rb_call0 (klass=1080320404, recv=1083761812, 
id=30833, oid=30833, argc=0,
       argv=0xbffebe58, body=0x40646338, nosuper=0) at eval.c:5194
   #18 0x0805ef58 in rb_call (klass=1080320404, recv=1083761812, 
mid=30833, argc=2, argv=0xbffebe50,
       scope=1) at eval.c:5287
   #19 0x08058dc4 in rb_eval (self=1083761812, n=0x40646dc4) at 
eval.c:3091
   #20 0x0805ea0f in rb_call0 (klass=1080320404, recv=1083761812, 
id=30849, oid=30849, argc=0,
       argv=0xbffecad4, body=0x40646dc4, nosuper=0) at eval.c:5194
   #21 0x0805ef58 in rb_call (klass=1080320404, recv=1083761812, 
mid=30849, argc=1, argv=0xbffecad0,
       scope=1) at eval.c:5287
   #22 0x08058dc4 in rb_eval (self=1083761812, n=0x4064a0dc) at 
eval.c:3091
   #23 0x0805ea0f in rb_call0 (klass=1080320404, recv=1083761812, 
id=24137, oid=24137, argc=0,
       argv=0xbffed744, body=0x4064a0dc, nosuper=0) at eval.c:5194
   #24 0x0805ef58 in rb_call (klass=1080320404, recv=1083761812, 
mid=24137, argc=1, argv=0xbffed740,
       scope=1) at eval.c:5287
   #25 0x08058dc4 in rb_eval (self=1083761812, n=0x4030d87c) at 
eval.c:3091
   #26 0x08057def in rb_eval (self=1083761812, n=0x4030c878) at 
eval.c:2883
   #27 0x0805ea0f in rb_call0 (klass=1080320404, recv=1083761812, 
id=24105, oid=24105, argc=0,
       argv=0xbffeeda4, body=0x4030c878, nosuper=1) at eval.c:5194
   #28 0x0805ef58 in rb_call (klass=1080320404, recv=1083761812, 
mid=24105, argc=1, argv=0xbffeeda0,
       scope=0) at eval.c:5287
   #29 0x08058b0a in rb_eval (self=1083724132, n=0x40643e44) at 
eval.c:3076
   #30 0x08058088 in rb_eval (self=1083724132, n=0x40644b64) at 
eval.c:2939
   #31 0x08057413 in rb_eval (self=1083724132, n=0x40643b74) at 
eval.c:2720
   #32 0x0805ea0f in rb_call0 (klass=1080113664, recv=1083724132, 
id=5089, oid=5089, argc=0,
       argv=0xbfff0dc4, body=0x40643b74, nosuper=0) at eval.c:5194
   #33 0x0805ef58 in rb_call (klass=1080113664, recv=1083724132, 
mid=5089, argc=1, argv=0xbfff0dc0,
       scope=1) at eval.c:5287
   #34 0x08058dc4 in rb_eval (self=1083724132, n=0x403198ac) at 
eval.c:3091
   #35 0x08057def in rb_eval (self=1083724132, n=0x40317b9c) at 
eval.c:2883
   #36 0x08058031 in rb_eval (self=1083724132, n=0x40317994) at 
eval.c:2932
   #37 0x0805c5d4 in rb_yield_0 (val=1083762212, self=1083724132, 
klass=0, flags=2, avalue=2)
       at eval.c:4293
   #38 0x080699b0 in rb_thread_yield (arg=1083762212, th=0x8853150) at 
eval.c:9777
   #39 0x0806964f in rb_thread_start_0 (fn=0x80698e4 <rb_thread_yield>, 
arg=0x4098e624, th=0x8853150)
       at eval.c:9691
   #40 0x08069b03 in rb_thread_start (klass=1075962104, args=1083762212) 
at eval.c:9816
   #41 0x0806b9c4 in call_cfunc (func=0x8069ab4 <rb_thread_start>, 
recv=1075962104, len=-2, argc=0,
       argv=0x0) at eval.c:4929
   #42 0x0805e405 in rb_call0 (klass=1075962084, recv=1075962104, 
id=5009, oid=5009, argc=0,
       argv=0x0, body=0x4021e06c, nosuper=0) at eval.c:5066
   #43 0x0805ef58 in rb_call (klass=1075962084, recv=1075962104, 
mid=5009, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #44 0x08058b0a in rb_eval (self=1083724132, n=0x40319a14) at 
eval.c:3076
   #45 0x0805788c in rb_eval (self=1083724132, n=0x40319a50) at 
eval.c:2796
   #46 0x0805ea0f in rb_call0 (klass=1080806404, recv=1083724132, 
id=23881, oid=23881, argc=0,
       argv=0xbfff4934, body=0x40319a50, nosuper=1) at eval.c:5194
   #47 0x0805ef58 in rb_call (klass=1080806404, recv=1083724132, 
mid=23881, argc=1, argv=0xbfff4930,
       scope=1) at eval.c:5287
   #48 0x08058dc4 in rb_eval (self=1083724132, n=0x40314474) at 
eval.c:3091
   #49 0x08064189 in block_pass (self=1083724132, node=0x403144b0) at 
eval.c:7362
   #50 0x080576e4 in rb_eval (self=1083724132, n=0x403144b0) at 
eval.c:2782
   #51 0x08059b49 in rb_eval (self=1083724132, n=0x40313d08) at 
eval.c:3269
   #52 0x0805c5d4 in rb_yield_0 (val=1083723332, self=1083724132, 
klass=0, flags=0, avalue=0)
       at eval.c:4293
   #53 0x0805c886 in rb_yield (val=1083723332) at eval.c:4346
   #54 0x080d4fdf in rb_ary_each (ary=1083762452) at array.c:1106
   #55 0x0806b9fd in call_cfunc (func=0x80d4fa8 <rb_ary_each>, 
recv=1083762452, len=0, argc=0,
       argv=0x0) at eval.c:4935
   #56 0x0805e405 in rb_call0 (klass=1075947224, recv=1083762452, 
id=3833, oid=3833, argc=0,
       argv=0x0, body=0x4021a2b4, nosuper=0) at eval.c:5066
   #57 0x0805ef58 in rb_call (klass=1075947224, recv=1083762452, 
mid=3833, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #58 0x08058b0a in rb_eval (self=1083724132, n=0x4031511c) at 
eval.c:3076
   #59 0x0805788c in rb_eval (self=1083724132, n=0x40313a60) at 
eval.c:2796
   #60 0x08057def in rb_eval (self=1083724132, n=0x40311670) at 
eval.c:2883
   #61 0x08057413 in rb_eval (self=1083724132, n=0x4030f2d0) at 
eval.c:2720
   #62 0x0805c5d4 in rb_yield_0 (val=6, self=1083724132, klass=0, 
flags=0, avalue=0) at eval.c:4293
   #63 0x08057d30 in rb_eval (self=1080806604, n=0x406c34c8) at 
eval.c:2872
   #64 0x0805ea0f in rb_call0 (klass=1080806564, recv=1080806604, 
id=5009, oid=5009, argc=0,
       argv=0x0, body=0x406c34c8, nosuper=0) at eval.c:5194
   #65 0x0805ef58 in rb_call (klass=1080806564, recv=1080806604, 
mid=5009, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #66 0x08058b0a in rb_eval (self=1083724132, n=0x403170fc) at 
eval.c:3076
   #67 0x0805788c in rb_eval (self=1083724132, n=0x403176d8) at 
eval.c:2796
   #68 0x0805ea0f in rb_call0 (klass=1080806404, recv=1083724132, 
id=5009, oid=5009, argc=0,
       argv=0x0, body=0x403176d8, nosuper=0) at eval.c:5194
   #69 0x0805ef58 in rb_call (klass=1080806404, recv=1083724132, 
mid=5009, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #70 0x08058b0a in rb_eval (self=1083725292, n=0x403094e8) at 
eval.c:3076
   #71 0x0805ea0f in rb_call0 (klass=1077027812, recv=1083725292, 
id=5009, oid=5009, argc=0,
       argv=0x0, body=0x403094e8, nosuper=0) at eval.c:5194
   #72 0x0805ef58 in rb_call (klass=1077027812, recv=1083725292, 
mid=5009, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #73 0x08058b0a in rb_eval (self=1076560552, n=0x402107f0) at 
eval.c:3076
   #74 0x0805ea0f in rb_call0 (klass=1077021532, recv=1076560552, 
id=10321, oid=10321, argc=0,
       argv=0x0, body=0x402107f0, nosuper=0) at eval.c:5194
   #75 0x0805ef58 in rb_call (klass=1077021532, recv=1076560552, 
mid=10321, argc=0, argv=0x0,
       scope=2) at eval.c:5287
   #76 0x08058dfc in rb_eval (self=1076560552, n=0x4020ddd4) at 
eval.c:3097
   #77 0x0805ea0f in rb_call0 (klass=1076564132, recv=1076560552, 
id=5009, oid=5009, argc=0,
       argv=0xbfffe2b4, body=0x4020ddd4, nosuper=0) at eval.c:5194
   #78 0x0805ef58 in rb_call (klass=1076564132, recv=1076560552, 
mid=5009, argc=0, argv=0xbfffe2b4,
       scope=1) at eval.c:5287
   #79 0x0805f083 in rb_f_send (argc=0, argv=0xbfffe2b4, 
recv=1076560552) at eval.c:5317
   #80 0x0806b9e3 in call_cfunc (func=0x805eff4 <rb_f_send>, 
recv=1076560552, len=-1, argc=1,
       argv=0xbfffe2b0) at eval.c:4932
   #81 0x0805e405 in rb_call0 (klass=1075977384, recv=1076560552, 
id=4033, oid=4033, argc=1,
       argv=0xbfffe2b0, body=0x4021fdb8, nosuper=0) at eval.c:5066
   #82 0x0805ef58 in rb_call (klass=1075977384, recv=1076560552, 
mid=4033, argc=1, argv=0xbfffe2b0,
       scope=1) at eval.c:5287
   #83 0x08058dc4 in rb_eval (self=1076560552, n=0x4020e720) at 
eval.c:3091
   #84 0x0805ea0f in rb_call0 (klass=1076564132, recv=1076560552, 
id=5089, oid=5089, argc=0,
       argv=0x0, body=0x4020e720, nosuper=0) at eval.c:5194
   #85 0x0805ef58 in rb_call (klass=1076564132, recv=1076560552, 
mid=5089, argc=0, argv=0x0, scope=0)
       at eval.c:5287
   #86 0x08058b0a in rb_eval (self=1075972624, n=0x402111b4) at 
eval.c:3076
   #87 0x08053e00 in eval_node (self=1075972624, node=0x402111b4) at 
eval.c:1267
   #88 0x08054450 in ruby_exec () at eval.c:1436
   #89 0x080544cd in ruby_run () at eval.c:1457
   #90 0x08052233 in main (argc=3, argv=0xbffffb34, envp=0xbffffb44) at 
main.c:50

Unfortunately, I have no clue as to how to duplicate the problem in a 
smaller example :-(. The hang is so infrequent (I've caught it three 
times in three days of running; I need to go back to my logs and see if 
it's happened more than that) that it's hard to know where to begin. 
Any help would, of course, be appreciated.

Thanks,


Nathaniel

<:((><