Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Timeout.timeout(…) fails to interrupt some code. #2287

ghost opened this Issue · 3 comments

1 participant


Code in question:

require 'timeout'
Timeout.timeout(3) do
  " " * (32**7)

Hangs for a long time & never raises Timeout::Error. ^C doesn't interrupt. Behavior is the same on MRI, so maybe it isn't worth it /too difficult to fix.


The problem is that this is code running inside the VM that takes a very long time. There isn't really any way to interrupt this. Curious as to where this comes from? It just gobbles up a large amount of memory on my system.

@dbussink dbussink closed this

@dbussink It comes from malicious code that is eval'ed by an IRC bot. I worked around it by forking a subprocess, and wrapping Process.wait in Timeout.timeout instead. Good to know this, though.


You can probably do similar things with Bignum by starting a huge computation etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.