From: "西行寺 うゆ" Date: 2012-02-02T01:36:33+09:00 Subject: [ruby-dev:45171] [ruby-trunk - Bug #5897] RubyからWinAPIのCreateProcessを使ったときに引数を間違えるとバグがでる Issue #5897 has been updated by 西行寺 うゆ. C:/DOCUME~1/teruyo/LOCALS~1/Temp/rbBE.tmp:4: warning: already initialized constant FALSE C:/Ruby2/lib/ruby/1.9.1/Win32API.rb:25: [BUG] Segmentation fault ruby 1.9.3p0 (2011-10-30) [i386-mingw32] -- Control frame information ----------------------------------------------- c:0005 p:---- s:0017 b:0017 l:000016 d:000016 CFUNC :call c:0004 p:0041 s:0013 b:0013 l:000012 d:000012 METHOD C:/Ruby2/lib/ruby/1.9.1/Win32API.rb:25 c:0003 p:0133 s:0007 b:0007 l:00264c d:000520 EVAL C:/DOCUME~1/teruyo/LOCALS~1/Temp/rbBE.tmp:6 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:00264c d:00264c TOP -- Ruby level backtrace information ---------------------------------------- C:/DOCUME~1/teruyo/LOCALS~1/Temp/rbBE.tmp:6:in `
' C:/Ruby2/lib/ruby/1.9.1/Win32API.rb:25:in `call' C:/Ruby2/lib/ruby/1.9.1/Win32API.rb:25:in `call' -- C level backtrace information ------------------------------------------- C:\WINDOWS\system32\ntdll.dll(KiFastSystemCallRet+0x0) [0x7c94e514] C:\WINDOWS\system32\kernel32.dll(WaitForSingleObject+0x12) [0x7c802542] C:\Ruby2\bin\msvcrt-ruby191.dll(rb_vm_bugreport+0xf9) [0x62e5acc9] C:\Ruby2\bin\msvcrt-ruby191.dll(rb_name_err_mesg_new+0x17a) [0x62d3a68e] C:\Ruby2\bin\msvcrt-ruby191.dll(rb_bug+0x2f) [0x62d3b3ef] C:\Ruby2\bin\msvcrt-ruby191.dll(rb_check_safe_str+0x1a4) [0x62ded27c] [0x004011e6] C:\WINDOWS\system32\kernel32.dll(UnhandledExceptionFilter+0x1c7) [0x7c864191] -- Other runtime information ----------------------------------------------- * Loaded script: C:/DOCUME~1/teruyo/LOCALS~1/Temp/rbBE.tmp * Loaded features: 0 enumerator.so 1 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/enc/encdb.so 2 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/enc/shift_jis.so 3 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/enc/trans/transdb.so 4 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb 5 C:/Ruby2/lib/ruby/1.9.1/tsort.rb 6 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/dependency_list.rb 7 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/rbconfig.rb 8 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb 9 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb 10 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/defaults/operating_system.rb 11 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 12 C:/Ruby2/lib/ruby/site_ruby/1.9.1/rubygems.rb 13 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/dl.so 14 C:/Ruby2/lib/ruby/1.9.1/i386-mingw32/fiddle.so 15 C:/Ruby2/lib/ruby/1.9.1/fiddle/function.rb 16 C:/Ruby2/lib/ruby/1.9.1/fiddle/closure.rb 17 C:/Ruby2/lib/ruby/1.9.1/fiddle.rb 18 C:/Ruby2/lib/ruby/1.9.1/dl.rb 19 C:/Ruby2/lib/ruby/1.9.1/Win32API.rb [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. ---------------------------------------- Bug #5897: RubyからWinAPIのCreateProcessを使ったときに引数を間違えるとバグがでる https://bugs.ruby-lang.org/issues/5897 Author: 西行寺 うゆ Status: Feedback Priority: Normal Assignee: Usaku NAKAMURA Category: ext Target version: ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32] require 'Win32API' CreateProcess = Win32API.new('kernel32', 'CreateProcess', %w(ipiiiiiipp), 'i') NULL = 0 FALSE = 0 lpCommandLine = "" CreateProcess.call( NULL, lpCommandLine, NULL, NULL, FALSE, FALSE, NULL, NULL, "", 0 ) 引数は間違えないのが理想ですが 間違ったときには[BUG]じゃなくてエラーメッセージがいいんじゃないかなと -- http://bugs.ruby-lang.org/