[前][次][番号順一覧][スレッド一覧]

ruby-changes:27842

From: naruse <ko1@a...>
Date: Sun, 24 Mar 2013 04:52:37 +0900 (JST)
Subject: [ruby-changes:27842] naruse:r39894 (trunk): Add timeout to infinite loop [Bug #8100]

naruse	2013-03-24 04:50:49 +0900 (Sun, 24 Mar 2013)

  New Revision: 39894

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39894

  Log:
    Add timeout to infinite loop [Bug #8100]
    
    On FreeBSD, it doesn't SEGV.
    http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20130323T170203Z.log.html.gz

  Modified files:
    trunk/KNOWNBUGS.rb

Index: KNOWNBUGS.rb
===================================================================
--- KNOWNBUGS.rb	(revision 39893)
+++ KNOWNBUGS.rb	(revision 39894)
@@ -4,10 +4,13 @@ https://github.com/ruby/ruby/blob/trunk/KNOWNBUGS.rb#L4
 #
 
 assert_normal_exit %q{
-  loop do
-    def x
-      "hello" * 1000
+  require 'timeout'
+  timeout(2) do
+    loop do
+      def x
+        "hello" * 1000
+      end
+      method(:x).call
     end
-    method(:x).call
   end
 }, '[ruby-core:53640] [Bug #8100]'

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]