[Win32utils-devel] [ win32utils-Bugs-10589 ] Bug in win32-mmap

noreply at rubyforge.org noreply at rubyforge.org
Mon May 7 23:47:36 EDT 2007


Bugs item #10589, was opened at 2007-05-04 12:01
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=10589&group_id=85

Category: win32-mmap
Group: Code
Status: Open
Resolution: None
Priority: 3
Submitted By: Daniel Berger (djberg96)
Assigned to: Daniel Berger (djberg96)
Summary: Bug in win32-mmap

Initial Comment:
Ruby 1.8.6
win32-mmap 0.2.1

Assigning the value 0 to a dynamic setter causes the corresponding getter to fail. This small script demonstrates the problem:

require 'win32/mmap'
include Win32

mm = MMap.new(:size => 1024, :name => 'test')
mm.gvalue = 0
p mm.gvalue
mm.close

The result is:

C:/ruby/lib/ruby/gems/1.8/gems/win32-mmap-0.2.0/lib/win32/mmap.rb:335:in `load': marshal data too short (ArgumentError)
        from C:/ruby/lib/ruby/gems/1.8/gems/win32-mmap-0.2.0/lib/win32/mmap.rb:335:in `method_missing'
        from mmap_test.rb:6

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

>Comment By: Daniel Berger (djberg96)
Date: 2007-05-07 20:47

Message:
(FYI to myself)

This is caused by memcpy() truncating marshalled data that ends with "\000" because it treats it as a null. One solution might be to use wmemcpy() instead, but I'm not sure how to get at that function, since msvcrt doesn't appear to export it.

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

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


More information about the win32utils-devel mailing list