Project

General

Profile

Actions

Bug #11418

closed

spawn segfaults

Added by nobu (Nobuyoshi Nakada) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:70251]

Description

Process.spawn sometimes segfaults, because buffer allocated by ALLOCV_N is not marked, when the size exceeds 1024 bytes.
In these days, TestEncodingConverter#test_default_external has occasionally segfaulted by this problem.

Until 2.2, this has not appeared since Process.spawn didn't use ALLOCV_N.
Maybe unnecessary before 2.2.


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #12507: random SEGV in kernel.system when called with long parametre listClosedActions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Status changed from Open to Closed

Applied in changeset r51492.


node.c: NODE_ALLOCA for ALLOCV

  • node.c (rb_alloc_tmp_buffer): use NODE_ALLOCA to mark locations
    like as builtin alloca. [ruby-core:70251] [Bug #11418]

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

Hi, nakada san.

Maybe unnecessary before 2.2.

But Backport field was filled with REQUIRED for 2.0.0 and 2.1. Which is your intention?

Anyway, I try to reproduce the issue on ruby_2_2 branch with the following patch.

Index: test/ruby/test_econv.rb
===================================================================
--- test/ruby/test_econv.rb     (revision 51517)
+++ test/ruby/test_econv.rb     (working copy)
@@ -913,6 +913,7 @@
   end
 
   def test_default_external
+    GC.stress = true
     Encoding.list.grep(->(enc) {/\AISO-8859-\d+\z/i =~ enc.name}) do |enc|
       assert_separately(%W[--disable=gems -d - #{enc.name}], <<-EOS, ignore_stderr: true)
     Encoding.default_external = ext = ARGV[0]
@@ -922,5 +923,7 @@
     end
     EOS
     end
+  ensure
+    GC.stress = false
   end
 end

But make test-all TESTS='ruby/test_econv.rb -n test_default_external' finished successfully. Is there anything I overlooked?

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

Because,

Until 2.2, this has not appeared since Process.spawn didn't use ALLOCV_N.

Other methods storing VALUEs in ALLOCVed buffers may cause segfaults.

Actions #4

Updated by wanabe (_ wanabe) over 7 years ago

  • Related to Bug #12507: random SEGV in kernel.system when called with long parametre list added
Actions #5

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Related to deleted (Bug #12507: random SEGV in kernel.system when called with long parametre list)
Actions #6

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Has duplicate Bug #12507: random SEGV in kernel.system when called with long parametre list added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0