<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13309</bug_id>
          
          <creation_ts>2019-04-26 02:04:18 +0000</creation_ts>
          <short_desc>[master] qemuppc fails to shutdown intermittently</short_desc>
          <delta_ts>2019-06-10 15:44:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.8</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://errors.yoctoproject.org/Errors/Details/238410/</bug_file_loc>
          <status_whiteboard>with backport</status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.8 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Armin Kuster">akuster</reporter>
          <assigned_to name="Kevin Hao">kexin.hao</assigned_to>
          <cc>amanda.r.brindle</cc>
    
    <cc>kexin.hao</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83658</commentid>
    <comment_count>0</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-04-26 02:04:18 +0000</bug_when>
    <thetext>runqemu.QemuTest.test_qemu_can_shutdown (subunit.RemotedTestCase)
2019-04-24 09:32:33,366 - oe-selftest - INFO -  ... FAIL
2019-04-24 09:32:33,366 - oe-selftest - INFO - 1: 1/1 16/16 (200.74s) (runqemu.QemuTest.test_qemu_can_shutdown)
2019-04-24 09:32:33,366 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/qemuppc/build/meta/lib/oeqa/selftest/cases/runqemu.py&quot;, line 200, in test_qemu_can_shutdown
    self.assertTrue(qemu_shutdown_succeeded, &apos;Failed: %s does not shutdown within timeout(%s)&apos; % (self.machine, shutdown_timeout))
  File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 682, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true : Failed: qemuppc does not shutdown within timeout(120)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83665</commentid>
    <comment_count>1</comment_count>
    <who name="Kevin Hao">kexin.hao</who>
    <bug_when>2019-04-29 05:58:44 +0000</bug_when>
    <thetext>This is an issue triggered by the commit:
commit ad522ea6a64e
Author: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Date:   Fri Feb 15 16:14:51 2019 +0800

    runqemu: Let qemuparams override default settings
    
    Fixed:
    In meta/conf/machine/include/qemuboot-x86.inc:
    QB_CPU_x86-64 = &quot;-cpu core2duo&quot;
    
    $ runqemu qemux86-64 qemuparams=&quot;-cpu coreduo&quot;
    Check /proc/cpuinfo, it should use coreduo rather than core2duo since user
    specifies it, but it doesn&apos;t, append qemuparams to the last can fix the
    problem.
    
    [YOCTO #11773]
    
    (From OE-Core rev: a847dd7202a2c493788c45d11eb86866264af7a4)
    
    Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

After this commit, the sequence of the two &quot;-serial&quot; parameters when running qemu have been switched. The effect of this is that the logging thread will use ttyS1 (of course can&apos;t capture the kernel boot message anymore), and the test command will run on the ttyS0. So the output of the test command may be mangled by the kernel message (such as call trace), and let the test command produce a fake timeout error message. This issue can be fixed by the codes like the follow, but it will break the qemu machines (such as qemuarm64) which use a virtio serial console.
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 1abb2c1b6cbf..a93ca2907383 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -153,11 +153,11 @@ class QemuRunner:
         # and analyze descendents in order to determine it.
         if os.path.exists(self.qemu_pidfile):
             os.remove(self.qemu_pidfile)
-        self.qemuparams = &apos;bootparams=&quot;{0}&quot; qemuparams=&quot;-serial tcp:127.0.0.1:{1} -pidfile {2}&quot;&apos;.format(bootparams, threadport, self.qemu_pidfile)
+        self.qemuparams = &apos;bootparams=&quot;{0}&quot; qemuparams=&quot;-serial tcp:127.0.0.1:{1} -pidfile {2}&quot;&apos;.format(bootparams, self.serverport, self.qemu_pidfile)
         if qemuparams:
             self.qemuparams = self.qemuparams[:-1] + &quot; &quot; + qemuparams + &quot; &quot; + &apos;\&quot;&apos;
 
-        launch_cmd += &apos; tcpserial=%s %s&apos; % (self.serverport, self.qemuparams)
+        launch_cmd += &apos; tcpserial=%s %s&apos; % (threadport, self.qemuparams)
 
         self.origchldhandler = signal.getsignal(signal.SIGCHLD)
         signal.signal(signal.SIGCHLD, self.handleSIGCHLD)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83802</commentid>
    <comment_count>2</comment_count>
    <who name="Amanda Brindle">amanda.r.brindle</who>
    <bug_when>2019-05-13 17:47:39 +0000</bug_when>
    <thetext>This failed again:

https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/585</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83830</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-05-16 14:57:29 +0000</bug_when>
    <thetext>I think 
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d0d0d3e20f63ea29bcd6234ddefe2f390ddbdad1
might fix this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83859</commentid>
    <comment_count>4</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-05-18 15:16:33 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I think 
&gt; http://git.yoctoproject.org/cgit.cgi/poky/commit/
&gt; ?id=d0d0d3e20f63ea29bcd6234ddefe2f390ddbdad1
&gt; might fix this?

Warrior next has that commit and still seeing issue.


https://errors.yoctoproject.org/Errors/Details/241175/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83986</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-05-30 13:30:38 +0000</bug_when>
    <thetext>*** Bug 13370 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84017</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-05-30 15:30:12 +0000</bug_when>
    <thetext>The project sees this problem frequently. Kevin, will you be able to get to this defect soon?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84103</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-06-07 22:00:30 +0000</bug_when>
    <thetext>Thanks Kevin, this helps us a lot!
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=720474ee8d83a403123d7b317f095d49a3ea3e0a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84133</commentid>
    <comment_count>8</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-06-10 15:44:17 +0000</bug_when>
    <thetext>warrior backport out for review.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>