[Win32utils-devel] [ win32utils-Bugs-14298 ] windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file

noreply at rubyforge.org noreply at rubyforge.org
Fri Sep 28 07:30:59 EDT 2007


Bugs item #14298, was opened at 2007-09-28 10:23
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Lars Olsson (lasso)
Assigned to: Nobody (None)
Summary: windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file 

Initial Comment:
The latest version of windows-api/windows-pr segfault my ruby when I require 'win32/file'. The previous version worked without problems.

Sample code (segfaults, uncomment lines to use older working gems instead):
require 'rubygems'
# gem 'windows-api', '=0.1.1'
# gem 'windows-pr', '=0.7.0'
require 'win32/file'

System information
================== 
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600

C:\temp\rs2exe>ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]

C:\temp\rs2exe>gem list windows-api
...
windows-api (0.2.0, 0.1.1)
    An easier way to create methods using Win32API

C:\temp\rs2exe>gem list windows-pr
...
windows-pr (0.7.1, 0.7.0)
    Windows functions and constants bundled via Win32::API

C:\temp\rs2exe>gem list win32-file
...
win32-file (0.5.4)
    Extra or redefined methods for the File class on Windows.

win32-file-stat (1.2.5)
    A File::Stat class tailored to MS Windows

----------------------------------------------------------------------

>Comment By: Lars Olsson (lasso)
Date: 2007-09-28 13:30

Message:
running ruby with -d gives:

Exception `LoadError' at 
C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_requ
ire.rb:27 - no such file to load -- win32/file
Exception `Win32::API::Error' at 
C:/Program/Ruby/lib/ruby/gems/1.8/gems/windows-
api-0.2.0/lib/windows/api.rb:211 - GetProcAddress() failed 
for '_mktemp_s', '_mktemp_sA' and '_mktemp_sW': Det gÕr 
inte att hitta den angivna proceduren.
C:/Program/Ruby/lib/ruby/gems/1.8/gems/windows-api-
0.2.0/lib/windows/api.rb:211:
 [BUG] Segmentation fault

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2007-09-28 13:17

Message:
More info. If I require 'win32/file/stat' first, then 'win32/file', it works ok. Not sure why yet:

C:\Documents and Settings\djberge\workspace\windows-pr>irb
irb(main):001:0> require 'win32/file/stat'
=> true
irb(main):002:0> require 'win32/file'
=> true
irb(main):003:0> quit

C:\Documents and Settings\djberge\workspace\windows-pr>irb
irb(main):001:0> require 'win32/file'
C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault
ruby 1.8.5 (2006-08-25) [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.

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2007-09-28 13:09

Message:
Hi,

Ugh, you're right. I see this:

irb(main):001:0> require 'win32/file'
C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault
ruby 1.8.5 (2006-08-25) [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.

Looks like something in File::Stat. Let me dig deeper.

Regards,

Dan

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85


More information about the win32utils-devel mailing list