#<RangeError: 0x3770f58 is recycled object>

I did a Google search on this and found a lot of stuff I don’t
understand.

Is this a serious error? How would one go tracking down the cause?

Ralph S. wrote:

I did a Google search on this and found a lot of stuff I don’t
understand.

And what did it say?

Is this a serious error? How would one go tracking down the cause?

Understand the stuff you found on Google? Provide context? Use your
tests and the debugger to isolate the cause?

In short, the same answers you get whenever you ask how to track down a
problem.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Clearly, Rails is detecting some kind of internal confusion.


Someone wrote:
The error means that you’re trying to serve an object that’s been
garbage collected, which usually happens because the object went out of
scope on the server.

Your safest bet is figuring out why the object was prematurely
garbage-collected in the first place. Alternatively, you could disable
the server’s GC by calling GC.disable, which is usually a bad idea,
especially if your server is long-running.


Why should a – presumably robust – interpreter have a problem with
accessing a garbage collected object?

Ralph S. wrote:

Clearly, Rails is detecting some kind of internal confusion.


Someone wrote:
The error means that you’re trying to serve an object that’s been
garbage collected, which usually happens because the object went out of
scope on the server.

Your safest bet is figuring out why the object was prematurely
garbage-collected in the first place. Alternatively, you could disable
the server’s GC by calling GC.disable, which is usually a bad idea,
especially if your server is long-running.


Why should a – presumably robust – interpreter have a problem with
accessing a garbage collected object?

That’s utterly bizarre. In what context are you getting this error?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Ralph S. wrote:

That’s utterly bizarre. In what context are you getting this error?

I, and many others, seem to randomly get this error. Right now I am
gettnig a lot of them as I someprogram.exe (backtick execution)

Hmm … does backtick run programs in the same address space as the ruby
interpreter?

No, backtick launches a subshell to run the command…

I’m curious as to why this error is not being logged.

Well what are you shelling out? What is the full stacktrace Ruby is
giving you?

That’s utterly bizarre. In what context are you getting this error?

I, and many others, seem to randomly get this error. Right now I am
gettnig a lot of them as I someprogram.exe (backtick execution)

Hmm … does backtick run programs in the same address space as the ruby
interpreter?

I’m curious as to why this error is not being logged.

Paul H. wrote:

Ralph S. wrote:

That’s utterly bizarre. In what context are you getting this error?

I, and many others, seem to randomly get this error. Right now I am
gettnig a lot of them as I someprogram.exe (backtick execution)

Hmm … does backtick run programs in the same address space as the ruby
interpreter?

No, backtick launches a subshell to run the command…

Is that true on Windows too?

I’m curious as to why this error is not being logged.

Well what are you shelling out? What is the full stacktrace Ruby is
giving you?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Paul H. wrote:

Ralph S. wrote:

That’s utterly bizarre. In what context are you getting this error?

I, and many others, seem to randomly get this error. Right now I am
gettnig a lot of them as I someprogram.exe (backtick execution)

Hmm … does backtick run programs in the same address space as the ruby
interpreter?

No, backtick launches a subshell to run the command…

Is that true on Windows too?

Well it copies what it can of the environment, then calls CreateProcess,
which creates a child process. But yeah its a child process, different
“address space” and such all.

Are you really doing backtick execution from within a Rails app? Do you
know that will completely block the app’s execution in its current
process until it’s done? That’s undesirable at best.

Yeah, I’m doing a proof of concept thing. Blocking is not a particular
issue at this time. Plus the database is sqlite3 … and sqlite3 has
concurrency issues, anyway. Blocking in this case is, I hope, a GOOD
THING in this case.

On Feb 7, 2010, at 10:12 AM, Marnen Laibow-Koser wrote:

No, backtick launches a subshell to run the command…

Is that true on Windows too?

Why would that not be true? Windows is a multitasking OS.

I’m curious as to why this error is not being logged.

Well what are you shelling out? What is the full stacktrace Ruby is
giving you?

This is a key question. A different, but probably equally illuminating
one to the OP is:

Can you reduce this to a simple test case that others can reproduce? If
so, we can read your code. Whatever the answer is, it’s not jumping out
at anyone except to give you the literal interpretation of the error
message.

Are you really doing backtick execution from within a Rails app? Do you
know that will completely block the app’s execution in its current
process until it’s done? That’s undesirable at best.

Again, hard to answer these questions without more context.

Ralph S. wrote:

Well what are you shelling out? What is the full stacktrace Ruby is
giving you?

I don’t understand the question. I guess I could set a debug breakpoint
and do a “where” … but I’m pretty sure that’s not what you mean.

Rails always spews a stacktrace when it encounters an error. What did
the trace say?

I’m shelling out to a C++ program that I have written.

Why not use FFI?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Rails always spews a stacktrace when it encounters an error. What did
the trace say?

If it throws a trace on a
#<RangeError: 0x3770f58 is recycled object>
I cannot find it.

The following is fairly typical …

Completed in 5814ms (View: 30, DB: 2) | 200 OK
[http://localhost/signed_in/conne
cted_to_email_address]
#<RangeError: 0x37bf284 is recycled object>
#<RangeError: 0x37c0e90 is recycled object>
#<RangeError: 0x37be91a is recycled object>
#<RangeError: 0x37be988 is recycled object>

That’s from the console. There is nothing in the log with the word
“recycled” or “RangeError” in it.

Well what are you shelling out? What is the full stacktrace Ruby is
giving you?

I don’t understand the question. I guess I could set a debug breakpoint
and do a “where” … but I’m pretty sure that’s not what you mean.

I’m shelling out to a C++ program that I have written.