<?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>13534</bug_id>
          
          <creation_ts>2019-09-17 06:09:09 +0000</creation_ts>
          <short_desc>json-c: bitbake hang in recent AMD cpu.</short_desc>
          <delta_ts>2019-10-13 19:38:33 +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>devtools / tool chain</component>
          <version>2.6.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Homin Lee">cassian.adr</reporter>
          <assigned_to name="Adrian Bunk">bunk</assigned_to>
          <cc>akuster</cc>
    
    <cc>bunk</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84990</commentid>
    <comment_count>0</comment_count>
    <who name="Homin Lee">cassian.adr</who>
    <bug_when>2019-09-17 06:09:09 +0000</bug_when>
    <thetext>I am using recent AMD cpu, AMD Ryzen 9 3900X.

When I bitbake (it&apos;a AGL project) some recipes used 100% on build in one core
and never finished.
Same happened ubuntu_18.04, ubuntu_16.04 and debian_sid host.

I found it hang in `json_c_get_random_seed()` and,
can workaround it by comment out --enable-rdrand
in `poky/meta/recipes-devtools/json-c/json-c_0.13.1.bb`:

    ...
    #EXTRA_OECONF = &quot;--enable-rdrand&quot;
    ...

It makes json-c use `/dev/urandom` instead of RDRAND to get random seed.

I thinks it because something about recent AMD cpu&apos;s RDRAND instruction
but not know detail.

Hope, this report helps someone in same problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85013</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-09-19 14:41:49 +0000</bug_when>
    <thetext>Can you reproduce the issue on a non-AMD builder?
Also we&apos;d like to know more about the exact branch and commit of oe-core used?
Does it happen on master, there was a recent update to openssl that may be related. Any additional info would be appreciated or actually needed to make progress.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85031</commentid>
    <comment_count>2</comment_count>
    <who name="Homin Lee">cassian.adr</who>
    <bug_when>2019-09-20 00:35:33 +0000</bug_when>
    <thetext>It&apos;s not reproduced in Intel(R) Core(TM) i7-4770 CPU builder.

Current tags are `thud-20.0.2` and `yocto-2.6.2`
in remote, `https://git.yoctoproject.org/git/poky`

poky&apos;s `master` branch also has same EXTRA_OECONF, `--enable-rdrand`
in `json-c_0.13.1.bb` so, will reproduce same problem I think.

It may hang from here which use resigiter directly  with asm code
in json-c

* https://github.com/json-c/json-c/blob/eae040a84a479ccad1d1c48314345c51ecf1a4a4/random_seed.c#L72
or

Think it&apos;s not related with openssl updates.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85033</commentid>
    <comment_count>3</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2019-09-20 07:47:01 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Can you reproduce the issue on a non-AMD builder?
&gt; Also we&apos;d like to know more about the exact branch and commit of oe-core
&gt; used?
&gt; Does it happen on master, there was a recent update to openssl that may be
&gt; related. Any additional info would be appreciated or actually needed to make
&gt; progress.

This is not related to OpenSSL.

RDRAND on latest Ryzen hardware has known problems, AFAIR there should be BIOS updates available that fix/workaround the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85034</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2019-09-20 08:10:03 +0000</bug_when>
    <thetext>I&apos;ll send a patch to remove the --enable-rdrand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85337</commentid>
    <comment_count>5</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-10-13 19:38:22 +0000</bug_when>
    <thetext>in warrior:

https://git.openembedded.org/openembedded-core/commit/?h=warrior&amp;id=07b19cd9ef127ec87f727e154eda62272a828275

Thud:

https://git.openembedded.org/openembedded-core/commit/?h=thud&amp;id=fad633eb5c464d4e2a984b9259625bcd150ee357</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85338</commentid>
    <comment_count>6</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-10-13 19:38:33 +0000</bug_when>
    <thetext>closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>