Ruby 1.8.1 segfault (debian testing)

  • Thread starter francois DOT delobel removeAT free DOT fr
  • Start date
F

francois DOT delobel removeAT free DOT fr

Hello,

I've been trying to understand a segfault from ruby for quite a long
time (about one month) and I think it's time for asking for help. :-(

This bug is reproductible, on different architecture. I've tried
recompiling ruby but the same segfault happens again. The same error
happens with ruby1.6.

$ ruby -v
ruby 1.8.1 (2003-11-11) [i386-linux]

Here is the error message from ruby:
../utilities.rb:33: [BUG] Segmentation fault
ruby 1.8.1 (2003-11-11) [i386-linux]

The line in which it is signal may change.

Here is a backtrace from the dumped core:

#7 0x400f6815 in __pthread_sighandler () from /lib/libpthread.so.0
#6 0x40098fc2 in ruby_posix_signal () from /usr/lib/libruby1.8.so.1.8
#5 0x400358e1 in rb_bug () from /usr/lib/libruby1.8.so.1.8
#4 0x401b9838 in abort () from /lib/libc.so.6
#3 0x401b8324 in raise () from /lib/libc.so.6
#2 0x400f3a6b in raise () from /lib/libpthread.so.0
#1 0x400f3761 in pthread_kill () from /lib/libpthread.so.0
#0 0x401b8571 in kill () from /lib/libc.so.6

Brief description of the program:

It's a TCP server receiving requests to execute (as forked code, with
stdin/out/err redirections) from several clients. The program is
multi-threaded (and I therefore receive the "fork terminates thread"
warning when it forks). I think I've kept the number of opened FD to a
sensible value by setting the fcntl FD_CLOEXEC for each pipe/file/socket
used. Memory usage is quite low for ruby (between 10Mb and 20Mb for 40
clients). The program works fine for the first request and then
segfaults after a while (I have my 40 clients sending always the same
kind of requests).

I've tried stracing the program but I can't see any suspicious system call.

I now laking of any ideas where to look for the bug. I'm now wondering
if it may be in the ruby interpreter... ?

Does any of you have an idea of where to look, or what to do?

Fil
 
T

ts

"f" == francois DOT delobel removeAT free DOT fr <"francois DOT delobel removeAT free DOT fr"> writes:

f> Does any of you have an idea of where to look, or what to do?

Try to compile 1.8.1 with --enable-pthread
 
F

francois DOT delobel removeAT free DOT fr

ts said:
Try to compile 1.8.1 with --enable-pthread

Thanks for the help. :)

I've tried that and the segfault has "magically" disappeared. But the
time overhead for using posix threads instrad of ruby ones seems really
huge (my program keeps creating and destroying thread).


Fil
 
T

ts

The following message is a courtesy copy of an article
that has been posted to comp.lang.ruby as well.


f> Thanks for the help. :)

f> I've tried that and the segfault has "magically" disappeared. But the
f> time overhead for using posix threads instrad of ruby ones seems
f> really huge (my program keeps creating and destroying thread).

Well, I forward your message to ruby-talk to see if someone has an idea
why it exit a huge difference between ruby compiled with and without
--enable-pthread i this case

Apparently your messages don't go to ruby-talk
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top