Hi,
I’ve wrote a multi thread application and the interpreter crash (Ruby
1.6.7-3 build 2002-03-19 under debian linux).
The application does the folowing thing:
ecah thread does:
read a value (this operation is done with a mutex)
does a tcp request
I’ve got 100 threads and after a few minutes i’ve got a segfault.
What can i do ?
···
–
Cedric Foll
How many file descriptors do you have open?
Paul
···
On Sat, Sep 07, 2002 at 01:11:20AM +0900, Cédric Foll wrote:
Hi,
I’ve wrote a multi thread application and the interpreter crash (Ruby
1.6.7-3 build 2002-03-19 under debian linux).
The application does the folowing thing:
ecah thread does:
read a value (this operation is done with a mutex)
does a tcp request
I’ve got 100 threads and after a few minutes i’ve got a segfault.
What can i do ?
How many file descriptors do you have open?
I read one file at the biginning (before running threads).
So only file descriptor i guess…
You mentioned tcp requests, and every tcp socket is also a file
descriptor. How many sockets do you have open at any given time?
Also, can you reproduce this problem in a small test case and post it to
the list?
Paul
···
On Sat, Sep 07, 2002 at 03:32:01AM +0900, Cédric Foll wrote:
How many file descriptors do you have open?
I read one file at the biginning (before running threads).
So only file descriptor i guess…
Sockets need file descriptors, too. Perhaps you ran into the same
problem as I did: See
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/41192
This problem was fixed in Ruby 1.7.
You could try to run your threaded application with
$ ruby -d application.rb
If Ruby runs out of file descriptors an exception will be raised and
printed to $stderr while debugging is switched on.
···
Am 2002-09-07 03:32:01 +0900 schrieb Cédric Foll:
How many file descriptors do you have open?
I read one file at the biginning (before running threads). So only
file descriptor i guess…
–
Most people would rather die than think; in fact, they do so.
– Bertand Russell
It was that pb (too many file descriptors).
thanks.