[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Upload and Blog-Post



On Wed, 2008-09-24 at 10:56 +0200, Frank Lichtenheld wrote:
> On Mon, Sep 22, 2008 at 01:20:58AM +0200, Frank Lichtenheld wrote:
> > I've uploaded an rc2 to experimental. I hope I can find some time
> > this week to do a full run with it. I really would like to avoid
> > having to do a 2.0.1 directly after 2.0.0. It's just numbers, but
> > anyway ;)
> 
> I've started the full run yesterday. I patched reporting/harness to
> include the STDERR output in the lintian.log, let's see whether that
> helps us to track down the readelf problems.

Having got an etch chroot set up on my laptop (an i386) I've managed to
reproduce the problem. At base, each of the affected binaries is
returning "invalid operation" from objdump, and etch's readelf does not
deal well with attempting to parse the binary.

This appears to be fairly simply fixable by only using readelf if the
error returned by objdump was "File format not recognized", which
accounts for all the 64-bit false positives which the readelf code was
developed to address.

The attached patch modifies the collector script as above and works in
my testing. I haven't committed it yet as I want to test it with a few
more packages (and in case anyone had any comments on the approach).

The script could use some work on parts of the code structure, but
they're not imperative and I've left them for now to produce a saner
diff.

Adam
diff --git a/collection/objdump-info b/collection/objdump-info
index 3f4c335..6b77e4a 100755
--- a/collection/objdump-info
+++ b/collection/objdump-info
@@ -98,16 +98,44 @@ while (<FILES>) {
 
 	    last if $failed;
 	} else {
-	    # We're using etch's binutils so attempt to build an output file
-	    # in the expected format without using objdump; we lose some
-	    # data but none that our later checks actually use
 	    my @sections;
 	    my @symbol_versions;
 
-	    if (system("readelf -l $bin 2>&1 | grep -q 'Error: Not an ELF file'") == 0) {
+	    # If the error wasn't one of the two we special-case, abort
+	    $failed = 1;
+	    my $invalidop = 0;
+	    my $objdumpout = '';
+	    if (open(PIPE, '-|', "objdump --headers --private-headers -T $bin 2>&1")) {
+		while(<PIPE>) {
+		    $objdumpout .= $_;
+		    if (m/Invalid operation$/) {
+			$invalidop = 1;
+			$failed = 0;
+		    } elsif (m/File format not recognized$/) {
+			$failed = 0;
+		    }
+		}
+		close PIPE;
+	    }
+
+	    last if $failed;
+
+	    if ($invalidop) {
+		# If objdump returned "invalid operation" then the
+		# readelf code will tend to produce false positives
+		# so just return the objdump output and let the scripts
+		# handle it
+
+		print OUT $objdumpout;
+		next;
+	    } elsif (system("readelf -l $bin 2>&1 | grep -q 'Error: Not an ELF file'") == 0) {
 		print OUT "objdump: $bin: File format not recognized\n";
 		next;
 	    } elsif (open(PIPE, '-|', "readelf -W -l -t -d -V $bin")) {
+		# We're using etch's binutils so attempt to build an output file
+		# in the expected format without using objdump; we lose some
+		# data but none that our later checks actually use
+
 		my $section = '';
 		my %program_headers;
 

Reply to: