[rt.cpan.org #48150] Minor issue: Use of uninitialized value in length at PAR/Packer.pm line 784

2009-07-24 Thread Bram Stappers via RT
Fri Jul 24 03:13:41 2009: Request 48150 was acted upon.
Transaction: Ticket created by bram.stapp...@gmail.com
   Queue: PAR-Packer
 Subject: Minor issue: Use of uninitialized value in length at 
PAR/Packer.pm  line 784
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: bram.stapp...@gmail.com
  Status: new
 Ticket URL: http://rt.cpan.org/Ticket/Display.html?id=48150 


First off: thanks for this wonderful tool!


Info

PAR::Packer: PAR-Packer-0.991

Perl:
This is perl, v5.8.9 built for x86_64-linux-thread-multi
(with 5 registered patches, see perl -V for more detail)

Copyright 1987-2008, Larry Wall

Binary build 825 [288577] provided by ActiveState http://www.ActiveState.com
Built Dec 14 2008 19:55:40

System:
Linux quadje 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23 13:00:23
EST 2009 x86_64 x86_64 x86_64 GNU/Linux


Problem

pp invocation:

pp @build/ppflags.txt -o script.bin -S -a
../generic/Unix/Win32.pm;lib/Win32.pm -a
../generic/Unix/Win32/AbsPath.pm;lib/Win32/AbsPath.pm -a
../generic/Unix/Win32/TieRegistry.pm;lib/Win32/TieRegistry.pm
build/script.pl
Use of uninitialized value in length at
.../perl64/site/lib/PAR/Packer.pm line 784.
Use of uninitialized value in length at
.../perl64/site/lib/PAR/Packer.pm line 784.

with ppflags.txt:
-I inc1
-I inc2
-I inc3
-M mod1
-M mod2
-M mod3


Fix

(This just suppresses the symptom and the result works for me -- I
have no clue as to the root cause, since I did not bother to look for
it.)

--- ../site/lib/PAR/Packer.pm.org   2009-07-24 09:05:50.0 +0200
+++ ../site/lib/PAR/Packer.pm   2009-07-24 09:06:11.0 +0200
@@ -781,7 +781,7 @@

 (my $privlib = $Config{privlib}) =~ s{\\}{/}g;
 (my $archlib = $Config{archlib}) =~ s{\\}{/}g;
-foreach my $pfile (sort grep length $map{$_}, keys %map) {
+foreach my $pfile (sort grep length($map{$_} || ''), keys %map) {
 next if !$opt-{B} and (
 ($map{$pfile} eq $privlib/$pfile) or
 ($map{$pfile} eq $archlib/$pfile)



[rt.cpan.org #48151] Minor issue: Invalid version format (multiple underscores) at Module/ScanDeps.pm line 710, FH line 43.

2009-07-24 Thread Bram Stappers via RT
Fri Jul 24 03:35:45 2009: Request 48151 was acted upon.
Transaction: Ticket created by bram.stapp...@gmail.com
   Queue: Module-ScanDeps
 Subject: Minor issue: Invalid version format (multiple underscores) at  
Module/ScanDeps.pm line 710, FH line 43.
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: bram.stapp...@gmail.com
  Status: new
 Ticket URL: http://rt.cpan.org/Ticket/Display.html?id=48151 


First off: thanks for a wonderful tool!


Info

Module::ScanDeps: Module-ScanDeps-0.93.tar.gz

Perl:
This is perl, v5.8.9 built for x86_64-linux-thread-multi
(with 5 registered patches, see perl -V for more detail)

Copyright 1987-2008, Larry Wall

Binary build 825 [288577] provided by ActiveState http://www.ActiveState.com
Built Dec 14 2008 19:55:40

System:
Linux quadje 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23 13:00:23
EST 2009 x86_64 x86_64 x86_64 GNU/Linux


Problem

I am running PAR::Packer (pp) and this gives me

  Invalid version format (multiple underscores) at
.../perl64/site/lib/Module/ScanDeps.pm line 710, FH line 43.


Analysis

The thing is, I am foolishly using

  require __PACKAGE__ . SomeExt.pm;

in my code which in line 708 of Module/ScanDeps.pm

  if (/^\s*(?:use|require)\s+([\d\._]+)/) {

leaves $1 set to '__'


Fix

--- /home/stappers/perl64/site/lib/Module/ScanDeps.pm.org
2009-07-24 09:19:23.0 +0200
+++ /home/stappers/perl64/site/lib/Module/ScanDeps.pm   2009-07-24
09:31:04.0 +0200
@@ -705,7 +705,7 @@
 return;
 }
 # use VERSION:
-if (/^\s*(?:use|require)\s+([\d\._]+)/) {
+if (/^\s*(?:use|require)\s+([\d\._]+)  '__' ne $1/) {
   # include feaure.pm if we have 5.9.5 or better
   if (version-new($1) = version-new(5.9.5)) { # seems to
catch 5.9, too (but not 5.9.4)
 return feature.pm;



PAR/pp INC dir defect fixed

2009-07-24 Thread Markus Jansen
Hi Steffen and others,

I have run into a defect others (e.g. Scott Stanton in May 2008) have 
experienced before.
The symptom is Can't locate IO/file.pm in @INC ... when calling pp. 

In short, PAR::StrippedPARL::Base.pm::wirte_parl uses the current's Perl @INC 
members
as -Iinc_dir as input to the freshly unpacked parl as part of the 
compilation process.
Unfortunately, the quotes render this input completely useless (and is not 
needed since @args
is later on passed to system() as array.

The defect shows only up where the compilation environment (where @INC gets 
statically packed into 
the DATA appendix of ...::Base.pm) differs from the runtime environment.

The context diff of the tested fix is attached below (tested with Perl 5.8.8 on 
Solaris 8 (build) and 10 (pp runtime).
Though I fixed the defect in PAR::Packer 0.991, the diff is based on fixing 
0.992_02 (no code change in this place).

Thanks for the great work!

Cheers,
Markus


diff -c lib/PAR/StrippedPARL/Base.pm.orig lib/PAR/StrippedPARL/Base.pm
*** lib/PAR/StrippedPARL/Base.pm.orig   Sun Jul 19 15:15:35 2009
--- lib/PAR/StrippedPARL/Base.pmFri Jul 24 14:51:15 2009
***
*** 71,77 
  my @libs = ();
  for my $ilib ( @INC ) {
  $ilib =~ s/\\$//;
! push(@libs, qq(-I\$ilib\) );
  }
  my @args = (@libs, qw/-q -B/);
  
--- 71,77 
  my @libs = ();
  for my $ilib ( @INC ) {
  $ilib =~ s/\\$//;
! push(@libs, qq(-I$ilib) );
  }
  my @args = (@libs, qw/-q -B/);
  



--
Markus Jansen
Master Methods  Tools Engineer, PM  IT 

Ericsson GmbH 
Eurolab RD 
Ericsson Allee 1
52134 Herzogenrath, Germany
www.ericsson.comOffice: +49 2407 575 5157
Fax: +49 2407 575 98452
Mobile: +49 172 274 2003
Email: markus.jan...@ericsson.com   

Ericsson GmbH. Sitz: Düsseldorf. Registergericht: Amtsgericht Düsseldorf, HRB 
33012. Geschäftsführer: Carsten Ahrens. Aufsichtsratsvorsitzender: Anders Olin

This communication is confidential and intended solely for the addressee(s). 
Any unauthorized review, use, disclosure or distribution is prohibited. If you 
believe this message has been sent to you in error, please notify the sender by 
replying to this transmission and delete the message without disclosing it. 
Thank you.

E-mail including attachments is susceptible to data corruption, interception, 
unauthorized amendment, tampering and viruses, and we only send and receive 
emails on the basis that we are not liable for any such corruption, 
interception, amendment, tampering or viruses or any consequences thereof.




Re: PAR/pp INC dir defect fixed

2009-07-24 Thread Steffen Mueller

Hi Markus,

Markus Jansen wrote:

I have run into a defect others (e.g. Scott Stanton in May 2008) have 
experienced before.
The symptom is Can't locate IO/file.pm in @INC ... when calling pp. 


In short, PAR::StrippedPARL::Base.pm::wirte_parl uses the current's Perl @INC 
members
as -Iinc_dir as input to the freshly unpacked parl as part of the 
compilation process.
Unfortunately, the quotes render this input completely useless (and is not 
needed since @args
is later on passed to system() as array.


wow, that's quite the embarrassing oversight on my part. Thanks for 
diagnosing and fixing it! I applied the patch to PAR::Packer trunk and 
will release a new developer version shortly.


Best regards,
Steffen