3

Ever since switching to Mac based RoR development, I occasionally see that Webrick dies after simply printing 'Illegal Instruction 4'.

OSX 10.7.2, 10.7.3 and now 10.7.4

ruby 1.9.2p290

rails 3.2.2, and various other version starting with 3.1

So far, it's been rather innocuous, I just hit the up arrow key, hit enter, and restart the server, and everything is fine.

I've noticed that immediately after adding a new file to the development environment will almost always cause this condition. But it has happened when I haven't recently added a new file. But it almost always happens immediately after some file change. Put another way, I don't think it's ever happened when I'm just testing stuff, it seems that some kind of filesystem change is required to trigger this.

Just now, it happened, but this time it seems to of wedged up Webrick in some way, and after restarting Webrick, it wouldn't respond, I had to reboot to clear the condition. So this is starting to look less innocuous, and more like a looming development productivity problem.

Any other Mac developers seeing this?

RadBrad
  • 7,234
  • 2
  • 24
  • 17
  • Thanks for the info, never really even understood what 'acceptance' meant, now I know! – RadBrad May 21 '12 at 00:29
  • Damn, I knew answering my own questions was a bad idea, now the Stackoverflow.com gods are blotting out the sun! Seriously, here on the So Cal coast, it's intermittent clouds, and the clouds shift the apparent eclipse, it's shifting from 75%, to apparently 25% obscuration by the minute, a very weird effect! – RadBrad May 21 '12 at 01:38
  • Did you ever get a solution to this? I'm seeing the same problem on Thin and webrick on a rails 3.2.8 app under ruby 1.9.3p286. – zippy Nov 05 '12 at 14:36
  • No solution, still happens. I'm just dealing with it. – RadBrad Nov 05 '12 at 16:40

2 Answers2

1

I encountered this problem after implementing a scope on one of my models

scope :list_only, lambda { show_on_list }

(where show_on_list is an instance method). After rewriting the method to

scope :list_only, where("SomeSQLHere")

(where I used SQL in SomeSQLHere) it worked fine. I realize this doesn't address what "Illegal Instruction 4" means, but maybe the problem stems from some bad scope?

Spencer Williams
  • 902
  • 8
  • 26
-3

Do you have similar problems using non-webrick app servers? I encourage developing with the same app server you deploy with, which in this case looks to be Passenger.

x1a4
  • 19,417
  • 5
  • 40
  • 40
  • 3
    How does this answer the question? To be fair, it wasn't a real question to begin with, but other people experiencing this problem (like me) will find this page in their search results and not know what to do with this solution. – Spencer Williams Dec 08 '12 at 04:25
  • It's roundabout, so here's a more explicit answer: do not use webrick EVER. If you are not developing on the same app server you deploy with, you are doing it wrong. – x1a4 Dec 08 '12 at 04:47
  • For me the illegal instruction problem is random, but is always triggered by changing the rails code. For me, I want to test locally, so I just continue to use Webrick. I've never encountered a situation where something buggy slipped into production because of developing on Webrick. The only real issue is every once in a while, webrick crashes, it just go to console, hit up arrow, enter, and restart the server and continue on. It's not a big deal to me. – RadBrad Dec 10 '12 at 17:28