<?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>13825</bug_id>
          
          <creation_ts>2020-03-06 08:45:59 +0000</creation_ts>
          <short_desc>bison-native build race</short_desc>
          <delta_ts>2020-07-09 20:27:10 +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>3.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</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>3.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Adrian Bunk">bunk</assigned_to>
          <cc>bunk</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mingli.yu</cc>
    
    <cc>raj.khem</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>86675</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-03-06 08:45:59 +0000</bug_when>
    <thetext>There appears to be a build race in bison-native:

https://autobuilder.yoctoproject.org/typhoon/#/builders/92/builds/2205

Log is truncated but what we have:

| AnnotationList.c:(.text+0x7ad): undefined reference to `rpl_fprintf&apos;
| src/bison-AnnotationList.o:AnnotationList.c:(.text+0x7fa): more undefined references to `rpl_fprintf&apos; follow
| collect2: error: ld returned 1 exit status
| Makefile:3905: recipe for target &apos;src/bison&apos; failed
| make: *** [src/bison] Error 1
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of &apos;/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/temp/run.do_compile.7351&apos; failed with exit code 1:
| gcc    -isystem/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/usr/include -O2 -pipe  -L/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/usr/lib                         -L/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/work/x86_64-linux/bison-native/3.5.2-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/pokybuild/build-perf-test/build-901d68d-20200305174828/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -o src/bison src/bison-AnnotationList.o src/bison-InadequacyList.o src/bison-Sbitset.o src/bison-assoc.o src/bison-closure.o src/bison-complain.o src/bison-conflicts.o src/bison-derives.o src/bison-files.o src/bison-fixits.o src/bison-getargs.o src/bison-gram.o src/bison-graphviz.o src/bison-ielr.o src/bison-lalr.o src/bison-location.o src/bison-lr0.o src/bison-main.o src/bison-muscle-tab.o src/bison-named-ref.o src/bison-nullable.o src/bison-output.o src/bison-parse-gram.o src/bison-print-graph.o src/bison-print-xml.o src/bison-print.o src/bison-reader.o src/bison-reduce.o src/bison-relation.o src/bison-scan-code-c.o src/bison-scan-gram-c.o src/bison-scan-skel-c.o src/bison-state.o src/bison-symlist.o src/bison-symtab.o src/bison-tables.o src/bison-uniqstr.o           lib/libbison.a
| src/bison-AnnotationList.o: In function `AnnotationList__debug&apos;:
| AnnotationList.c:(.text+0x658): undefined reference to `rpl_fprintf&apos;
| AnnotationList.c:(.text+0x704): undefined reference to `rpl_fprintf&apos;
| AnnotationList.c:(.text+0x736): undefined reference to `rpl_fprintf&apos;
| AnnotationList.c:(.text+0x786): undefined reference to `rpl_fprintf&apos;
| AnnotationList.c:(.text+0x7ad): undefined reference to `rpl_fprintf&apos;
| src/bison-AnnotationList.o:AnnotationList.c:(.text+0x7fa): more undefined references to `rpl_fprintf&apos; follow
| collect2: error: ld returned 1 exit status
| Makefile:3905: recipe for target &apos;src/bison&apos; failed
| make: *** [src/bison] Error 1
| WARNING: exit code 1 from a shell command.
| 
NOTE: recipe bison-native-3.5.2-r0: task do_compile: Failed
ERROR: Task (virtual:native:/home/pokybuild/yocto-worker/buildperf-ubuntu1604/build/meta/recipes-devtools/bison/bison_3.5.2.bb:do_compile) failed with exit code &apos;1&apos;

rerunning the build passed. Once it failed it was persistent in the build that failed so files appear corrupted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86684</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2020-03-08 11:03:05 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; | AnnotationList.c:(.text+0x658): undefined reference to `rpl_fprintf&apos;

rpl_fprintf is the gnulib replacement from the fprintf-posix module.

&gt; rerunning the build passed. Once it failed it was persistent in the build
&gt; that failed so files appear corrupted.

Is this re-using configure results from a build host running a kernel with a different set of security features enabled?

The fprintf-posix replacement is used for me on Ubuntu 18.04 due to:
...
checking whether snprintf fully supports the &apos;n&apos; directive... no
...
configure:14698: ./conftest
*** %n in writable segment detected ***
../bison-3.5.2/configure: line 3041: 31456 Aborted                 
...

Workaround for bison-native:
  EXTRA_OECONF += &quot;gl_cv_func_printf_directive_n=yes&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86685</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2020-03-08 18:50:07 +0000</bug_when>
    <thetext>Two updates on that:
1. The relevant difference is not in the kernel, it is whether the host gcc defaults to _FORTIFY_SOURCE=2 (like in recent Ubuntu releases).
2. Correct would be EXTRA_OECONF += &quot;gl_cv_func_printf_directive_n=no&quot;, bison is supposed to use the gnulib replacement functions on glibc systems with _FORTIFY_SOURCE &gt; 0. Always adding -U_FORTIFY_SOURCE when building with the host gcc might be an alternative (untested).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86689</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-03-10 21:29:44 +0000</bug_when>
    <thetext>Thanks Adrian, that is really helpful and hints what kind of issue we&apos;re looking for.

It was on our Ubuntu build performance worker. What puzzles me a bit is those are sstate isolated and would always build from scratch so why would this happen in one build but not any others? :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86728</commentid>
    <comment_count>4</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2020-03-16 23:55:08 +0000</bug_when>
    <thetext>Richard, does setting gl_cv_func_printf_directive_n=no solves the race ?

on debian10/archlinux it gets gl_cv_func_printf_directive_n=yes but ubuntu 16/18/20 all get it set to &apos;no&apos;, I think to disable it explicitly will solve this problem perhaps at some added performance cost of using gnulib emulation wrapper.

another way to look is to add CPPFLAGS += &quot;-Drpl_fprintf=fprintf&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86783</commentid>
    <comment_count>5</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2020-03-24 01:41:23 +0000</bug_when>
    <thetext>As a race issue, is there any hints how to reproduce the issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87739</commentid>
    <comment_count>6</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2020-07-09 20:27:10 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=d4a0cbf132cf6a821e3efe7db3d9afd014cc9bc6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>