https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-06-21T13:31:40ZRuby Issue Tracking SystemBackport193 - Backport #6618: Seg Fault when printing thread.keyshttps://bugs.ruby-lang.org/issues/6618?journal_id=273232012-06-21T13:31:40Zcantregister (Why Cantiregister)adehdesandies@gmail.com
<ul></ul><p>threadtest.rb</p>
<p>puts ">>>>>>>>>>>>>>>> starting"</p>
<p>require 'bigdecimal'</p>
<p>for thr in Thread.list<br>
puts thr.keys<br>
end</p>
<p>mac:code user$ ruby threadtest.rb</p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>starting<br>
threadtest.rb:6: [BUG] Segmentation fault<br>
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>-- Control frame information -----------------------------------------------<br>
c:0009 p:---- s:0023 b:0023 l:000022 d:000022 CFUNC :to_s<br>
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 CFUNC :puts<br>
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :puts<br>
c:0006 p:0024 s:0015 b:0015 l:001948 d:000014 BLOCK threadtest.rb:6<br>
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH<br>
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :each<br>
c:0003 p:0045 s:0007 b:0007 l:001948 d:000a00 EVAL threadtest.rb:5<br>
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH<br>
c:0001 p:0000 s:0002 b:0002 l:001948 d:001948 TOP</p>
<p>-- Ruby level backtrace information ----------------------------------------<br>
threadtest.rb:5:in <code><main>' threadtest.rb:5:in </code>each'<br>
threadtest.rb:6:in <code>block in <main>' threadtest.rb:6:in </code>puts'<br>
threadtest.rb:6:in <code>puts' threadtest.rb:6:in </code>to_s'</p>
<p>-- C level backtrace information -------------------------------------------</p>
<p>See Crash Report log file under ~/Library/Logs/CrashReporter or<br>
/Library/Logs/CrashReporter, for the more detail of.</p>
<p>-- Other runtime information -----------------------------------------------</p>
<ul>
<li>
<p>Loaded script: threadtest.rb</p>
</li>
<li>
<p>Loaded features:</p>
<p>0 enumerator.so<br>
1 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/enc/encdb.bundle<br>
2 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/enc/trans/transdb.bundle<br>
3 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb<br>
4 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/rbconfig.rb<br>
5 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb<br>
6 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb<br>
7 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb<br>
8 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb<br>
9 /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/bigdecimal.bundle</p>
</li>
</ul>
<p>[NOTE]<br>
You may have encountered a bug in the Ruby interpreter or extension libraries.<br>
Bug reports are welcome.<br>
For details: <a href="http://www.ruby-lang.org/bugreport.html" class="external">http://www.ruby-lang.org/bugreport.html</a></p>
<p>Abort trap: 6</p> Backport193 - Backport #6618: Seg Fault when printing thread.keyshttps://bugs.ruby-lang.org/issues/6618?journal_id=273242012-06-21T13:32:40Zcantregister (Why Cantiregister)adehdesandies@gmail.com
<ul></ul><p>sorry about the strange username, i tried to register 3 times before this one worked.</p> Backport193 - Backport #6618: Seg Fault when printing thread.keyshttps://bugs.ruby-lang.org/issues/6618?journal_id=273252012-06-21T13:45:55Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby master</i> to <i>Backport193</i></li><li><strong>Target version</strong> deleted (<del><i>1.9.3</i></del>)</li></ul> Backport193 - Backport #6618: Seg Fault when printing thread.keyshttps://bugs.ruby-lang.org/issues/6618?journal_id=273262012-06-21T13:46:32Znaruse (Yui NARUSE)naruse@airemix.jp
<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 r36159.<br>
Why, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>merge revision(s) 35625: [Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Seg Fault when printing thread.keys (Closed)" href="https://bugs.ruby-lang.org/issues/6618">#6618</a>]</p>
<pre><code>* thread.c (rb_threadptr_execute_interrupts_common):
test_signal_requiring of test/ruby/test_signal.rb fail if the sub
process is killed on waiting IO in lex_io_gets in rb_load_file in
rb_load_internal in require.
This is because
(1) the process receive the killing signal in
rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
(2) set th->errinfo as INT2FIX(TAG_FATAL) at
rb_threadptr_execute_interrupts_common.
(3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
without set loaded as TRUE.
(4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
is FALSE as above. this errinfo should be an exception object
but this is INT2FIX(TAG_FATAL).
Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.
</code></pre>