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

ruby-changes:27788

From: nagachika <ko1@a...>
Date: Wed, 20 Mar 2013 22:38:00 +0900 (JST)
Subject: [ruby-changes:27788] nagachika:r39840 (ruby_2_0_0): merge revision(s) 39775: [Backport #8080]

nagachika	2013-03-20 22:37:48 +0900 (Wed, 20 Mar 2013)

  New Revision: 39840

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

  Log:
    merge revision(s) 39775: [Backport #8080]
    
    * thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
      [Bug #8080] [ruby-core:53349]
    
    * test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
      test for the above.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/test/ruby/test_io.rb
    branches/ruby_2_0_0/thread.c
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 39839)
+++ ruby_2_0_0/ChangeLog	(revision 39840)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Wed Mar 20 22:36:41 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
+	  [Bug #8080] [ruby-core:53349]
+	* test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
+	  test for the above.
+
 Wed Mar 20 22:34:52 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* include/ruby/missing.h (__syscall): moved to...
Index: ruby_2_0_0/thread.c
===================================================================
--- ruby_2_0_0/thread.c	(revision 39839)
+++ ruby_2_0_0/thread.c	(revision 39840)
@@ -42,6 +42,19 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/thread.c#L42
  */
 
 
+/*
+ * FD_SET, FD_CLR and FD_ISSET have a small sanity check when using glibc
+ * 2.15 or later and set _FORTIFY_SOURCE > 0.
+ * However, the implementation is wrong. Even though Linux's select(2)
+ * support large fd size (>FD_SETSIZE), it wrongly assume fd is always
+ * less than FD_SETSIZE (i.e. 1024). And then when enabling HAVE_RB_FD_INIT,
+ * it doesn't work correctly and makes program abort. Therefore we need to
+ * disable FORTY_SOURCE until glibc fixes it.
+ */
+#undef _FORTIFY_SOURCE
+#undef __USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL 0
+
 /* for model 2 */
 
 #include "eval_intern.h"
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 39839)
+++ ruby_2_0_0/version.h	(revision 39840)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-03-20"
-#define RUBY_PATCHLEVEL 75
+#define RUBY_PATCHLEVEL 76
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_0_0/test/ruby/test_io.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_io.rb	(revision 39839)
+++ ruby_2_0_0/test/ruby/test_io.rb	(revision 39840)
@@ -2629,5 +2629,30 @@ End https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_io.rb#L2629
     s.puts(c.new)
     assert_equal("[...]\n", s.string, bug5986)
   end
-end
 
+  def test_io_select_with_many_files
+    bug8080 = '[ruby-core:53349]'
+
+    assert_normal_exit %q{
+      require "tempfile"
+
+      # try to raise RLIM_NOFILE to >FD_SETSIZE
+      # Unfortunately, ruby export FD_SETSIZE. then we assume it's 1024.
+      fd_setsize = 1024
+
+      begin
+        Process.setrlimit(Process::RLIMIT_NOFILE, fd_setsize+10)
+      rescue =>e
+        # Process::RLIMIT_NOFILE couldn't be raised. skip the test
+        exit 0
+      end
+
+      tempfiles = []
+      (0..fd_setsize+1).map {|i|
+        tempfiles << Tempfile.open("test_io_select_with_many_files")
+      }
+
+      IO.select(tempfiles)
+  }, bug8080
+  end
+end

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39775


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

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