Bug #6426

Segmentation fault when invoking

Added by Zhimin Zhan almost 2 years ago. Updated almost 2 years ago.

[ruby-core:45007]
Status:Rejected
Priority:Normal
Assignee:Masaki Suketa
Category:-
Target version:1.9.3
ruby -v:1.9.3p194 Backport:

Description

Hi,

The Seg fault happens when invoking the test below (Ruby 1.9.3p194 on Windows XP SP3). Ran Ok when commented out $semaphore.lock line.

$semaphore = Mutex.new

# ..
def testrunspecfileweb
$LOADWISEPREVIEW = true
tmp
specfile = SpecFile.new
tmp
specfile.filepath = testprojectfile("signintest.rb")
thread = RSpec2Executor.runspec(tmpspec_file)
thread.join
end

in RSpec2Executor class

## Invoke a RSpec to run Watir (OLE) test
#
def self.runspec(spec)
thread = Thread.new do
$semaphore.lock # if commented out this line, it is fine
test
file = spec.filepath
RSpec::Core::Runner.run([test
file])
end
end

Error Trace:

rspec2executortest.rb: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0002 b:0002 l:0016fc d:0016fc TOP

-- C level backtrace information -------------------------------------------
C:\WINDOWS\system32\ntdll.dll(KiFastSystemCallRet+0x0) [0x7c90e514]
C:\WINDOWS\system32\kernel32.dll(WaitForSingleObject+0x12) [0x7c802542]
c:\work\app\vendor\ruby-1.9.3-p194-i386-mingw32\bin\msvcrt-ruby191.dll(rbvmbugreport+0xf9) [0x62e5c589]
c:\work\app\vendor\ruby-1.9.3-p194-i386-mingw32\bin\msvcrt-ruby191.dll(rbnameerrmesgnew+0x17a) [0x62d3a7e2]
c:\work\app\vendor\ruby-1.9.3-p194-i386-mingw32\bin\msvcrt-ruby191.dll(rbbug+0x2f) [0x62d3b4fb]
c:\work\app\vendor\ruby-1.9.3-p194-i386-mingw32\bin\msvcrt-ruby191.dll(rb
checksafestr+0x1a4)
[0x62dee168]
[0x004011e6]
[0x10006985]

-- Other runtime information -----------------------------------------------

  • Loaded script: rspec2executortest.rb

  • Loaded features:

    0 enumerator.so
    1 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/encdb.so
    2 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/iso88591.so
    3 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/trans/transdb.so
    4 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/siteruby/1.9.1/rubygems/defaults.rb
    5 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/rbconfig.rb6 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/site
    ruby/1.9.1/rubygems/deprecate.rb
    7 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/siteruby/1.9.1/rubygems/exceptions.rb
    8 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/site
    ruby/1.9.1/rubygems/defaults/operatingsystem.rb
    9 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/site
    ruby/1.9.1/rubygems/customrequire.rb
    10 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/site
    ruby/1.9.1/rubygems.rb
    11 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/siteruby/1.9.1/ubygems.rb
    12 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/optparse.rb
    13 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/minitest/unit.rb
    14 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/prettyprint.rb
    15 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/pp.rb
    16 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/test/unit/assertions.rb
    17 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/test/unit/testcase.rb
    18 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/test/unit.rb
    19 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/pathname.so
    20 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/pathname.rb
    21 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/site
    ruby/1.9.1/rubygems/version.rb
    22 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/etc.so
    23 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/utf16le.so
    24 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/trans/utf
    1632.so
    25 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/1.9.1/i386-mingw32/enc/trans/single
    byte.so
    26 c:/work/app/vendor/ruby-1.9.3-p194-i386-mingw32/lib/ruby/siteruby/1.9.1/rubygems/configfile.rb

History

#1 Updated by Zhimin Zhan almost 2 years ago

Sorry, forgot to complete the title.

Seg Fault when invoking thread executing OLE test with Mutex on (mingw32)

#2 Updated by Yusuke Endoh almost 2 years ago

  • Status changed from Open to Rejected
  • Assignee set to Masaki Suketa

I think this is the same issue as #2655.
https://bugs.ruby-lang.org/issues/2655

In conclusion of that ticket, it is difficult to fix this issue.
Please avoid using win32ole with threads.

If you have any idea to fix this issue, please reopen.

Yusuke Endoh mame@tsg.ne.jp

Also available in: Atom PDF