https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico2013-03-18T10:51:48ZRuby Issue Tracking SystemRuby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=376842013-03-18T10:51:48ZZachary Scottzzak@ruby-lang.org
<ul><li><strong>ruby -v</strong> changed from <i>ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]</i> to <i>ruby 2.1.0dev (2013-03-18 trunk 39805) [x86_64-linux]</i></li><li><strong>File</strong> <a href="/attachments/download/3605/segfault_spec.tar.gz">segfault_spec.tar.gz</a> added</li><li><strong>Subject</strong> changed from <i>Segfault in ruby-2.0.0p0</i> to <i>Segfault in trunk</i></li><li><strong>Target version</strong> set to <i>2.1.0</i></li></ul><p>I&#39;ve updated the description of this ticket, because I&#39;m able to reproduce a similar bug. Only similar in that we&#39;re using a lot of the same dependencies.</p>
<p>I also went ahead and created (as small as possible) reproducible script. Here&#39;s the instructions for reproducing the segfault:</p>
<p>1) git clone git://github.com/zzak/segfault_spec.rb.git<br>
2) bundle install<br>
3) bundle exec rspec segfault_spec.rb<br>
4) repeat #3 until segfault. this may take a few tries</p>
<p>I will also attach an archive of the script.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=376882013-03-18T16:14:01ZDavide D'Agostinoinfo@daddye.it
<ul><li><strong>File</strong> <a href="/attachments/download/3606/seg.txt">seg.txt</a><a href="/attachments/3606/seg.txt"><img src="/images/magnifier.png" alt="Magnifier" /></a> added</li></ul><p>I got a similar one too, see here: <a href="https://github.com/padrino/padrino-framework/issues/1131">https://github.com/padrino/padrino-framework/issues/1131</a></p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=377012013-03-19T01:11:42ZZachary Scottzzak@ruby-lang.org
<ul></ul><p>Forgot to add a link to the repo on github: <a href="https://github.com/zzak/segfault_spec.rb">https://github.com/zzak/segfault_spec.rb</a></p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=377212013-03-19T15:05:06ZTom Wardroptom@tomwardrop.com
<ul></ul><p>I&#39;m also getting segfaults on Ruby 2.0.0. It seems to be related to threading or forking. Can&#39;t quite put my figure on it. All I can say is that I don&#39;t get in when running my web app in WEBrick on my Mac, but if running it on my CentOS server with Phusion Passenger using the smart spawn method, I get it all the time, about every 10th request it segfaults. Setting passenger to a conservative spawn method (one request per process) reduces the segfault rate considerably, but they still occur.</p>
<p>Here&#39;s a stack overflow thread about it, with a response I left on there with a bit more information about my experiences: <a href="http://stackoverflow.com/questions/15315809/segfault-error-in-sinatra-after-upgrading-to-ruby-2-0-beta/15492401#15492401">http://stackoverflow.com/questions/15315809/segfault-error-in-sinatra-after-upgrading-to-ruby-2-0-beta/15492401#15492401</a></p>
<p>I also reported this to the Phusion Passenger Google Group before realising it&#39;s a problem with ruby 2.0.0: <a href="https://groups.google.com/forum/?fromgroups=#!topic/phusion-passenger/iEOE4shl_jE">https://groups.google.com/forum/?fromgroups=#!topic/phusion-passenger/iEOE4shl_jE</a></p>
<p>Here&#39;s a log including numerous segfaults from my CentOS server running Phusion Passenger: <a href="https://gist.github.com/Wardrop/5179380">https://gist.github.com/Wardrop/5179380</a></p>
<p>Either way, it looks like something common to web applications is causing this, or perhaps web application frameworks are so far the most common cases in which Ruby 2.0.0 is being used.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378132013-03-22T18:38:38ZMagnus Holmjudofyr@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/download/3621/fail.rb">fail.rb</a><a href="/attachments/3621/fail.rb"><img src="/images/magnifier.png" alt="Magnifier" /></a> added</li></ul><p>I&#39;ve managed to reduce the script down to 30 lines (with no dependencies) that segfaults in both 2.0.0-p0 and trunk (39875). It doesn&#39;t segfault every time though so if it takes more than a few seconds to run it, simply Ctrl-C and try again.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378142013-03-22T19:01:09ZMagnus Holmjudofyr@gmail.com
<ul></ul><p>Here&#39;s a backtrace I got in gdb: <a href="http://pastie.org/7064676">http://pastie.org/7064676</a>. rb_gc_mark_unlinked_live_method_entries seems suspicious and related to what the script does.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378152013-03-22T19:15:31ZTom Wardroptom@tomwardrop.com
<ul></ul><p>They&#39;ve obviously done work on the garbage collector for Ruby 2.0. This is likely a bug introduced as result of that. Good work tracking it down judofyr.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378162013-03-22T19:54:43ZMagnus Holmjudofyr@gmail.com
<ul></ul><p>After working with charliesome we&#39;ve now found an even simpler test case:</p>
<p><a href="http://eval.in/13339">http://eval.in/13339</a></p>
<p>This <em>always</em> segfaults for me on trunk.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378192013-03-22T20:22:29ZCharlie Somervillecharliesome@ruby-lang.org
<ul></ul><p>=begin<br>
Magnus and I reduced this down to an even simpler<sup>2</sup> test case:</p>
<p>loop do<br>
def x<br>
&quot;hello&quot; * 1000<br>
end</p>
<pre>method(:x).call
</pre>
<p>end</p>
<p><a href="http://eval.in/13344">http://eval.in/13344</a><br>
=end</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378232013-03-22T22:03:50ZMotohiro KOSAKIkosaki.motohiro@gmail.com
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>Narihiro Nakamura</i></li></ul> Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378462013-03-23T17:46:10ZNobuyoshi Nakadanobu@ruby-lang.org
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>This issue was solved with changeset <a class="changeset" title="* KNOWNBUGS.rb: test for [Bug #8100]." href="https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39883">r39883</a>.<br>
Magnus, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>KNOWNBUGS.rb: test for [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Segfault in trunk (Closed)" href="https://bugs.ruby-lang.org/issues/8100">#8100</a>].</li>
</ul>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378472013-03-23T19:02:50ZNobuyoshi Nakadanobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>% Done</strong> changed from <i>100</i> to <i>0</i></li></ul> Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378482013-03-23T19:16:58ZCharlie Somervillecharliesome@ruby-lang.org
<ul></ul><p>nobu-san, this will loop forever when the bug is fixed. Perhaps change it to 100_000.times?</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378512013-03-23T20:57:27ZTom Wardroptom@tomwardrop.com
<ul></ul><p>I&#39;d set it to a duration rather than a set number of iterations. I&#39;ve see it go for 2 seconds on my machine before segfault&#39;ing. 3 seconds should fail almost every time.</p>
<pre>start_time = Time.now
while (Time.now - start_time) &lt; 3
def x
&quot;hello&quot; * 1000
end
method(:x).call
end
</pre> Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378542013-03-23T21:57:42ZNobuyoshi Nakadanobu@ruby-lang.org
<ul></ul><p>charliesome (Charlie Somerville) wrote:</p>
<blockquote>
<p>nobu-san, this will loop forever when the bug is fixed. Perhaps change it to 100_000.times?</p>
</blockquote>
<p>Sure, I&#39;ve forgot it before the commit.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378642013-03-24T04:50:51ZYui NARUSEnaruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</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 <a class="changeset" title="Add timeout to infinite loop [Bug #8100] On FreeBSD, it doesn&#39;t SEGV. http://fbsd.rubyci.org/~ch..." href="https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39894">r39894</a>.<br>
Magnus, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>Add timeout to infinite loop [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Segfault in trunk (Closed)" href="https://bugs.ruby-lang.org/issues/8100">#8100</a>]</p>
<p>On FreeBSD, it doesn&#39;t SEGV.<br>
<a href="http://fbsd.rubyci.org/%7Echkbuild/ruby-trunk/log/20130323T170203Z.log.html.gz">http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20130323T170203Z.log.html.gz</a></p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378652013-03-24T04:51:26ZYui NARUSEnaruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li></ul> Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=378982013-03-25T02:15:57ZNarihiro NakamuraauthorNari@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 <a class="changeset" title="* proc.c (bm_free): need to clean up the mark flag of a free and unlinked method entry. [Bug #8..." href="https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39919">r39919</a>.<br>
Magnus, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>proc.c (bm_free): need to clean up the mark flag of a free and
unlinked method entry. [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Segfault in trunk (Closed)" href="https://bugs.ruby-lang.org/issues/8100">#8100</a>] </li>
</ul>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=379052013-03-25T05:24:51ZZachary Scottzzak@ruby-lang.org
<ul></ul><p>Thank you nari-san and everyone who helped with this.</p>
<p>Should this be backported as well?</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=379102013-03-25T11:54:28ZNarihiro NakamuraauthorNari@gmail.com
<ul></ul><p>zzak (Zachary Scott) wrote:</p>
<blockquote>
<p>Thank you nari-san and everyone who helped with this.</p>
<p>Should this be backported as well?</p>
</blockquote>
<p>Yeah, this fix should be backport to 1.9.3 and 2.0.0.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=379152013-03-25T18:45:16ZTom Wardroptom@tomwardrop.com
<ul></ul><p>Eagerly awaiting the backport. Can someone please leave a comment when it&#39;s back-ported to ruby-2.0.0 head?</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=379182013-03-25T20:08:15ZNarihiro NakamuraauthorNari@gmail.com
<ul></ul><p>wardrop (Tom Wardrop) wrote:</p>
<blockquote>
<p>Eagerly awaiting the backport. Can someone please leave a comment when it&#39;s back-ported to ruby-2.0.0 head?</p>
</blockquote>
<p>The backport request ticket is here.<br>
<a href="https://bugs.ruby-lang.org/issues/8163">https://bugs.ruby-lang.org/issues/8163</a><br>
You might want to watch this ticket for your purpose.</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=379202013-03-25T22:20:25ZTom Wardroptom@tomwardrop.com
<ul></ul><p>Thanks for that. By the way, I&#39;ve applied the patch to my production server. Write me down as another happy customer :-)</p>
Ruby trunk - Bug #8100: Segfault in trunkhttps://bugs.ruby-lang.org/issues/8100?journal_id=393052013-05-13T19:26:09ZWojciech Wnętrzakw.wnetrzak@gmail.com
<ul></ul><p>Might be related to <a href="https://bugs.ruby-lang.org/issues/8056">https://bugs.ruby-lang.org/issues/8056</a></p>