<?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>11732</bug_id>
          
          <creation_ts>2017-06-28 23:51:16 +0000</creation_ts>
          <short_desc>meta-java: openjre-8 build fails when using shared state mirror</short_desc>
          <delta_ts>2017-07-20 22:50:39 +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>Other YP Layers</product>
          <component>layers</component>
          <version>2.3.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Bruce">henry.bruce</reporter>
          <assigned_to name="brian avery">brian.avery</assigned_to>
          <cc>eduard.bartosh</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</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>74615</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-06-28 23:51:16 +0000</bug_when>
    <thetext>Steps to re-create
==================
$ git clone -b pyro git://git.yoctoproject.org/poky
$ git clone -b pyro git://git.openembedded.org/meta-openembedded
$ git clone -b pyro git://git.yoctoproject.org/meta-java
$ source poky/oe-init-build-env
$ bitbake-layers add-layer ../meta-openembedded/meta-oe
$ bitbake-layers add-layer ../meta-java
$ bitbake openjre-8
Observe successful build
Remove tmp directory
Add a known good shared state mirror to conf/site.conf
$ bitbake openjre-8
ERROR: jaxp1.3-native-1.4.01-r0 do_compile: Function failed: do_compile (log file is located at /workdir/pyro/java/build/tmp/work/x86_64-linux/jaxp1.3-native/1.4.01-r0/temp/log.do_compile.8789)
Log data follows:
| DEBUG: Executing shell function do_compile
| Illegal instruction (core dumped)
| WARNING: exit code 132 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /workdir/pyro/java/build/tmp/work/x86_64-linux/jaxp1.3-native/1.4.01-r0/temp/log.do_compile.8789)

Further digging shows that a bad javac has been built, causing illegal instruction error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75206</commentid>
    <comment_count>1</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-07-20 19:54:20 +0000</bug_when>
    <thetext>I omitted an entry in &quot;steps to re-create&quot;, Java config was as per meta-java README and set in local.conf

PREFERRED_PROVIDER_virtual/java-initial-native = &quot;cacao-initial-native&quot;
PREFERRED_PROVIDER_virtual/java-native = &quot;jamvm-native&quot;
PREFERRED_PROVIDER_virtual/javac-native = &quot;ecj-bootstrap-native&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75207</commentid>
    <comment_count>2</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-07-20 20:58:39 +0000</bug_when>
    <thetext>I forgot to state that bug was seen on Fedora 24 workstation. 
To improve chances of repeatability, I re-ran build in the poky container running on the same workstation. This used the sstate created by the Fedora 24 build.

Result were similar, but not identical, when building with sstate cache.
$ bitbake openjre-8
ERROR: servlet2.3-native-4.1.37-r1 do_compile: Function failed: do_compile (log file is located at /workdir/pyro/java/build-docker/tmp/work/x86_64-linux/servlet2.3-native/4.1.37-r1/temp/log.do_compile.6781)
Log data follows:
| DEBUG: Executing shell function do_compile
| Illegal instruction
| WARNING: exit code 132 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /workdir/pyro/java/build-docker/tmp/work/x86_64-linux/servlet2.3-native/4.1.37-r1/temp/log.do_compile.6781)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75210</commentid>
    <comment_count>3</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-07-20 22:17:35 +0000</bug_when>
    <thetext>I repeated the build using the poky container on an Ubuntu 16.04 host and it completed OK. Somehow a Fedora 24 host is creating the illegal instruction, even when using the poky container. 

Here are the uname -a outputs
Ubunutu 16.04: Linux echidna 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Fedora 24: Linux hbruce-desk3 4.10.17-100.fc24.x86_64 #1 SMP Mon May 22 16:32:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75212</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-07-20 22:50:39 +0000</bug_when>
    <thetext>This is a meta-java set of issues, so I&apos;m closing it as out of scope and because it is not related to sstate as I originally feared.
On an ubuntu host + ubuntu container I see :
1) cacao-initial-native - works fine for bootstrapping
2) jamvm-initial-native - fails on hosts (like the container) that lack a java install.
sstate obfuscates this in that if you have ever gotten a build to work, then the bootstrap is no longer setscened (as it is not needed, this is correct) and so the error does not show up.
3) there is something wonky about their dependency list in that if I fail to pick either jamvm-initial-native or cacao-initial-native, I can get a choice that changes if I do things like add -D to bitbake. or If a add an sstate-mirror.

But since I made a straightforward test case, where 2 recipes provided the same thing, I could NOT get the flopping to happen. So, I&apos;ll count this as a notabug for us.
On an fedora host + ubuntu container or on a fedora host henry sees :
4) run.do_compile  calls a shell script which calls java which  seems to have an &quot;illegal instruction&quot; core dump. May want to run gdb java instead here and catch it...

One additional note:
Henry&apos;s fedora issue is interesting in that the host outside the container (aka the kernel) is affecting the build.

Here&apos;s the bug report to openembedded-devel in case someone wants to follow the thread:

http://lists.openembedded.org/pipermail/openembedded-devel/2017-July/113782.html
+++++++++++
In case you need the workaround, for now do:
PREFERRED_PROVIDER_virtual/java-initial-native = &quot;cacao-initial-native&quot;
and build on a ubuntu (at a guess probably debian will work as well)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>