Skip Menu |

This queue is for tickets about the PAR CPAN distribution.

Report information
The Basics
Id: 3172
Status: resolved
Priority: 0/
Queue: PAR

People
Owner: Nobody in particular
Requestors: astewart1 [...] cox.net
Cc:
AdminCc:

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



From: "Alan Stewart" <astewart1 [...] cox.net>
To: bug-par [...] rt.cpan.org
Date: Wed, 06 Aug 2003 18:08:13 -0700
Subject: PAR::read_file problem in PAR-0.73
PAR-0.73 on NT4.0/sp6 If I understand the docs, PAR::read_file will locate a file in any loaded PAR, which would include PARs given as "use PAR;" args and the PAR containing the compiled program in a.exe. 'a.exe' is in the %LibCache. Here is a small test of the problem. First I 'type'd the source, then execute successfully from perl.exe reading from test.par. Then I can generate several different odd errors running the a.exe. D:\ACTIVE~1\Par>type test.pl use PAR 'test.par'; my $stuff = PAR::read_file('script/test.pl'); print $stuff; D:\ACTIVE~1\Par>pp -S test.pl D:\ACTIVE~1\Par>perl test.pl use PAR 'test.par'; my $stuff = PAR::read_file('script/test.pl'); print $stuff; D:\ACTIVE~1\Par>a.exe format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short format error: file is too short ^C D:\ACTIVE~1\Par>ren test.par other.par D:\ACTIVE~1\Par>a.exe IO error: Can't open IO::File=GLOB(0x13b6528) : No such file or directory D:\ACTIVE~1\Par> ########################################################## ## after editting "use PAR 'test.par';" to just "use PAR;" ########################################################## D:\ACTIVE~1\Par>pp -S test.pl D:\ACTIVE~1\Par>a.exe error: inflate error -3 D:\ACTIVE~1\Par>
Date: Sun, 10 Aug 2003 23:02:52 +0800
From: Autrijus Tang <autrijus [...] autrijus.org>
To: Alan Stewart via RT <bug-PAR [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #3172": ;
Subject: Re: [cpan #3172] PAR::read_file problem in PAR-0.73
RT-Send-Cc:
On Wed, Aug 06, 2003 at 09:08:20PM -0400, Alan Stewart via RT wrote: Show quoted text
> If I understand the docs, PAR::read_file will locate a file in any loaded PAR, > which would include PARs given as "use PAR;" args and the PAR containing the > compiled program in a.exe. 'a.exe' is in the %LibCache. Here is a small test > of the problem.
Yes, there is a bug in lib/PAR.pm. Before this line in read_file: foreach my $zip (@LibCache) { there should be one extra line preceding it: local $PAR::__reading = 1; that should solve the problem you're having. This problem will be fixed in 0.74. Thanks, /Autrijus/
Download (untitled)
application/pgp-signature 187b

Message body not shown because it is not plain text.

[autrijus@autrijus.org - Sun Aug 10 11:02:40 2003]: Show quoted text
> Yes, there is a bug in lib/PAR.pm. Before this line in read_file: > > foreach my $zip (@LibCache) { > > there should be one extra line preceding it: > > local $PAR::__reading = 1; > > that should solve the problem you're having. >
Adding that line eliminates the errors I get when there is no "use PAR;" line, or "use PAR;" with no args. I still get the error format error: file is too short in a repeating loop, when I have "use PAR 'test.par';". It may seem redundant to leave the 'test.par' arg in the source when I know it's in the a.exe, but I want to lock down the source and the par file while testing before compiling and not change anything to compile it.
From: Alan Stewart
Show quoted text
> Adding that line eliminates the errors I get when there is no "use > PAR;" line, or "use PAR;" with no args. I still get the error > format error: file is too short > in a repeating loop, when I have "use PAR 'test.par';".
I haven't figured it all out, but I found that my $fileLength = $fh->tell(); in the sub _findEndOfCentralDirectory in Zip.pm is returning a large negative number for the file 'test.par', causing the "file too short" error. I see that you redefine the tell() function in par.pl to be conditional on $PAR::__reading, so I am guessing that $PAR::__reading doesn't get set to 0 somewhere that it should and the previous $start_pos gets subtracted.
Date: Fri, 15 Aug 2003 04:40:05 +0800
From: Autrijus Tang <autrijus [...] autrijus.org>
To: Guest via RT <bug-PAR [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #3172": ;
Subject: Re: [cpan #3172] PAR::read_file problem in PAR-0.73
RT-Send-Cc:
On Wed, Aug 13, 2003 at 11:00:25PM -0400, Guest via RT wrote: Show quoted text
> I haven't figured it all out, but I found that > my $fileLength = $fh->tell(); > in the sub _findEndOfCentralDirectory in Zip.pm is returning a large > negative number for the file 'test.par', causing the "file too short" > error. I see that you redefine the tell() function in par.pl to be > conditional on $PAR::__reading, so I am guessing that $PAR::__reading > doesn't get set to 0 somewhere that it should and the previous > $start_pos gets subtracted.
Thanks! This gave me sufficient info to track it down. I've got rid of $PAR::__reading completely, so the snapshot build should have this cured. Additional testing would be appreciated. So... May I ask what your name is, so I can put it in the AUTHORS file? Thanks, /Autrijus/
Download (untitled)
application/pgp-signature 187b

Message body not shown because it is not plain text.

From: Alan Stewart
[autrijus@autrijus.org - Thu Aug 14 16:40:09 2003]: Show quoted text
> So... May I ask what your name is, so I can put it in the AUTHORS > file? >
I'm already on the User and Contributors list on this site. Alan Stewart astewart1@cox.net I'd come up with complete fixes if I didn't have a day job !! I'll try the snapshot right away...
[guest - Thu Aug 14 17:22:30 2003]: Show quoted text
> > I'll try the snapshot right away...
No errors with or without an arg to "use PAR;" when compiling with "pp test.pl". Compiling with "pp -d test.pl" and "use PAR 'test.par';" gives an error IO error: Can't open IO::File=GLOB(0x1436510) : "pp -d test.par" and "use PAR;" is good.