Skip Menu |

This queue is for tickets about the File-Map CPAN distribution.

Report information
The Basics
Id: 56644
Status: resolved
Priority: 0/
Queue: File-Map

People
Owner: LEONT [...] cpan.org
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: mmap turning ref into map
Date: Fri, 16 Apr 2010 09:02:22 +1000
To: bug-File-Map [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With File::Map 0.24 on debian i386, use File::Map 'map_file'; my $x; my $y = \$x; map_file ($y, '/etc/motd', '<'); print $y; gets an assert failure perl: lib/File/Map.xs:186: reset_var: Assertion `!((var)->sv_flags & 0x00000800) || !((var)->sv_u.svu_rv)' failed. and the process abort()s. I hoped it would turn $y into an mmapped string. I think that'd be desirable, but if there's some reason it's impossible then I'd hope it could croak, not abend. For what it's worth the same thing happens in File::Map 0.23, so presumably it's not related to what prototypes did vs no longer do to references :-).
I just fixed this in HEAD. Ironically this is already handled in case of assignment since 0.19, hadn't realized it would be a problem here too. On Thu Apr 15 19:02:41 2010, user42@zip.com.au wrote: Show quoted text
> With File::Map 0.24 on debian i386, > > use File::Map 'map_file'; > my $x; > my $y = \$x; > map_file ($y, '/etc/motd', '<'); > print $y; > > gets an assert failure > > perl: lib/File/Map.xs:186: reset_var: Assertion `!((var)->sv_flags > & 0x00000800) || !((var)->sv_u.svu_rv)' failed. > > and the process abort()s. > > I hoped it would turn $y into an mmapped string. I think that'd be > desirable, but if there's some reason it's impossible then I'd hope it > could croak, not abend. > > For what it's worth the same thing happens in File::Map 0.23, so > presumably it's not related to what prototypes did vs no longer do to > references :-).