[buildd-tools-devel] Some cleanup for current tip

Roger Leigh rleigh at codelibre.net
Wed Aug 5 22:44:58 UTC 2009


On Tue, Aug 04, 2009 at 11:39:56PM +0100, Roger Leigh wrote:
> Issues I've found testing were:
> - file chroots are not setting $PS1 in the shell (buggy in older
>   versions as well)
> - file session and source chroots hang unpacking the source tarball
> 
> Unsure why file chroots don't get a shell prompt--shell execution is
> independent of the chroot type.  The unpack error is not clear
> either; this will need some more investigation.

The hang was due to a buggy 05file and 10mount setup script, which
set the wrong unpack location for the tarfile to be unpacked in.

I found a more subtle bug here, not present in any stable release,
in the run-parts logging code run_parts::run_child, triggered by
running with --verbose to make it log the tar unpacking.  The
additional data to log is the likely cause of the bug.  Strangely,
the 00check script doesn't trigger it.

Here, there's an obvious omission in not handling EINTR, but what's
actually going wrong here is that we can block indefinitely on a
read:

	  if (pollfds[1].revents | POLLIN)
	    {
	      int errdata;
	      if ((errdata = read(pollfds[1].fd, buffer, BUFSIZ)) < 0)
		throw error(READ, strerror(errno));

	      if (errdata)
		stderr_buf += std::string(&buffer[0], errdata);
	    }

Since poll(2) returns that there's data to read, we should be
confident that read(2) will not ever block, but it does.  This may
be because we don't reset the pollfds .revent before re-polling in
the loop, but my reading of the poll(2) manpage is that .revents is
always set by poll(2) as an output parameter, so this should not be
required.  Also, since we use an infinite timeout we shouldn't get
woken up unless there's something to read.

This is a bug which needs fixing prior to release, but it's hopefully
the last major issue that's not purely cosmetic.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- 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/buildd-tools-devel/attachments/20090805/72994d0d/attachment.pgp>


More information about the Buildd-tools-devel mailing list