https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17097754782011-09-30T18:43:27ZRuby Issue Tracking SystemRuby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210702011-09-30T18:43:27Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul></ul><p>Thank you for reporting a bug.</p>
<p>I can reproduce similar SEGV on "ruby 1.9.4dev (2011-09-30 trunk 33364) [i686-linux]"<br>
The following patch seems fix this issue.</p>
<p>Narihiro-san, could you take a glance to this patch?</p>
<p>diff --git a/gc.c b/gc.c<br>
index fad49e0..1fce29a 100644<br>
--- a/gc.c<br>
+++ b/gc.c<br>
@@ -1090,6 +1090,7 @@ add_heap_slots(rb_objspace_t *objspace, size_t add)<br>
for (i = 0; i < add; i++) {<br>
assign_heap_slot(objspace);<br>
}</p>
<ul>
<li>heaps_inc = 0;<br>
}</li>
</ul>
<p>static void<br>
@@ -1106,7 +1107,6 @@ init_heap(rb_objspace_t *objspace)<br>
}<br>
#endif</p>
<ul>
<li>heaps_inc = 0;<br>
objspace->profile.invoke_time = getrusage_time();<br>
finalizer_table = st_init_numtable();<br>
}</li>
</ul> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210712011-09-30T20:04:20Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul></ul><p>BTW, when GC parameters are set by environment variable, some messages are output to standard output with printf().<br>
I wonder if these are statements for debug and should be eliminated. Can I delete them?</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210732011-10-01T00:17:50ZauthorNari (Narihiro Nakamura)authorNari@gmail.com
<ul></ul><p>Tomoyuki Chikanaga wrote:</p>
<blockquote>
<p>Thank you for reporting a bug.</p>
<p>I can reproduce similar SEGV on "ruby 1.9.4dev (2011-09-30 trunk 33364) [i686-linux]"<br>
The following patch seems fix this issue.</p>
<p>Narihiro-san, could you take a glance to this patch?</p>
<p>diff --git a/gc.c b/gc.c<br>
index fad49e0..1fce29a 100644<br>
--- a/gc.c<br>
+++ b/gc.c<br>
@@ -1090,6 +1090,7 @@ add_heap_slots(rb_objspace_t *objspace, size_t add)<br>
for (i = 0; i < add; i++) {<br>
assign_heap_slot(objspace);<br>
}</p>
<ul>
<li>heaps_inc = 0;<br>
}</li>
</ul>
<p>static void<br>
@@ -1106,7 +1107,6 @@ init_heap(rb_objspace_t *objspace)<br>
}<br>
#endif</p>
<ul>
<li>heaps_inc = 0;<br>
objspace->profile.invoke_time = getrusage_time();<br>
finalizer_table = st_init_numtable();<br>
}</li>
</ul>
</blockquote>
<p>Thanks! Please commit this patch.</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210742011-10-01T00:21:46ZauthorNari (Narihiro Nakamura)authorNari@gmail.com
<ul></ul><p>Tomoyuki Chikanaga wrote:</p>
<blockquote>
<p>BTW, when GC parameters are set by environment variable, some messages are output to standard output with printf().<br>
I wonder if these are statements for debug and should be eliminated. Can I delete them?</p>
</blockquote>
<p>I think this behavior is specific.<br>
Matz, What do you think?</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210752011-10-01T00:29:37Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Narihiro Nakamura wrote:</p>
<blockquote>
<p>Tomoyuki Chikanaga wrote:</p>
<blockquote>
<p>BTW, when GC parameters are set by environment variable, some messages are output to standard output with printf().<br>
I wonder if these are statements for debug and should be eliminated. Can I delete them?</p>
</blockquote>
<p>I think this behavior is specific.</p>
</blockquote>
<p>I think they should be shown only when GC_NOTIFY is set, at least.</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210762011-10-01T03:26:58Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>Nobuyoshi Nakada wrote:</p>
<blockquote>
<blockquote>
<p>I think this behavior is specific.</p>
</blockquote>
<p>I think they should be shown only when GC_NOTIFY is set, at least.</p>
</blockquote>
<p>or when -w option is specified.</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210772011-10-01T10:00:42Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r33368.<br>
saber, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>gc.c (add_heap_slots, init_heap): reset heaps_inc zero when<br>
heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.<br>
<a href="/issues/5380">[ruby-core:39777]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: gc params cause Segmentation fault (Closed)" href="https://bugs.ruby-lang.org/issues/5380">#5380</a>]</p>
</li>
<li>
<p>test/ruby/test_gc.rb (test_gc_parameter): add test for it.</p>
</li>
<li>
<p>test/ruby/envutil.rb (assert_normal_exit): add :child_env option to<br>
enable pass environemnt variables to child process.</p>
</li>
</ul> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=210822011-10-01T11:22:59Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/2107">gc_parameter_message.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2107/gc_parameter_message.patch">gc_parameter_message.patch</a> added</li><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>nagachika (Tomoyuki Chikanaga)</i></li><li><strong>Target version</strong> set to <i>1.9.3</i></li></ul><p>Yukihiro Matsumoto wrote:</p>
<blockquote>
<p>Nobuyoshi Nakada wrote:</p>
<blockquote>
<blockquote>
<blockquote>
<p>I think this behavior is specific.</p>
</blockquote>
</blockquote>
<p>I think they should be shown only when GC_NOTIFY is set, at least.</p>
</blockquote>
<p>or when -w option is specified.<br>
Thank you for your comments.</p>
</blockquote>
<p>I think shown with -w option is fine.<br>
And I feel it's more natural the messages shown with -w are outputted to stderr.<br>
I attach a patch with test.<br>
If there's no opposite opinion, I'll check in it.</p> Ruby master - Bug #5380: gc params cause Segmentation faulthttps://bugs.ruby-lang.org/issues/5380?journal_id=211122011-10-04T00:03:01Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>This issue was solved with changeset r33379.<br>
saber, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>gc.c (rb_gc_set_params): output GC parameter change messages only<br>
if -w/-v options are specified. these messages are output to stderr,<br>
not to stdout. <a href="/issues/5380">[ruby-core:39795]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: gc params cause Segmentation fault (Closed)" href="https://bugs.ruby-lang.org/issues/5380">#5380</a>]</p>
</li>
<li>
<p>test/ruby/test_gc.rb (test_gc_parameter): add test for it.</p>
</li>
</ul>