infinite loop in Tempfile.new

  • Follow


I wrote a little program that happens to use Tempfile.  Whenever it got
to that point, it would crash with a "too many open files" error.

Investigation (via "puts" statements) revealed that Tempfile.new is
(indirectly) invoking Tempfile.new.

Specifically, at the line:

   super(@tmpfile)

"puts" statements immediately before and after that, plus one at the
very top of Tempfile.new, show that it reaches that line, and then goes
back to the top of Tempfile.new, without ever getting past that line,
over and over, until the system eventually gets to "too many open
files".

I reduced my program to a very basic one, just doing Tempfile.new and
nothing else, and didn't get this problem.  So it must be some
interaction with something else in my program.  Unfortunately, I don't
currently have time to investigate further, and cannot post my code as
is.  But I figured I should let somebody know that there is definitely
some sort of infinite loop, under some condition, associated with that
line.

Incidentally, this was originally in 1.8.4; I upgraded to 1.8.6, and had
the same problem.

-- 
Posted via http://www.ruby-forum.com/.

0
Reply d809fvy5rtsqx4z (1) 5/1/2007 6:09:43 PM

Hi,

In message "Re: infinite loop in Tempfile.new"
    on Wed, 2 May 2007 03:09:43 +0900, Boop Boop <d809fvy5rtsqx4z@temporaryinbox.com> writes:

|Investigation (via "puts" statements) revealed that Tempfile.new is
|(indirectly) invoking Tempfile.new.
|
|Specifically, at the line:
|
|   super(@tmpfile)
|
|"puts" statements immediately before and after that, plus one at the
|very top of Tempfile.new, show that it reaches that line, and then goes
|back to the top of Tempfile.new, without ever getting past that line,
|over and over, until the system eventually gets to "too many open
|files".
|
|I reduced my program to a very basic one, just doing Tempfile.new and
|nothing else, and didn't get this problem.  So it must be some
|interaction with something else in my program.  Unfortunately, I don't
|currently have time to investigate further, and cannot post my code as
|is.  But I figured I should let somebody know that there is definitely
|some sort of infinite loop, under some condition, associated with that
|line.

Thank you for the report, but it's difficult to fix the problem
without error reproducing code.  Does anyone meet similar problem with
Tempfile?

							matz.

0
Reply matz (1855) 5/1/2007 11:31:07 PM


1 Replies
43 Views

(page loaded in 0.101 seconds)

Similiar Articles:













7/25/2012 10:51:20 AM


Reply: