Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1795268 - [F32] java-1.8.0-openjdk FTBFS with GCC 10
Summary: [F32] java-1.8.0-openjdk FTBFS with GCC 10
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.8.0-openjdk
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Severin Gehwolf
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1799529 (view as bug list)
Depends On:
Blocks: F32FTBFS 1813550
TreeView+ depends on / blocked
 
Reported: 2020-01-27 15:19 UTC by Severin Gehwolf
Modified: 2020-07-20 16:57 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-20 16:57:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
hs_err file (deleted)
2020-01-27 15:29 UTC, Severin Gehwolf
no flags Details


Links
System ID Private Priority Status Summary Last Updated
openjdk bug system JDK-8233880 0 None None None 2020-05-08 13:31:09 UTC
openjdk bug system JDK-8244538 0 None None None 2020-05-06 17:07:21 UTC

Description Severin Gehwolf 2020-01-27 15:19:30 UTC
Since GCC 10 landed in rawhide java-1.8.0-openjdk fails to build from source:

https://koschei.fedoraproject.org/package/java-1.8.0-openjdk?collection=f32

Some failed tasks:
https://koji.fedoraproject.org/koji/taskinfo?taskID=40968346
https://koji.fedoraproject.org/koji/taskinfo?taskID=40799363

The GCC 10 change makes -fno-common default. See:
https://gcc.gnu.org/gcc-10/porting_to.html#common

So I've got some preliminary patches to get further:
https://src.fedoraproject.org/fork/jerboaa/rpms/java-1.8.0-openjdk/commits/gcc10_changes

But then bootcycle build fails early on with a SEGV:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fbef5e8a976, pid=4128314, tid=0x00007fbe0df79700
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b06) (build 1.8.0_242-ea-b06)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b06 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x8d7976]  Node::Node(unsigned int)+0x26
#
# Core dump written. Default location: /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/langtools/make/core or core.4128314
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
---------------  T H R E A D  ---------------
Current thread (0x00007fbef0158000):  JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=4128353, stack(0x00007fbe0de7a000,0x00007fbe0df7a000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000170
Registers:
RAX=0x00007fbef63314e0, RBX=0x00007fbdfc019910, RCX=0x0000000000000018, RDX=0x0000000000000000
RSP=0x00007fbe0df77520, RBP=0x00007fbe0df77570, RSI=0x0000000000000003, RDI=0x00007fbdfc019910
R8 =0x00007ffe8d722090, R9 =0x00007fbe0df77578, R10=0x0000000000000001, R11=0x000000000010b216
R12=0x0000000000000003, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x00007fbe0df782b0
RIP=0x00007fbef5e8a976, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007fbe0df77520)
0x00007fbe0df77520:   00007fbe0df77540 00007ffe8d725918
0x00007fbe0df77530:   00007fbe0df77570 00007fbef6156c16
0x00007fbe0df77540:   0000000000000001 00007fbdfc019910
0x00007fbe0df77550:   00007fbe0df78110 00007fbef6156c16
0x00007fbe0df77560:   0000000000000000 00007fbe0df782b0
0x00007fbe0df77570:   00007fbe0df775b0 00007fbef5a42b56
0x00007fbe0df77580:   00007fbef6156c16 0000000200000000
0x00007fbe0df77590:   00007fbe0df78200 00007fbef6156c16
0x00007fbe0df775a0:   00007fbe0df78110 00007fbe0df78380
0x00007fbe0df775b0:   00007fbe0df780a0 00007fbef5a48dc8
0x00007fbe0df775c0:   0000000000000000 0000000000000001
0x00007fbe0df775d0:   00007fbef5f50a70 00007fbef5f4e570
0x00007fbe0df775e0:   0000000000000000 00007fbe0df78110
0x00007fbe0df775f0:   0000000000000000 0000000000000000
0x00007fbe0df77600:   0000000000000000 0000000000000000
0x00007fbe0df77610:   0000000000000000 0000000000000000
0x00007fbe0df77620:   0000000000000000 0000000000000000
0x00007fbe0df77630:   0000000000000000 0000000000000000
0x00007fbe0df77640:   0000000000000000 0000000000000000
0x00007fbe0df77650:   0000000000000000 0000000000000000
0x00007fbe0df77660:   0000000000000000 0000000000000000
0x00007fbe0df77670:   0000000000000000 0000000000000000
0x00007fbe0df77680:   0000000000000000 0000000000000000
0x00007fbe0df77690:   0000000000000000 0000000000000000
0x00007fbe0df776a0:   0000000000000000 0000000000000000
0x00007fbe0df776b0:   0000000000000000 0000000000000000
0x00007fbe0df776c0:   0000000000000000 0000000000000000
0x00007fbe0df776d0:   0000000000000000 0000000000000000
0x00007fbe0df776e0:   0000000000000000 0000000000000000
0x00007fbe0df776f0:   0000000000000000 0000000000000000
0x00007fbe0df77700:   0000000000000000 0000000000000000
0x00007fbe0df77710:   0000000000000000 0000000000000000 
Instructions: (pc=0x00007fbef5e8a976)
0x00007fbef5e8a956:   89 e5 41 57 41 56 41 55 41 54 41 89 f4 53 48 89
0x00007fbef5e8a966:   fb 48 83 ec 28 4c 8b 6f 10 48 8d 05 6a 6b 4a 00
0x00007fbef5e8a976:   45 8b b5 70 01 00 00 48 83 c0 10 48 89 07 41 8d
0x00007fbef5e8a986:   46 01 41 89 85 70 01 00 00 85 f6 0f 8f b1 00 00 
Register to memory mapping:
RAX=0x00007fbef63314e0: <offset 0xd7e4e0> in /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/build/jdk8.build/images/j2sdk-image/jre/lib/amd64/server/libjvm.so at 0x00007fbef55b3000
RBX=0x00007fbdfc019910 is an unknown value
RCX=0x0000000000000018 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x00007fbe0df77520 is pointing into the stack for thread: 0x00007fbef0158000
RBP=0x00007fbe0df77570 is pointing into the stack for thread: 0x00007fbef0158000
RSI=0x0000000000000003 is an unknown value
RDI=0x00007fbdfc019910 is an unknown value
R8 =0x00007ffe8d722090 is an unknown value
R9 =0x00007fbe0df77578 is pointing into the stack for thread: 0x00007fbef0158000
R10=0x0000000000000001 is an unknown value
R11=0x000000000010b216 is an unknown value
R12=0x0000000000000003 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x00007fbe0df782b0 is pointing into the stack for thread: 0x00007fbef0158000
Stack: [0x00007fbe0de7a000,0x00007fbe0df7a000],  sp=0x00007fbe0df77520,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x8d7976]  Node::Node(unsigned int)+0x26
V  [libjvm.so+0x48fb56]  Compile::Init(int)+0xb6
V  [libjvm.so+0x495dc8]  Compile::Compile(ciEnv*, TypeFunc const* (*)(), unsigned char*, char const*, int, bool, bool, bool)+0x518
V  [libjvm.so+0x99be80]  OptoRuntime::generate_stub(ciEnv*, TypeFunc const* (*)(), unsigned char*, char const*, int, bool, bool, bool)+0xe0
V  [libjvm.so+0x99c070]  OptoRuntime::generate(ciEnv*)+0x40
V  [libjvm.so+0x3f0535]  C2Compiler::initialize()+0xe5
V  [libjvm.so+0x49cae3]  CompileBroker::init_compiler_runtime()+0x1b3
V  [libjvm.so+0x4a3d58]  CompileBroker::compiler_thread_loop()+0x118
V  [libjvm.so+0xac14a8]  JavaThread::thread_main_inner()+0x1f8
V  [libjvm.so+0x9061b0]  java_start(Thread*)+0x150
C  [libpthread.so.0+0x9432]  start_thread+0xe2

Comment 1 Severin Gehwolf 2020-01-27 15:27:10 UTC
'java -version' on a just compiled JDK seems sufficient to reproduce:


<mock-chroot> sh-5.0# ./build/jdk8.build/images/j2sdk-image/bin/java -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f178f9a3976, pid=21, tid=0x00007f1771386700
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b06) (build 1.8.0_242-ea-b06)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b06 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x8d7976][thread 139738657339136 also had an error]
openjdk version "1.8.0_242-ea"
OpenJDK Runtime Environment (build 1.8.0_242-ea-b06)
OpenJDK 64-Bit Server VM (build 25.242-b06, mixed mode)
  Node::Node(unsigned int)+0x26
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/hs_err_pid21.log

[error occurred during error reporting , id 0xb]

#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

Comment 2 Severin Gehwolf 2020-01-27 15:29:17 UTC
Created attachment 1655704 [details]
hs_err file

Comment 3 Andrew John Hughes 2020-01-28 06:56:30 UTC
Similar issues on java-11-openjdk: https://koji.fedoraproject.org/koji/taskinfo?taskID=41003490

Not sure why you have a patch confusingly named with the bug ID of a Shenandoah S390 fix, but the relevant fix is https://bugs.openjdk.java.net/browse/JDK-8224851 which I already have backported to 11u.

Comment 4 Severin Gehwolf 2020-01-28 12:51:55 UTC
(In reply to Andrew John Hughes from comment #3)
> Similar issues on java-11-openjdk:
> https://koji.fedoraproject.org/koji/taskinfo?taskID=41003490

Not quite the same. See my PR for getting it moving again (except the s390x issue which I don't know what's causing it yet):
https://src.fedoraproject.org/rpms/java-11-openjdk/pull-request/65

> Not sure why you have a patch confusingly named with the bug ID of a
> Shenandoah S390 fix, but the relevant fix is
> https://bugs.openjdk.java.net/browse/JDK-8224851 which I already have
> backported to 11u.

Just an oversight. Thanks for noticing it. Are you planning on proposing the backport for 11.0.7 upstream?

Comment 5 Andrew John Hughes 2020-01-28 16:41:53 UTC
(In reply to Severin Gehwolf from comment #4)
> (In reply to Andrew John Hughes from comment #3)
> > Similar issues on java-11-openjdk:
> > https://koji.fedoraproject.org/koji/taskinfo?taskID=41003490
> 
> Not quite the same. See my PR for getting it moving again (except the s390x
> issue which I don't know what's causing it yet):
> https://src.fedoraproject.org/rpms/java-11-openjdk/pull-request/65
> 

Yeah, I was thinking of the aarch64 issue being the same. I didn't get to trying java-1.8.0-openjdk with that patched just yet, and didn't realise you were looking at this too. I couldn't make head nor tail of the java-11-openjdk failure once the aarch64 fix was patched (the build logs for it are awful), so good to hear that -fcommon helps it makes progress.

Incidentally, if you're going to include the +10 changes from f31 in this PR, can you please restore my changelog entry to go with it? Or, alternatively, I can add your change to the version I have waiting.

> > Not sure why you have a patch confusingly named with the bug ID of a
> > Shenandoah S390 fix, but the relevant fix is
> > https://bugs.openjdk.java.net/browse/JDK-8224851 which I already have
> > backported to 11u.
> 
> Just an oversight. Thanks for noticing it. Are you planning on proposing the
> backport for 11.0.7 upstream?

No problem. I just thought it's odd when I copied the bug ID to lookup your bug and ended up at my s390 fix :) Thankfully, the correct one was in the comment above.

And yes, sorry, I should have been clearer. I mentioned it so we wouldn't both end up proposing it. I'll do that today. I already have it locally, I just need to do the whole webrev and e-mail dance with it.

Comment 6 Severin Gehwolf 2020-02-07 10:58:31 UTC
*** Bug 1799529 has been marked as a duplicate of this bug. ***

Comment 7 Ben Cotton 2020-02-11 16:38:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 8 Severin Gehwolf 2020-02-12 15:45:09 UTC
A fastdebug build asserts with -Xint:

<mock-chroot> sh-5.0# ./build/jdk8.build/images/j2sdk-image/bin/java -Xint -version
openjdk version "1.8.0_242-ea-fastdebug"
OpenJDK Runtime Environment (build 1.8.0_242-ea-fastdebug-b06)
OpenJDK 64-Bit Server VM (build 25.242-b06-fastdebug, interpreted mode)
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/genOopClosures.hpp:202
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/hotspot/src/share/vm/memory/genOopClosures.hpp:202), pid=59, tid=0x00007fd84f8f8700
#  guarantee(obj->is_oop_or_null()) failed: invalid oop: 0x0000000000000000
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b06) (build 1.8.0_242-ea-fastdebug-b06)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b06-fastdebug interpreted mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/hs_err_pid59.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 140567024469760
Dumping core ...
Aborted (core dumped)

The same with -Xcomp (or no flag):
<mock-chroot> sh-5.0# ./build/jdk8.build/images/j2sdk-image/bin/java -Xcomp -version
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/node.cpp:301
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/hotspot/src/share/vm/opto/node.cpp:301), pid=75, tid=0x00007f4ae3859700
#  assert(Compile::current() == C) failed: must use operator new(Compile*)
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b06) (build 1.8.0_242-ea-fastdebug-b06)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b06-fastdebug compiled mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.242.b06-0.0.ea.fc32.x86_64/openjdk/hs_err_pid75.log
[thread 139959618332416 also had an error]

[error occurred during error reporting , id 0xb]

#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 139959621490432
Dumping core ...
Aborted (core dumped)

Comment 9 Severin Gehwolf 2020-02-13 18:05:47 UTC
Some progress here. It seems another case of some UB in hotspot. The best I could come up
with so far is a list of flags which makes the build pass:

-fno-tree-pta -fno-tree-scev-cprop -fno-tree-sink -fno-tree-slp-vectorize -fno-tree-slsr -fno-tree-sra
-fno-tree-switch-conversion -fno-tree-tail-merge -fno-tree-ter -fno-tree-vrp -fno-unit-at-a-time
-fno-unswitch-loops -fno-vect-cost-model -fno-version-loops-for-strides -fno-tree-coalesce-vars
-fno-tree-copy-prop -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-forwprop -fno-tree-fre
-fno-tree-loop-distribute-patterns -fno-tree-loop-distribution -fno-tree-loop-vectorize
-fno-tree-partial-pre -fno-tree-phiprop -fno-tree-pre

It's a long list which could likely get narrowed down further. Anyway, this will help me narrow down
where things go wrong and hopefully find the OpenJDK patches to backport so that we can build without
those flags.

https://src.fedoraproject.org/fork/jerboaa/rpms/java-1.8.0-openjdk/commits/gcc10_changes

This tree --^ has the changes. A scratch build with that is currently running (it passed on
3 architectures at least):
https://koji.fedoraproject.org/koji/taskinfo?taskID=41481433

Comment 10 Severin Gehwolf 2020-03-04 19:49:36 UTC
I've opened a PR with the GCC flags added as work-around.
This is so that we are unblocked for the upcoming release:
https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/pull-request/99

Comment 11 Andrew John Hughes 2020-03-19 00:50:13 UTC
Build with the workaround flags is now in F32: https://koji.fedoraproject.org/koji/buildinfo?buildID=1477017

Comment 12 Severin Gehwolf 2020-05-08 13:31:09 UTC
As soon as a backport of JDK-8233880 is in OpenJDK 8u proper, we can get rid of this ugly work-around.

Comment 13 Severin Gehwolf 2020-07-20 16:57:05 UTC
This will be released in 8u262 with:
https://bodhi.fedoraproject.org/updates/FEDORA-2020-e418151dc3


Note You need to log in before you can comment on or make changes to this bug.