qemu: race condition on stdin reading

Bug #1317358 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

When copying files back and forth, adt-virt-qemu sometimes fails with

adt-run: @@@@@@@@@@@@@@@@@@@@ ubtree ubtree0
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Quick workaround for current users: In virt-subproc/adt-virt-qemu, bump this:

# give the stdin reading some head start
time.sleep(0.1)

to 0.5 or even 1. That'll make the whole thing noticeably slower though, but (mostly) avoid the tar error.

For fixing this for good the "runcmd" needs to be fixed to present the copied data from the host as an actual pipe instead of a plain file.

Related branches

Martin Pitt (pitti)
Changed in autopkgtest (Ubuntu):
status: New → Triaged
status: Triaged → In Progress
importance: Undecided → High
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in autopkgtest (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

For those following along, this is also required to fix that race:
http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=commitdiff;h=03172b7022

and this for running with older (precise/saucy) QEMU:
http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=commitdiff;h=777cd0d8ac

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 2.16.2

---------------
autopkgtest (2.16.2) unstable; urgency=medium

  * Support ":native" dependencies.
  * Add LXC runner test case for running as different user.
  * Add QEMU runner test case for performance and integrity of copying (1000
    files with 100 kB each).
  * copyup/down: Clean up cp process on timeout, to fix eternal hang.
  * adt-virt-qemu: Disable shared downtmp. For bigger source trees 9p in
    current QEMU is way too slow (in the magnitude of 2 MB/s, and max'ing out
    CPU usage), so we can't use it directly as a normal file system.
  * Revert "Don't extract/build source packages in shared downtmp", due to
    above change. This stops penalizing other runners with extra source tree
    copies.
  * VirtSubproc: Clean up auxverb processes on timeout.
  * adt-run: Stop testbed on TERM and QUIT signals, to avoid leaving stale
    schroot/qemu/LXC processes around when e. g. stopping a job from Jenkins.
  * adt-virt-qemu: Fix runcmd to make the command's stdin actually look and
    behave like a pipe, instead of reading directly from the "stdin" file. The
    latter leads to commands exiting prematurely when hitting the file's EOF.
    (LP: #1317358)
  * Convert one of the QEMU tests from source tree to dsc, to cover that case
    as well.
  * Add test case for QEMU with --apt-source (using libpng).
  * adt-virt-qemu: Create eofcat in /bin instead of the shared /autopkgtest
    mount, as running it from the latter again triggers the "invalid numerical
    value" bug with 9p from older QEMU versions.
  * adt-buildvm-ubuntu-cloud: Purge some unnecessary services to speed up boot
    time a bit.
  * @builddeps@ now includes build-essential, not just make. (LP: #1317357)
  * Make -s/--shell-fail start a shell on failed builds as well.
    (LP: #1317055)

 -- Martin Pitt <email address hidden> Fri, 09 May 2014 10:32:27 +0200

Changed in autopkgtest (Ubuntu):
status: Fix Committed → Fix Released
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.