Skip to content
Snippets Groups Projects

community/openjdk9: unify patches and fix build with gcc10

Merged Simon F requested to merge bratkartoffel/aports:openjdk9/unify-patches into master

This MR fixes the build with gcc10, unifies the openjdk patches, adding header comments and using constants instead of magic numbers on ppc64le patch.

Edited by Simon F

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Simon F marked as a Work In Progress

    marked as a Work In Progress

  • Simon F added 36 commits

    added 36 commits

    Compare with previous version

  • Simon F added 1 commit

    added 1 commit

    • ada70270 - community/openjdk9: unify patches

    Compare with previous version

  • Simon F added 1 commit

    added 1 commit

    • 04e2447e - community/openjdk9: unify patches

    Compare with previous version

  • Simon F changed title from WIP: community/openjdk9: unify patches to WIP: community/openjdk9: unify patches and fix build with gcc10

    changed title from WIP: community/openjdk9: unify patches to WIP: community/openjdk9: unify patches and fix build with gcc10

  • Simon F changed the description

    changed the description

  • Simon F added 1 commit

    added 1 commit

    • 7d280cfc - community/openjdk9: unify patches

    Compare with previous version

  • Simon F added 331 commits

    added 331 commits

    Compare with previous version

  • Simon F added 69 commits

    added 69 commits

    Compare with previous version

  • Simon F added 7 commits

    added 7 commits

    Compare with previous version

  • Simon F added 1 commit

    added 1 commit

    • 031c8cf9 - community/openjdk9: unify patches

    Compare with previous version

  • Simon F mentioned in issue #12144 (closed)

    mentioned in issue #12144 (closed)

  • Author Reporter

    Build fails due to a segfault when running the compiled java executable. gdb prints:

    (gdb) bt
    #0  memcpy () at src/string/x86_64/memcpy.s:18
    #1  0x00007ffff731159b in memcpy (__n=72, __os=0x0, __od=<optimized out>) at /usr/include/fortify/string.h:53
    #2  Copy::pd_disjoint_words (count=9, to=<optimized out>, from=0x0) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp:86
    #3  Copy::pd_disjoint_words (count=9, to=<optimized out>, from=0x0) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp:73
    #4  Copy::disjoint_words (count=9, to=<optimized out>, from=0x0) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/utilities/copy.hpp:98
    #5  BitMap::set_from (this=this@entry=0x7fffd998de50, other=...) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/utilities/bitMap.cpp:548
    #6  0x00007ffff73a1b5f in LinearScan::compute_global_live_sets (this=this@entry=0x7fffd974b710) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_LinearScan.cpp:764
    #7  0x00007ffff73b1622 in LinearScan::do_linear_scan (this=this@entry=0x7fffd974b710) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_LinearScan.cpp:3076
    #8  0x00007ffff73312df in Compilation::emit_lir (this=this@entry=0x7fffd998e310) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compilation.cpp:270
    #9  0x00007ffff7332490 in Compilation::compile_java_method (this=this@entry=0x7fffd998e310) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compilation.cpp:398
    #10 0x00007ffff7332791 in Compilation::compile_method (this=0x7fffd998e310) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compilation.cpp:460
    #11 Compilation::compile_method (this=0x7fffd998e310) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compilation.cpp:429
    #12 0x00007ffff7332c0a in Compilation::Compilation (this=0x7fffd998e310, compiler=<optimized out>, env=<optimized out>, method=0x7fffd9862ab0, osr_bci=<optimized out>, buffer_blob=<optimized out>, directive=0x7fffda965950)
        at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compilation.cpp:573
    #13 0x00007ffff73333f0 in Compiler::compile_method (this=0x7fffda966640, env=0x7fffd998e6f0, method=0x7fffd9862ab0, entry_bci=-1, directive=0x7fffda965950)
        at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/c1/c1_Compiler.cpp:248
    #14 0x00007ffff749b6c8 in CompileBroker::invoke_compiler_on_method (task=task@entry=0x7ffff6d82db0) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/compiler/compileBroker.cpp:1881
    #15 0x00007ffff749c420 in CompileBroker::compiler_thread_loop () at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/compiler/compileBroker.cpp:1618
    #16 0x00007ffff7ae6e33 in JavaThread::thread_main_inner (this=0x7fffd9dbe800) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/share/vm/runtime/thread.hpp:1088
    #17 0x00007ffff797b8e0 in thread_native_entry (thread=0x7fffd9dbe800) at /home/build/aports/community/openjdk9/src/jdk9u-jdk-9.0.4+12/hotspot/src/os/linux/vm/os_linux.cpp:684
    #18 0x00007ffff7fb9df6 in start (p=0x7fffd998eac8) at src/thread/pthread_create.c:203
    #19 0x00007ffff7fbbfb5 in __clone () at src/thread/x86_64/clone.s:22

    Frame 5 is the following code:

    void BitMap::set_from(const BitMap& other) {
      assert(size() == other.size(), "must have same size");
      bm_word_t* dest_map = map();
      const bm_word_t* other_map = other.map();
      idx_t copy_words = word_index(size());
      Copy::disjoint_words((HeapWord*)other_map, (HeapWord*)dest_map, copy_words);
      idx_t rest = bit_in_word(size());
      if (rest > 0) {
        dest_map[copy_words] = merge_tail_of_map(other_map[copy_words],
                                                 dest_map[copy_words],
                                                 rest);
      }
    }

    The method it tries to compile is the java/lang/StringLatin1#hashCode. Replay log shows these last lines:

    ...
    ciInstanceKlass java/lang/NullPointerException 1 1 26 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1
    ciInstanceKlass java/lang/ArithmeticException 1 1 26 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1
    ciInstanceKlass java/lang/StringLatin1 1 1 270 7 10 100 10 10 10 10 10 10 10 10 10 10 9 10 10 10 10 10 10 10 100 10 10 10 8 8 8 10 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 7 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 12 12 100 12 12 100 12 7 12 12 12 100 12 12 12 12 12 12 12 12 1 12 12 1 1 1 12 100 12 12 1 12 12 12 12 12 12 12 12 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    ciMethod java/lang/StringLatin1 hashCode ([B)I 849 16713 106 0 -1
    ciMethodData java/lang/StringLatin1 hashCode ([B)I 1 2089 orig 312 248 148 163 82 229 127 0 0 64 169 223 52 229 127 0 0 160 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 8 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 248 3 0 0 248 31 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 56 0 0 0 254 255 255 255 7 0 13 0 0 0 0 0 data 14 0xd0007 0x0 0x38 0x0 0x250003 0x0 0xffffffffffffffe0 0x0 0x0 0x0 0x0 0x9 0x1 0x0 oops 0 methods 0
    compile java/lang/StringLatin1 hashCode ([B)I -1 3

    // Edit: When disabling C1, startup works:

    $> java -XX:-TieredCompilation -version
    openjdk version "9.0.4"
    OpenJDK Runtime Environment (build 9.0.4+12-alpine-r3)
    OpenJDK 64-Bit Server VM (build 9.0.4+12-alpine-r3, mixed mode)

    // Edit 2: Note to myself: check https://bugs.openjdk.java.net/browse/JDK-8245051 (found via https://bugs.openjdk.java.net/browse/JDK-8256118?jql=labels%20%3D%20c1%20AND%20affectedVersion%20%3D%20%2211%22%20ORDER%20BY%20created%20DESC )

    Have to investigate further and maybe ask oracle for help with this. @fabled do you have any clue what could be wrong here? The build started to fail with gcc10, applying the patches on 3.12 works fine.

    Edited by Simon F
  • Simon F added 1 commit

    added 1 commit

    • 8ea444ac - community/openjdk9: unify patches

    Compare with previous version

  • Simon F added 1 commit

    added 1 commit

    • 036ad86e - community/openjdk9: unify patches

    Compare with previous version

  • Author Reporter

    Finally, the patch for JDK-8245051 did the trick, the compilation works for x86_64 now. Looking at the other archs now.

  • Simon F added 1 commit

    added 1 commit

    • f1d7177b - community/openjdk9: unify patches

    Compare with previous version

  • Simon F added 379 commits

    added 379 commits

    Compare with previous version

  • Simon F unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Milan P. Stanić added 9 commits

    added 9 commits

    Compare with previous version

Please register or sign in to reply
Loading