From: Dan Daniels Date: 2009-06-13T12:55:14+09:00 Subject: Re: win32-service Segmentation fault Daniel Berger wrote: >> Platform: Windows Server 2003, Standard Edition Build 3790 Service Pack >> >> Application Layer Gateway Service >> >> ice.rb:1100: [BUG] Segmentation fault >> ruby 1.8.6 (2007-09-24) [i386-mswin32] >> >> >> This application has requested the Runtime to terminate it in an >> unusual >> way. >> Please contact the application's support team for more information. > > That's odd. Line 1100 is actually pure Ruby code: > > binary_path = binary_path.unpack('Z*')[0] > > I wonder if you've found a bug. > > A few questions. > > What version of Ruby are you running? > One click or hand built? > What version of win32-service? > Does it always segfault at the same place? > > If it does segfault at the same place, can you open up your services > explorer window and see what the next one on the list is? > > Control Panel -> Administrative Tools -> Services > > Or, if you could step through the debugger, I'd love to see what the > 'binary_path' variable is set to when it dies. > > Regards, > > Dan I inserted "puts binary_path" on line 1101 in services.rb. W:\>ruby check_services_test.rb C:\WINDOWS\system32\svchost.exe -k netsvcs Application Experience Lookup Service C:\WINDOWS\system32\svchost.exe -k LocalService Alerter C:\WINDOWS\System32\alg.exe Application Layer Gateway Service C:\WINDOWS\system32\svchost.exe -k netsvcs Application Management C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe ASP.NET State Service system32\DRIVERS\asyncmac.sys RAS Asynchronous Media Driver system32\DRIVERS\audstub.sys Audio Stub Driver "C:\Program Files\Research In Motion\BlackBerry Enterprise Server\AttachServer\B BAttachServer.exe" 1900 1999 3 32 BlackBerry Attachment Service C:\WINDOWS\system32\svchost.exe -k netsvcs Background Intelligent Transfer Service "C:\Program Files\Research In Motion\BlackBerry Enterprise Server\BlackBerryCont roller.exe" BlackBerry Controller "C:\Program Files\Research In Motion\BlackBerry Enterprise Server\MDS\bin\DBCons istency.exe" BlackBerry Database Consistency Service "C:\Program Files\Research In Motion\BlackBerry Enterprise Server\BlackBerryDisp atcher.exe" BlackBerry Dispatcher "C:\Program Files\Research In Motion\BlackBerry Enterprise Server\MDS\bin\bmds.e xe" -s jvmpath="C:\Program Files\Java\jre1.6.0_02\bin\client\jvm.dll" -XX:+Disab leExplicitGC -Xss64K -Xmx768M -Xms128M classpathdir="C:\Program Files\Research I n Motion\BlackBerry c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.1-x86-mswin32-60/lib/win32/serv ice.rb:1154:in `>': comparison of String with 0 failed (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.1-x86-mswin32-60/l ib/win32/service.rb:1154:in `services' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.1-x86-mswin32-60/l ib/win32/service.rb:1057:in `upto' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.1-x86-mswin32-60/l ib/win32/service.rb:1057:in `services' from check_services_test.rb:12 If I change line 1101 to "puts binary_path.inspect", the script completes without error. -- Posted via http://www.ruby-forum.com/.