Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074072

Race condition in build since JDK-8072842 can cause failed builds on Solaris

XMLWordPrintable

    • b54

        A race condition, possibly leading to a failed build on Solaris, was introduced with JDK-8072842.

        The two Solaris helper script fix_empty_sec_hdr_flags and add_gnu_debuglink are built several times, in the same location.

        If we are unlucky then thread A does:
          A1: compile add_gnu_link.c
          A2: link add_gnu_link
        and thread B does:
          B1: compile add_gnu_link.c
        after A1 but before A2, so that when linking is about to start, the .o file has been truncated, and then linking will fail.

        A typical error message looks like this:
        Main.gmk:264: recipe for target 'build-test-hotspot-jtreg-native' failed
        ld: fatal: file /opt/jprt/T/P1/002839.magnusi/s/build/solaris-sparcv9-normal-server-release/buildtools/objs/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.o: not an ELF object
        ld: fatal: file processing errors. No output written to /opt/jprt/T/P1/002839.magnusi/s/build/solaris-sparcv9-normal-server-release/buildtools/bin/fix_empty_sec_hdr_flags
        gmake[3]: *** [/opt/jprt/T/P1/002839.magnusi/s/build/solaris-sparcv9-normal-server-release/buildtools/bin/fix_empty_sec_hdr_flags] Error 2

        The proper long-term solution is to fix JDK-8064808. However, since this causes a build break, a quicker and less risky fix is to let build-test-*-jtreg-native depend on buildtools-jdk.

              erikj Erik Joelsson
              ihse Magnus Ihse Bursie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: