https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112014-01-08T23:29:24ZRuby Issue Tracking SystemRuby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=441742014-01-08T23:29:24Zcbliard (Christophe Bliard)christophe.bliard@trux.info
<ul><li><strong>File</strong> <a href="/attachments/4165">bundle_exec_rake_assets_precompile.1.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4165/bundle_exec_rake_assets_precompile.1.log">bundle_exec_rake_assets_precompile.1.log</a> added</li><li><strong>File</strong> <a href="/attachments/4166">bundle_exec_rake_assets_precompile.2.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4166/bundle_exec_rake_assets_precompile.2.log">bundle_exec_rake_assets_precompile.2.log</a> added</li><li><strong>File</strong> <a href="/attachments/4167">ruby_rake_assets_precompile_all.1.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4167/ruby_rake_assets_precompile_all.1.log">ruby_rake_assets_precompile_all.1.log</a> added</li><li><strong>File</strong> <a href="/attachments/4168">ruby_rake_assets_precompile_all.2.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4168/ruby_rake_assets_precompile_all.2.log">ruby_rake_assets_precompile_all.2.log</a> added</li></ul><p>I tried with ruby-2.1.0-head installed with RVM. It downloaded ruby from ruby_2_1 branch, SHA 41deb12e9d6646b42ef0e011509870f6ddf383c5.</p>
<p>ruby -v: ruby 2.1.1p2 (2013-12-31 revision 44467) [x86_64-linux]</p>
<p>It still segfaults with this latest ruby. I narrowed the command to <code>bundle exec rake assets:precompile</code>. It always segfaults, but at different times.</p>
<p>When I run the underlying command <code>/home/cbliard/.rvm/rubies/ruby-2.1.0-head/bin/ruby /home/cbliard/.rvm/rubies/ruby-2.1.0-head/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets</code>, it segfaults too in the same manner, but sometimes it passes.</p>
<p>I attached 2 logs of segfaulting bundle, and 2 logs of segfaulting rake. All made with ruby 2.1.1p2 (2013-12-31 revision 44467)</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=441752014-01-09T00:13:49Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Could you try with the trunk?</p>
<p>It seems something dead object is used in a finalizer.</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=441762014-01-09T02:01:44Zcbliard (Christophe Bliard)christophe.bliard@trux.info
<ul><li><strong>File</strong> <a href="/attachments/4169">bundle_exec_rake_assets_precompile.ruby_trunk.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4169/bundle_exec_rake_assets_precompile.ruby_trunk.log">bundle_exec_rake_assets_precompile.ruby_trunk.log</a> added</li></ul><p>With 2.0.0, it works (ruby -v is "ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]").</p>
<p>With trunk, it still segfaults (ruby -v is "ruby 2.2.0dev (2014-01-08 trunk 44527) [x86_64-linux]"). I attached the log bundle_exec_rake_assets_precompile.ruby_trunk.log</p>
<p>You are right, it segfaults during cleanup, after all assets have been generated.</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442382014-01-13T02:07:25Ztmm1 (Aman Karmani)ruby@tmm1.net
<ul></ul><p>Maybe it's related to the ref gem and weak_reference implementation? Can you try without it?</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442392014-01-13T02:11:32Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Sure, but <code>ref</code> is pure ruby.</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442602014-01-13T10:38:07Zcbliard (Christophe Bliard)christophe.bliard@trux.info
<ul><li><strong>File</strong> <a href="/attachments/4187">Gemfile.lock.works</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4187/Gemfile.lock.works">Gemfile.lock.works</a> added</li><li><strong>File</strong> <a href="/attachments/4188">Gemfile.lock.segfaults</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4188/Gemfile.lock.segfaults">Gemfile.lock.segfaults</a> added</li></ul><p>Aman Gupta wrote:</p>
<blockquote>
<p>Maybe it's related to the ref gem and weak_reference implementation? Can you try without it?</p>
</blockquote>
<p>No I can't because ref is required by therubyracer gem, which is needed for rails assets precompilation. So I tried updating ref gem.</p>
<p>After running <code>bundle update therubyracer</code>, the updated gems are:</p>
<ul>
<li>therubyracer from 0.11.3 to 0.12.0</li>
<li>libv8 from 3.11.8.17 to 3.16.14.3</li>
<li>ref from 1.0.2 to 1.0.5</li>
</ul>
<p>It seems to fix it: I tried multiple times and it has always worked. I tried with these rubies:</p>
<ul>
<li>ruby 2.1.0 (ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux])</li>
<li>ruby 2.1.1 (ruby 2.1.1p2 (2013-12-31 revision 44467) [x86_64-linux])</li>
<li>ruby 2.2.0 (ruby 2.2.0dev (2014-01-08 trunk 44527) [x86_64-linux])</li>
</ul>
<p>I do not know if the culprit is ref, libv8 or therubyracer. I joined the Gemfile.lock files: one when it segfaults and one when it works.</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442622014-01-13T11:19:05Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li></ul> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442832014-01-14T09:34:04Zcbliard (Christophe Bliard)christophe.bliard@trux.info
<ul></ul><p>So the issue is closed? Is it really a third party issue that causes the segfault?</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442852014-01-14T09:57:31Ztmm1 (Aman Karmani)ruby@tmm1.net
<ul></ul><p>The changelog for therubyracer says:</p>
<p>0.12.0 2013/08/20</p>
<ul>
<li>enable native (and functional) weakref implementation for MRI > 2.0</li>
</ul>
<p>It seems likely this fixed your issue.</p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=442862014-01-14T10:07:17Ztmm1 (Aman Karmani)ruby@tmm1.net
<ul><li><strong>ruby -v</strong> changed from <i>ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]</i> to <i>-</i></li></ul><p>Issue <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Segfault in ruby 2.1.0p0 (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/9384">#9384</a> has been updated by Aman Gupta.</p>
<p>The changelog for therubyracer says:</p>
<p>0.12.0 2013/08/20</p>
<ul>
<li>enable native (and functional) weakref implementation for MRI > 2.0</li>
</ul>
<p>It seems likely this fixed your issue.</p>
<hr>
<p>Bug <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Segfault in ruby 2.1.0p0 (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/9384">#9384</a>: Segfault in ruby 2.1.0p0<br>
<a href="https://bugs.ruby-lang.org/issues/9384#change-44285" class="external">https://bugs.ruby-lang.org/issues/9384#change-44285</a></p>
<ul>
<li>Author: Christophe Bliard</li>
<li>Status: Third Party's Issue</li>
<li>Priority: Normal</li>
<li>Assignee:</li>
<li>Category:</li>
<li>Target version:</li>
<li>ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]</li>
<li>Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN</li>
</ul>
<hr>
<p>I got a stacktrace while capistrano was deploying our rails app to our server. We switched to ruby 2.1.0 recently. It worked on my dev station, not in staging.</p>
<p>I attached the ruby stderr as output by capistrano and every line was prepended with '*** [err :: hostname.com] '. I removed them for clarity. It looks like some output has been modified by capistrano too.</p>
<p>If you need further data, please tell me.</p>
<p>---Files--------------------------------<br>
ruby_stderr.log (248 KB)<br>
bundle_exec_rake_assets_precompile.1.log (247 KB)<br>
bundle_exec_rake_assets_precompile.2.log (235 KB)<br>
ruby_rake_assets_precompile_all.1.log (235 KB)<br>
ruby_rake_assets_precompile_all.2.log (234 KB)<br>
bundle_exec_rake_assets_precompile.ruby_trunk.log (224 KB)<br>
Gemfile.lock.works (8.36 KB)<br>
Gemfile.lock.segfaults (8.36 KB)</p>
<p>--<br>
<a href="http://bugs.ruby-lang.org/" class="external">http://bugs.ruby-lang.org/</a></p> Ruby master - Bug #9384: Segfault in ruby 2.1.0p0https://bugs.ruby-lang.org/issues/9384?journal_id=446342014-01-27T16:09:34Zcbliard (Christophe Bliard)christophe.bliard@trux.info
<ul></ul><p>Ok, thank you for your help</p>