Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: amd64 perl 5.8.x on scalar string fh
Date: Sat, 02 Oct 2010 08:34:05 +1000
To: bug-File-Map [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
I've been getting some cpantesters fails for my locate iterator using File::Map (0.29 and thereabouts) on an amd64 with perl 5.8.3 and 5.8.7, File-Locate-Iterator-16: - x86_64-linux-ld / 5.8.3: - FAIL http://www.cpantesters.org/cpan/report/9dc823d6-cc29-11df-a635-c4330210580f - x86_64-linux-thread-multi-ld / 5.8.7: - FAIL http://www.cpantesters.org/cpan/report/984676e2-cc29-11df-a7f9-55330210580f I think it's related to trying map_handle() of a scalar string handle like my $mystring = 'hello'; open $fh, '<', \$mystring; map_handle ... $fh which I expected to fail at the map_handle(), but which seems to succeed and only later get an error on attempting to read from the mmapped variable, Can't overwrite an empty map at /home/sand/.cpan/build/File-Locate-Iterator-16-jGme5h/blib/lib/File/Locate/Iterator.pm line 239. It's very possible it's all my own doing, but I haven't had a chance or an amd64 to try to track it down, and it doesn't happen on i386, so this is just as a "maybe it's File::Map, maybe its me". :-) If your tests don't already exercise map_handle() on a scalar fh you might add something to see that it throws an error, on a perl new enough to have open() on strings ...
On Fri Oct 01 18:35:24 2010, user42@zip.com.au wrote: Show quoted text
> It's very possible it's all my own doing, but I haven't had a chance > or > an amd64 to try to track it down, and it doesn't happen on i386, so > this > is just as a "maybe it's File::Map, maybe its me". :-)
Right now this is a little to vague to tell for me too :-| Show quoted text
> If your tests don't already exercise map_handle() on a scalar fh you > might add something to see that it throws an error, on a perl new > enough > to have open() on strings ...
Yeah, I agree that would be a good addition. I'll add it to the next version. Leon
Some new tests I've added to File::Map seem to confirm there is an issue on 5.8.7 and lower that results in spurious warnings; I don't really understand though why though. Perlbrew doesn't want to build 5.8.7 for me, so I don't think I can produce a fix. Right now I can only guess what the problem is, and quite frankly supporting such an old version of perl isn't very high on my priority list anyway. Unless you can provide me with fix, this will probably won't be fixed. Leon
Subject: Re: [rt.cpan.org #61839] amd64 perl 5.8.x on scalar string fh
Date: Tue, 14 Dec 2010 09:25:20 +1100
To: bug-File-Map [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Leon Timmermans via RT" <bug-File-Map@rt.cpan.org> writes: Show quoted text
> > Some new tests I've added to File::Map seem to confirm there is an issue > on 5.8.7 and lower that results in spurious warnings;
Looks similar. But I thought my trouble was with scalar handles open my $fh, '<', \$mystring; succeeding. Yet in 20-errors.t seems to correctly get an error. The only thing I think I have different to 20-errors.t is the map target scalar is a hash element rather than a local "my($map)", oh, and asking for mmap mode '<', if that makes any subtle difference. my $self = bless { key => $key, mmap => undef, }, $class; my $tell = tell($fh); # which is 0 File::Map::map_handle ($self->{'mmap'}, $fh, '<', $tell); If you felt inclined to exercise that as well, for the next release. Show quoted text
> old version
Oh, well, you know chasing down can sometimes turn up a wrong assumption or a 32-bit-ism, even if it has to wait a while for an amd64 power user who cares to come along ...
On Mon Dec 13 17:25:32 2010, user42@zip.com.au wrote: Show quoted text
> Looks similar. But I thought my trouble was with scalar handles > > open my $fh, '<', \$mystring; > > succeeding. Yet in 20-errors.t seems to correctly get an error.
It used to indirectly triggered the empty map code, the issues seems to be somewhere there. See http://www.cpantesters.org/cpan/report/eec427d4-0046-11e0-9aee-fd74b0d14a89 for an example. Show quoted text
> The only thing I think I have different to 20-errors.t is the map target > scalar is a hash element rather than a local "my($map)", oh, and asking > for mmap mode '<', if that makes any subtle difference.
There is a test for hash elements already (test 25 of t/20-errors.t). Has been in there since I dropped prototypes. Show quoted text
> > old version
> > Oh, well, you know chasing down can sometimes turn up a wrong assumption > or a 32-bit-ism, even if it has to wait a while for an amd64 power user > who cares to come along ...
I suspect the bug has more to do with perl 5.8.7 than File::Map, it may very well not be fixable :-|.
On Mon Dec 13 18:58:27 2010, LEONT wrote: Show quoted text
> On Mon Dec 13 17:25:32 2010, user42@zip.com.au wrote:
> > Looks similar. But I thought my trouble was with scalar handles > > > > open my $fh, '<', \$mystring; > > > > succeeding. Yet in 20-errors.t seems to correctly get an error.
> > It used to indirectly triggered the empty map code, the issues seems to > be somewhere there. See >
http://www.cpantesters.org/cpan/report/eec427d4-0046-11e0-9aee-fd74b0d14a89 Show quoted text
> for an example. >
> > The only thing I think I have different to 20-errors.t is the map target > > scalar is a hash element rather than a local "my($map)", oh, and asking > > for mmap mode '<', if that makes any subtle difference.
> > There is a test for hash elements already (test 25 of t/20-errors.t). > Has been in there since I dropped prototypes. >
> > > old version
> > > > Oh, well, you know chasing down can sometimes turn up a wrong assumption > > or a 32-bit-ism, even if it has to wait a while for an amd64 power user > > who cares to come along ...
> > I suspect the bug has more to do with perl 5.8.7 than File::Map, it may > very well not be fixable :-|.
Is this still an issue, or can I close this ticket? Leon
On Wed Jun 20 05:54:34 2012, LEONT wrote: Show quoted text
> Is this still an issue, or can I close this ticket?
Closing this now, feel free to reopen if it's still an issue. Leon