[Pkg-openssl-devel] Bug#532336: Bug#532336: openssl: FTBFS on kfreebsd-amd64

Cyril Brulebois kibi at debian.org
Sun Jun 14 02:42:46 UTC 2009


Kurt Roeckx <kurt at roeckx.be> (13/06/2009):
> >    my ($outdev,$outino, at junk)=stat($output);
> >
> >      open STDOUT,">$output" || die "can't open $output: $!"
> > -       if ($stddev!=$outdev || $stdino!=$outino);
> > +#      if ($stddev!=$outdev || $stdino!=$outino);
> >  }

Putting back a bit more context to help everyone understand the problem
here:
| my $output = shift;
| 
| { my ($stddev,$stdino, at junk)=stat(STDOUT);
|   my ($outdev,$outino, at junk)=stat($output);
| 
|     open STDOUT,">$output" || die "can't open $output: $!"
|         if ($stddev!=$outdev || $stdino!=$outino);
| }

Let's assume $output is the file to which one wants to write. It's not
yet there, so stat() on it returns undef. But since we're not under
strict & warnings (which I thought was Perl 101, but oh well), it goes
unnoticed that there are undefined values being compared. That's a
numerical comparison, by the way. So that's like both $outdev and
$outino are 0. And if it happens that both $stdev and $stdino are 0 too,
the open() doesn't happen, and build breaks. That's what happens on
kfreebsd-amd64.

Proposed check:
|         if (!(defined $outdev) || !(defined $outino) || $stddev!=$outdev || $stdino!=$outino);


If the above isn't clear enough, traced values of $stddev, $stdino + $outdev,
$outino during the build follow:

,---[ linux-amd64 ]---
| perlasm/x86_64-xlate.pl  (output: x86_64cpuid.S)
| STD: [STDOUT] 65027, 6006877
| OUT: [x86_64cpuid.S] 65027, 6006877
| 
| ../perlasm/x86_64-xlate.pl  (output: md5-x86_64.s)
| STD: [STDOUT] 6, 2032565
| OUT: [md5-x86_64.s] ,
| 
| asm/../../perlasm/x86_64-xlate.pl  (output: sha1-x86_64.s)
| STD: [STDOUT] 6, 2032565
| OUT: [sha1-x86_64.s] ,
|
|`---

,---[ kfreebsd-amd64 ]---
| STD: [STDOUT] 75, 1324541
| OUT: [x86_64cpuid.S] 75, 1324541
| 
| ../perlasm/x86_64-xlate.pl  (output: md5-x86_64.s)
| STD: [STDOUT] 0, 0
| OUT: [md5-x86_64.s] ,
`---

Mraw,
KiBi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-openssl-devel/attachments/20090614/8dc106dd/attachment-0001.pgp>


More information about the Pkg-openssl-devel mailing list