Have I broken Try Ruby?

4 points by lexy0202 ↗ HN
Go to http://tryruby.org/ and open the network inspector.

Run `a = []` - and you should get 200 OK.

Run `a << a` - and you get a 500 internal server error.

Normally the sandbox will handle a problem by some kind of exception or text warning (e.g. on timeout), but it can't even handle the request.. so have I broken it?

Inspired by this video from a guy who works on the sandbox: http://www.youtube.com/watch?v=6XxCOYco3Eg

4 comments

[ 3.3 ms ] story [ 16.8 ms ] thread
Yep, looks like it. Be pragmatic about it, send them an email -- gregg@envylabs.com , or tweet them @codeschool .
Have filed a bug report on their support system.
Its an infinite loop. However it seems that the sandbox have some way to detect an infinite loop with while loops, etc. However this is probably an edge case they have missed.

Good catch!

I believe they use a timeout to handle infinite loops, but in 1.9.3 it doesn't actually loop anyway, you just get [[...]], and it throws an exception if you try to call a.collapse (or similar).

I'm guessing the problem would most likely be with their version of JRuby.