Bug #11418
closed
Added by nobu (Nobuyoshi Nakada) about 9 years ago.
Updated about 9 years ago.
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.
- 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]
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?
Because,
Until 2.2, this has not appeared since Process.spawn
didn't use ALLOCV_N
.
Other methods storing VALUE
s in ALLOCV
ed buffers may cause segfaults.
- Related to Bug #12507: random SEGV in kernel.system when called with long parametre list added
- Related to deleted (Bug #12507: random SEGV in kernel.system when called with long parametre list)
- Has duplicate Bug #12507: random SEGV in kernel.system when called with long parametre list added
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0