From: Brian Mitchell Date: 2006-04-19T05:40:41+09:00 Subject: Re: Very Strange Error(s) On 4/18/06, Bob Hutchison wrote: > Hi, > > I've been encountering strange behaviour with Ruby recently. I'm > wondering if anybody has seen anything like this before or if anyone > has any ideas. > > Here's what's happening: > > - something that should be a String turns out to be an Integer > - if I run the same method call again, say by using a begin...rescue > in a loop, and I loop a few times it eventually works with identical > input -- if I do run it again, and if an error occurs again, it is > usually in a different place > - long running Ruby process (actually Rails running webrick in > development mode) -- I *think* I've never seen this in a short > running process > - the frequency of the error does not seem to increase (so once it > happens it does not start happening all the time, the system seems to > be behaving properly) > - error happens during a request by the user. > - error normally quite deep in an execution stack > - ruby 1.8.4 (2006-03-28) [powerpc-darwin8.5.0] -- that's OS X > - I've had this happen in XML parsers (REXML and xampl-pp), in > rubyful soup, and in some code that simply prints a tree of objects > - I cannot reproduce it reliably > > The going away on second or third try is particularly strange. > > Any ideas? I've been experiencing this same thing on Mac OS X. I haven't been able to come up with a small piece of code but it seems to happen most often in my network intensive and threaded code (I have a custom memcached client that seems to become unstable on heavy loads). I should also note that this has been for sometime but on extremely rare and hard to reproduce cases. I am running on: ruby 1.8.4 (2006-04-18) [powerpc-darwin8.6.0] I can't share the code at this point unfortunately (too large and it is up to my client that I am in contract with -- I will try to come up with something I can though). Examples of traces I get (in my log files): !! undefined method `wakeup' for -517611318:Fixnum /usr/local/lib/ruby/1.8/thread.rb:116:in `unlock' /usr/local/lib/ruby/1.8/thread.rb:137:in `synchronize' .. long trace .. !! wrong instance allocation memcache/memcache.rb:209:in `exception' memcache/memcache.rb:209:in `incr' .. long trace .. One thing I can note at this point is that it seems to always be the -517611318 magic number or a "wrong instance allocation" error. It seems to be limited to Mac OS X (I've not tested anything else but different Linux systems). I would be happy to run any test code people might have to help narrow the field down. If I get any further information I will post it to ruby-core. Brian.