Bug 8139

Summary: smart failures occur for core-image-sato and core-image-sato-sdk on several builders
Product: [QA/Testing] Build Testing Reporter: Alex Franco <alejandro.franco>
Component: generalAssignee: Randy Witt <randy.e.witt>
Status: VERIFIED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: normal    
Priority: Medium+ CC: alejandro.hernandez, alexandru.c.georgescu, anibal.limon, richard.purdie
Version: 1.9   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 7983    
Attachments:
Description Flags
results of nightly-oecore build 421
none
results of nightly-arm build 422
none
results of nightly-arm build 423
none
results of nightly-qa-systemd build 383
none
smart failure fedora 22 vm
none
ping failure fedora 22 vm
none
systemd_debug patches none

Description Alex Franco 2015-08-10 21:05:05 UTC
The failures occur during Sanity Tests as follows:

Builder: nightly-oecore
Builds: 421
Buildslave: opensuse131.osl.yoctoproject.org
Failed task: test_smart_install_dependency for core-image-sato
URL: https://autobuilder.yoctoproject.org/main/builders/nightly-oecore/builds/421/steps/Running%20Sanity%20Tests/logs/stdio
Rev: 22078d5e533e59a9aa6999abefbf6ece4e01de8d (master)
See atttachment [1]

Builder: nightly-arm
Builds: 422
Buildslave: centos7-a.osl.yoctoproject.org
Failed task: test_smart_remove_package for core-image-sato
URL: https://autobuilder.yoctoproject.org/main/builders/nightly-arm/builds/422/steps/Running%20Sanity%20Tests/logs/stdio
Rev: 448de96a2f142087be41db7a4352a769d52f1004 (master-next)
See atttachment [2]

Builder: nightly-arm
Builds: 423
Buildslave: fedora21.osl.yoctoproject.org
Failed task: test_smart_channel_add for core-image-sato-sdk
URL: https://autobuilder.yoctoproject.org/main/builders/nightly-arm/builds/423/steps/Running%20Sanity%20Tests/logs/stdio
Rev: a8bc06c3a001d89586f534c6411c3eeb2b106906 (master-next)
See atttachment [3]

Builder: nightly-qa-systemd
Builds: 383
Buildslave: fedora21.osl.yoctoproject.org
Failed task: test_smart_install_from_http for core-image-sato
URL: https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/383/steps/Running%20Sanity%20Tests_2/logs/stdio
Rev: f9ea480e6c26fea46c3011c4e9d0e2de3d5c81b4i (master)
See atttachment [4]
Comment 1 Alex Franco 2015-08-10 21:06:44 UTC
Created attachment 2647 [details]
results of nightly-oecore build 421
Comment 2 Alex Franco 2015-08-10 21:08:04 UTC
Created attachment 2648 [details]
results of nightly-arm build 422
Comment 3 Alex Franco 2015-08-10 21:08:50 UTC
Created attachment 2649 [details]
results of nightly-arm build 423
Comment 4 Alex Franco 2015-08-10 21:09:43 UTC
Created attachment 2650 [details]
results of nightly-qa-systemd build 383
Comment 5 Alex Franco 2015-08-10 21:43:07 UTC
As mentioned by rewitt these failures seem to be related to network dropping out
Comment 6 Aníbal Limón 2015-08-12 19:19:51 UTC
I was able to have a test scenario 100% reproducible (5/5),

I used Fedora 22 QEMU VM over OpenSUSE 13.2 kvm and ran testimage with core-image-sato.

Configuration,

MACHINE ??= "qemux86-64"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""

INHERIT += "testimage"
Comment 7 Randy Witt 2015-08-12 20:23:18 UTC
(In reply to comment #6)
> I was able to have a test scenario 100% reproducible (5/5),
> 
> I used Fedora 22 QEMU VM over OpenSUSE 13.2 kvm and ran testimage with
> core-image-sato.
> 
> Configuration,
> 
> MACHINE ??= "qemux86-64"
> DISTRO_FEATURES_append = " systemd"
> VIRTUAL-RUNTIME_init_manager = "systemd"
> DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
> VIRTUAL-RUNTIME_initscripts = ""
> 
> INHERIT += "testimage"

Could you attach the qemu/ssh logs?
Comment 8 Aníbal Limón 2015-08-12 20:53:21 UTC
Created attachment 2661 [details]
smart failure fedora 22 vm
Comment 9 Aníbal Limón 2015-08-12 21:01:25 UTC
Created attachment 2662 [details]
ping failure fedora 22 vm
Comment 10 Randy Witt 2015-08-17 18:15:35 UTC
This looks like a different failure case to me. It seems the network is just completely dead in this scenario.
Comment 11 Randy Witt 2015-08-17 18:20:26 UTC
Created attachment 2666 [details]
systemd_debug patches

These patches seem to cause 100% failure for the smart tests on the centos6 autobuilder.
Comment 12 Randy Witt 2015-08-17 18:24:39 UTC
Just some notes with regards to investigation work:

1. Doesn't seem to be related to tap. The failure also occurs when using only user mode networking.

2. With the https://bugzilla.yoctoproject.org/attachment.cgi?id=2666 patches,
the smart tests seem to fail 100% of the time on the centos6 autobuilder.

3. I could not readily reproduce in a centos6 container.

4. It is reproducible similar to the autobuilder when using a centos6 vm.


My current theory is that the serial output thread is causing qemu to lockup for some reason. When it "hangs" two threads are blocked on a futex and one thread is blocked on a write. Since the "reader" for the log in the test code stops reading after it finds the sentinel vaule, I'm wondering if the socket buffer fills up and causes the block.
Comment 13 Alejandro Hernandez 2015-08-17 19:52:31 UTC
Randy all these patches seem to be for debugging, I don't see anything in there (but the upgrade perhaps), that could be forcing the tests to fail, did you do anything else?, or does it simply always fail on centos6?
Comment 14 Randy Witt 2015-08-17 19:58:34 UTC
(In reply to comment #13)
> Randy all these patches seem to be for debugging, I don't see anything in
> there (but the upgrade perhaps), that could be forcing the tests to fail,
> did you do anything else?, or does it simply always fail on centos6?

Nothing in these patches should cause breakage, you're correct. What these patches do is create substantially more output over the serial port. And so it is the combination of these patches and centos6(usually works fine without the debug) that causes it to always fail.

This is why my current theory based on the strace/gdb output that I've seen leads me to believe that a buffer is filling up somewhere and blocking progress.
Comment 15 Alejandro Hernandez 2015-08-17 20:19:57 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Randy all these patches seem to be for debugging, I don't see anything in
> > there (but the upgrade perhaps), that could be forcing the tests to fail,
> > did you do anything else?, or does it simply always fail on centos6?
> 
> Nothing in these patches should cause breakage, you're correct. What these
> patches do is create substantially more output over the serial port. And so
> it is the combination of these patches and centos6(usually works fine
> without the debug) that causes it to always fail.
> 
> This is why my current theory based on the strace/gdb output that I've seen
> leads me to believe that a buffer is filling up somewhere and blocking
> progress.

Oh I see now, have you tried these patches on other similar systems such as Fedora, or a different CentOS?
Comment 16 Randy Witt 2015-08-17 20:24:40 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #13)
> > > Randy all these patches seem to be for debugging, I don't see anything in
> > > there (but the upgrade perhaps), that could be forcing the tests to fail,
> > > did you do anything else?, or does it simply always fail on centos6?
> > 
> > Nothing in these patches should cause breakage, you're correct. What these
> > patches do is create substantially more output over the serial port. And so
> > it is the combination of these patches and centos6(usually works fine
> > without the debug) that causes it to always fail.
> > 
> > This is why my current theory based on the strace/gdb output that I've seen
> > leads me to believe that a buffer is filling up somewhere and blocking
> > progress.
> 
> Oh I see now, have you tried these patches on other similar systems such as
> Fedora, or a different CentOS?

I looped a build on a centos6 container with the debug code overnight running the smart tests and didn't get a failure.(that isn't to say it couldn't happen)

I've also never gotten a failure on my Fedora 22 workstation. However, once again, that doesn't mean it can't happen.

So the only consistently reproducible scenario I've found is centos6 with the debug code.
Comment 17 Randy Witt 2015-10-16 17:03:15 UTC
Copying some of the commit message from the first patch(multiple followed to stabilize) since it gives the details.

    qemurunner: Use two serial ports and log console with a thread
    
    qemu can freeze and stop responding if the socket buffer connected to a tcp
    serial connection fills up. This happens of course when the reader of
    the serial data doesn't actually read it.
    
    This happened in the qemurunner code, because after checking for the
    "login:" sentinel, data was never again read from the serial connection.
    
    This patch solves the potential freeze by adding a thread to continuously
    read the data from the console and log it. So it also will give a full log
    of the console, rather than just up to the login prompt.
    
    To simplify this patch, another serial port was also added to use for the
    sole purpose of watching for the sentinel as well as being the interactive
    serial port. This will also prevent the possibility of lots of debug
    data on the console preventing the sentinel value from being seen due to
    interleaved text.

Should be fixed in any jethro rc.
Comment 18 Daniel Istrate 2015-10-21 13:40:35 UTC
Verified:

All recent nightly-oecore, nightly-arm and nightly-qa-systemd are successful.

They include the patches: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=jethro&id=fd164dcc31aa6c60e9834036a7cfcea5411daa3d