Bug 12001 - QEMU hangs and tests are aborted
Summary: QEMU hangs and tests are aborted
Status: RESOLVED FIXED
Alias: None
Product: Build Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 2.4
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.4 M4
Assignee: brian avery
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-08-29 19:17 UTC by Todor Minchev
Modified: 2017-09-25 21:47 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
patch intended to fix/help debug the issue (17.23 KB, patch)
2017-09-03 18:15 UTC, Juro Bystricky
no flags Details | Diff
patch using QEMU pidfile (16.92 KB, patch)
2017-09-06 13:41 UTC, Juro Bystricky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Todor Minchev 2017-08-29 19:17:23 UTC
https://autobuilder.yocto.io/builders/nightly-x86-64/builds/462/steps/Running%20Sanity%20Tests/logs/stdio

NOTE: core-image-sato-sdk-1.0-r0 do_testimage: test_cpio (buildcpio.BuildCpioTest)
NOTE: core-image-sato-1.0-r0 do_testimage: Qemu pid didn't appeared in 60 seconds
WARNING: core-image-sato-1.0-r0 do_testimage: Qemu ended unexpectedly, dump data from host is in /tmp/oe-saved-tests/201708291357_qemu
NOTE: core-image-sato-1.0-r0 do_testimage: Sending SIGTERM to runqemu
Comment 2 Juro Bystricky 2017-09-03 18:15:41 UTC
Created attachment 3971 [details]
patch intended to fix/help debug the issue
Comment 3 Juro Bystricky 2017-09-03 18:16:04 UTC
I have created a patch that refactors the searching for QEMU PID.
Also adds additional printouts if things go wrong.
Also fixes some unlikely corner cases (self.qemupid = qemu_child could be set
but /proc entry does not exist)
Comment 4 Juro Bystricky 2017-09-05 21:55:54 UTC
OK, so the patch is not 100% working.
Back to the drawing board, this time testing a patch that uses QEMU cmd line argument -pidfile. This should greatly simplify/eliminate parsing of "ps" output.

BTW, I found out (the hard way) that an uncaught exception in "find_child" will typically result in an immediate error message "Qemu pid didn't appeared in 120 seconds". This probably explains why increasing the timeout value did not improve the testing.
Comment 5 Juro Bystricky 2017-09-06 13:41:07 UTC
Created attachment 3986 [details]
patch using QEMU pidfile
Comment 6 Juro Bystricky 2017-09-06 14:35:15 UTC
Looking at this:

NOTE: core-image-sato-sdk-1.0-r0 do_testimage: Waiting at most 1500 seconds for login banner
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: Connection from 127.0.0.1:45934
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: Reached login banner
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: Logged as root in serial console
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: test_ping (ping.PingTest)
NOTE: core-image-sato-sdk-1.0-r0 do_testimage:  ... ok
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: test_ssh (ssh.SSHTest)
NOTE: core-image-sato-sdk-1.0-r0 do_testimage:  ... ok
NOTE: core-image-sato-sdk-1.0-r0 do_testimage: test_cpio (buildcpio.BuildCpioTest)
NOTE: core-image-sato-1.0-r0 do_testimage: Qemu pid didn't appeared in 60 seconds

It clearly shows we are logged in QEMU, so QEMU is manifestly running, at this point we must have had found QEMU PID. So the error message "Qemu pid didn't appeared in 60 seconds" is most likely caused by some uncaught exception, resulting in a misleading error message
Comment 7 Juro Bystricky 2017-09-18 22:51:01 UTC
Refactored/simplified the code that determines PID of the running QEMU, PID is actually provided by QEMU itself via command line argument -pidfile.
Hence the code does not need to analyze running processes and various levels of ancestry. This, of course, does not mean we will not see this timeout error again. The replace code, although more complex, did not seem to have any obvious shortcomings. It may, however, provide additional insight as the code code-paths have changed.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ed9d0fa5a92f837b14ff8f4e8d433da92d7dc968
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=03aa1ef733032e1acae4d291580968301679117f
Comment 8 brian avery 2017-09-19 16:43:13 UTC
closing based on ed9d0fa5a92f837b14ff8f4e8d433da92d7dc968 and 03aa1ef733032e1acae4d291580968301679117f commits.  Should the issue recur, the additional logging info that was also added as part of these commits should help.
Comment 9 brian avery 2017-09-25 21:47:20 UTC
looks like the closed box didn't stick.... see previous comment for commit and reason.