Bug #3880

Ruby 1.9.1 - crash in timeout.rb

Added by Elvita Lobo over 3 years ago. Updated about 1 year ago.

[ruby-core:32589]
Status:Feedback
Priority:Normal
Assignee:Usaku NAKAMURA
Category:core
Target version:next minor
ruby -v:ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] Backport:

Description

=begin
I am using the serialport 1.0.4 Ruby gem. In my serial port connection code, I have the following piece of code [1] that causes Ruby to crash from time to time.

[1] In serialequipmentconnection.rb
23 status = Timeout::timeout(timeout) {
24 while (!listener.match)
25 sleep 0.5
26 end
27 }

ruby –v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

I am running on a Windows XP SP 3 machine.

I have attached the two related files - serialequipmentconnection.rb, equipment_connection.rb, and the crash log.

[2] Crash log (file attached)

MXP>(eval):2: [BUG] The handle is invalid.

ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

-- control frame ----------
c:0044 p:0054 s:0226 b:0226 l:000225 d:000225 METHOD c:/Ruby191/lib/ruby/1.9.1/monitor.rb:178
c:0043 p:---- s:0232 b:0232 l:000231 d:000231 CFUNC :toi
c:0042 p:---- s:0235 b:0235 l:000234 d:000234 CFUNC :instance
variableset
c:0041 p:0098 s:0230 b:0230 l:000229 d:000229 METHOD c:/Ruby191/lib/ruby/gems/1.9.1/gems/activesuppo
rt-2.3.8/lib/active
support/coreext/class/inheritableattributes.rb:135
c:0040 p:---- s:0226 b:0226 l:000225 d:000225 CFUNC :index
c:0039 p:---- s:0223 b:0223 l:000222 d:000222 CFUNC :sleep
c:0038 p:0019 s:0219 b:0219 l:001a24 d:000218 BLOCK C:/VATFsource/target/serialequipmentconnecti
on.rb:25
c:0037 p:0109 s:0217 b:0217 l:002698 d:002698 METHOD c:/Ruby191/lib/ruby/1.9.1/timeout.rb:52
c:0036 p:0153 s:0205 b:0205 l:001a24 d:001a24 METHOD C:/VATF
source/target/serialequipmentconnecti
on.rb:23
c:0035 p:0014 s:0194 b:0194 l:000193 d:000193 METHOD C:/VATFsource/target/equipmentconnection.rb:5
4
=end

crashLog.txt Magnifier - crash console output (4.2 KB) Elvita Lobo, 09/28/2010 04:38 AM

serial_equipment_connection.rb Magnifier (1.24 KB) Elvita Lobo, 09/28/2010 04:38 AM

equipment_connection.rb Magnifier (1.79 KB) Elvita Lobo, 09/28/2010 04:38 AM

History

#1 Updated by Yui NARUSE over 3 years ago

  • Status changed from Open to Feedback
  • Priority changed from High to Normal

=begin
Is this reproducible on Ruby 1.9.2?
=end

#2 Updated by Elvita Lobo over 3 years ago

=begin
I see a crash in 1.9.2p0 also, although from the stack trace it looks like the crash does not occur at the same place in the code

Running Test 232901 test iteration 1 session iteration 1
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145: [BUG
] Segmentation fault
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

-- control frame ----------
c:0025 p:---- s:0117 b:0117 l:000116 d:000116 CFUNC :load
c:0024 p:0015 s:0113 b:0113 l:000102 d:000112 BLOCK C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesuppo
rt-2.3.8/lib/activesupport/dependencies.rb:145
c:0023 p:0055 s:0111 b:0111 l:000110 d:000110 METHOD C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesuppo
rt-2.3.8/lib/active
support/dependencies.rb:521
c:0022 p:0041 s:0103 b:0103 l:000102 d:000102 METHOD C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesuppo
rt-2.3.8/lib/activesupport/dependencies.rb:145
c:0021 p:0734 s:0097 b:0097 l:00051c d:00051c METHOD C:/VATF
source/atfsessionrunner.rb:426
c:0020 p:0135 s:0078 b:0078 l:000068 d:000077 BLOCK C:/VATFsource/atfsessionrunner.rb:311
c:0019 p:---- s:0075 b:0075 l:000074 d:000074 FINISH
c:0018 p:---- s:0073 b:0073 l:000072 d:000072 CFUNC :upto
c:0017 p:0258 s:0069 b:0069 l:000068 d:000068 METHOD C:/VATF
source/atfsessionrunner.rb:306
c:0016 p:0024 s:0062 b:0062 l:000023 d:000061 BLOCK atfrun.rb:50
c:0015 p:---- s:0059 b:0059 l:000058 d:000058 FINISH
c:0014 p:---- s:0057 b:0057 l:000056 d:000056 CFUNC :each
c:0013 p:0032 s:0054 b:0054 l:000023 d:000053 BLOCK atf
run.rb:49
c:0012 p:---- s:0051 b:0051 l:000050 d:000050 FINISH
c:0011 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC :each
c:0010 p:0017 s:0046 b:0046 l:000023 d:000045 BLOCK atfrun.rb:47
c:0009 p:---- s:0043 b:0043 l:000042 d:000042 FINISH
c:0008 p:---- s:0041 b:0041 l:000040 d:000040 CFUNC :upto
c:0007 p:0229 s:0037 b:0037 l:000023 d:000036 BLOCK atf
run.rb:46
c:0006 p:---- s:0029 b:0029 l:000028 d:000028 FINISH
c:0005 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC :each
c:0004 p:0475 s:0024 b:0024 l:000023 d:000023 METHOD atfrun.rb:41
c:0003 p:0084 s:0006 b:0006 l:00215c d:001ec4 EVAL atf
run.rb:107
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00215c d:00215c TOP


-- Ruby level backtrace information ----------------------------------------
atfrun.rb:107:in <main>'
atf_run.rb:41:in
run
session'
atfrun.rb:41:in each'
atf_run.rb:46:in
block in run
session'
atfrun.rb:46:in upto'
atf_run.rb:47:in
block (2 levels) in run
session'
atfrun.rb:47:in each'
atf_run.rb:49:in
block (3 levels) in run
session'
atfrun.rb:49:in each'
atf_run.rb:50:in
block (4 levels) in run
session'
C:/VATFsource/atfsessionrunner.rb:306:in init_test_iterations'
C:/VATF_source/atf_session_runner.rb:306:in
upto'
C:/VATF
source/atfsessionrunner.rb:311:in block in init_test_iterations'
C:/VATF_source/atf_session_runner.rb:426:in
starttest'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active
support/dependencies.rb:145:in l
oad_with_new_constant_marking'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in
n
ewconstantsin'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in b
lock in load_with_new_constant_marking'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in
l
oad'

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

=end

#3 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Hiroshi Nakamura

#4 Updated by Hiroshi Nakamura almost 3 years ago

  • Target version changed from 1.9.1 to 1.9.3

#5 Updated by Hiroshi Nakamura almost 3 years ago

  • Status changed from Assigned to Feedback

Hi Elvita, sorry for late response. We're planning 1.9.3 release soon and we want to know if it still causes SEGV or not.

I installed RubyInstaller (ruby 1.9.2p180 (2011-02-18) [i386-mingw32]) and DevKit on Windows 7 64bit, then installed serialport 1.0.4 by a gem. For this env, basic serialport communication looks working.

Can you show us a way to replicate the bug on our side?

#6 Updated by Hiroshi Nakamura almost 3 years ago

  • Assignee changed from Hiroshi Nakamura to Usaku NAKAMURA

Usa, can you take at look at this? If 'Feedback' is enough, reassign to me.

#7 Updated by Usaku NAKAMURA almost 3 years ago

This is a 3rd party issue, I guess.

#8 Updated by Yui NARUSE about 1 year ago

  • Target version changed from 1.9.3 to next minor

Also available in: Atom PDF