From: "shyouhei (Shyouhei Urabe)" Date: 2012-04-27T14:31:44+09:00 Subject: [ruby-core:44680] [Ruby 1.8 - Bug #6366] Regex freezes Ruby Issue #6366 has been updated by shyouhei (Shyouhei Urabe). No, sorry. You _cant_ detect whether your program locks up. http://en.wikipedia.org/wiki/Halting_problem ---------------------------------------- Bug #6366: Regex freezes Ruby https://bugs.ruby-lang.org/issues/6366#change-26245 Author: vertis (Luke Chadwick) Status: Rejected Priority: Normal Assignee: Category: Target version: Ruby 1.8.7 ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.3.0] I stumbled across a weird error on Ruby 1.8.7p352, where String.match locks up: "#^(?:export)?\s*(\w+)=(.*)".match(/^(?:export[\s]+)?([\w_]*)+?=(.*)/) I had, apparently, pasted a regular expression into a file(bash) that I was testing, and commented it out. I'm assuming I did this to clear my clipboard. I was then running the following match on each line in the file & consistently had the ruby interpreter lockup (not even Ctrl-C was working, though Ctrl-Z did). I have replicated this on both MacOS (homebrew) and CentOS 6 1.8.7p352, but this doesn't happen in Ruby 1.9.2p0. -- http://bugs.ruby-lang.org/