sbuild doesn't fail on all types of failures

Bug #1066966 reported by Seth Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sbuild (Ubuntu)
New
Undecided
Unassigned

Bug Description

I had some builds produce bad packages; sbuild thought the build succeeded, however:

┌──────────────────────────────────────────────────────────────────────────────┐
│ Package contents │
└──────────────────────────────────────────────────────────────────────────────┘
...
-rw-r--r-- root/root 11438831 2012-10-11 18:05 ./usr/lib/debug/usr/lib/libQtNetwork.so.4.6.2
-rw-r--r-- root/root 102690734 2012-10-11 18:05 ./usr/lib/debug/usr/lib/libQtGui.so.4.6.2
xz: (stdin): Compressed data is corrupt
dpkg-deb (subprocess): subprocess data returned error exit status 1
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
dpkg-deb: error: subprocess tar returned error exit status 2
...

These are not caught by sbuild because the Perl variable $CHILD_ERROR (aka $?) is not being checked after the pipes are closed in Build.pm:

        $self->log_subsection("Package contents");

        my @debcfiles = @cfiles;
        foreach (@debcfiles) {
            my $deb = "$build_dir/$_";
            next if $deb !~ /(\Q$arch\E|all)\.[\w\d.-]*$/;

            $self->log_subsubsection("$_");
            if (!open( PIPE, "dpkg --info $deb 2>&1 |" )) {
                $self->log("Can't spawn dpkg: $! -- can't dump info\n");
            }
            else {
                $self->log($_) while( <PIPE> );
                close( PIPE );
            }
            $self->log("\n");
            if (!open( PIPE, "dpkg --contents $deb 2>&1 |" )) {
                $self->log("Can't spawn dpkg: $! -- can't dump info\n");
            }
            else {
                $self->log($_) while( <PIPE> );
                close( PIPE );
            }
            $self->log("\n");
        }

Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.