Skip to content

8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms#23794

Closed
MBaesken wants to merge 1 commit intoopenjdk:masterfrom
MBaesken:JDK-8350683
Closed

8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms#23794
MBaesken wants to merge 1 commit intoopenjdk:masterfrom
MBaesken:JDK-8350683

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Feb 26, 2025

When building a JVM without C2 (e.g. minimal) on ppc64 platforms , it crashes in the build because of unwanted dependencies to C2.
AIX crash is (linux ppc64le crash is similar) :

# Internal Error (compiledIC_ppc.cpp:141), pid=17695018, tid=258
# Error: ShouldNotReachHere()
#
 
iar: 0x0900000008800c60 libjvm.so::AixNativeCallstack::print_callstack_for_context(outputStream*, ucontext_t const*, bool, char*, unsigned long)+0x4bc (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:5 parmsonstk:1)
lr: 0x09000000087ea9b8 libjvm.so::fdStream::write(char const*, unsigned long)+0x44 (C++ uses_alloca saves_lr stores_bc gpr_saved:4 fixedparms:3 parmsonstk:1)
sp: 0x000000011023aab0 (base - 0x2DD8)
rtoc: 0x08001000a0088ff0
|---stackaddr----| |----lrsave------|: <function name>
0x000000011023aea0 - 0x0900000008800730 libjvm.so::os::Aix::platform_print_native_stack(outputStream*, void const*, char*, int, unsigned char*&)+0x24 (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:5 parmsonstk:1)
0x000000011023af20 - 0x0900000008800644 libjvm.so::NativeStackPrinter::print_stack(outputStream*, char*, int, unsigned char*&, bool, int)+0x60 (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:6 fixedparms:7 parmsonstk:1)
0x000000011023afc0 - 0x09000000087f6ff8 libjvm.so::VMError::report(outputStream*, bool)+0x11f0 (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:13 fixedparms:2 parmsonstk:1)
0x000000011023b830 - 0x09000000087e9fdc libjvm.so::VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x6a0 (C++ uses_alloca saves_lr stores_bc gpr_saved:18 fixedparms:8 parmsonstk:1)
0x000000011023ba10 - 0x09000000087e96a0 libjvm.so::report_vm_error(char const*, int, char const*, char const*, ...)+0xa0 (C++ uses_alloca saves_lr stores_bc gpr_saved:5 fixedparms:4 parmsonstk:1)
0x000000011023bad0 - 0x09000000087e95cc libjvm.so::report_vm_error(char const*, int, char const*)+0x24 (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:3 parmsonstk:1)
0x000000011023bb50 - 0x09000000087e956c libjvm.so::report_should_not_reach_here(char const*, int)+0x20 (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:2 parmsonstk:1)
0x000000011023bbd0 - 0x0900000008906e5c libjvm.so::CompiledDirectCall::emit_to_interp_stub(MacroAssembler*, unsigned char*)+0x28 (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:2 parmsonstk:1)
0x000000011023bc50 - 0x0900000008902848 libjvm.so::SharedRuntime::generate_native_wrapper(MacroAssembler*, methodHandle const&, int, BasicType*, VMRegPair*, BasicType)+0x380 (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:6 parmsonstk:1)
0x000000011023c000 - 0x0900000008901f7c libjvm.so::AdapterHandlerLibrary::create_native_wrapper(methodHandle const&)+0x464 (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:1 parmsonstk:1)
0x000000011023c5d0 - 0x09000000088f0d78 libjvm.so::Method::link_method(methodHandle const&, JavaThread*)+0x17c (C++ uses_alloca saves_lr stores_bc gpr_saved:5 fixedparms:3 parmsonstk:1)
0x000000011023c670 - 0x09000000088f0ab8 libjvm.so::InstanceKlass::link_methods(JavaThread*)+0xcc (C++ uses_alloca saves_lr stores_bc gpr_saved:10 fixedparms:2 parmsonstk:1)
0x000000011023c760 - 0x09000000088d5e48 libjvm.so::InstanceKlass::link_class_impl(JavaThread*)+0x38c (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:10 fixedparms:2 parmsonstk:1)
0x000000011023c8f0 - 0x09000000088d4de8 libjvm.so::InstanceKlass::initialize_impl(JavaThread*)+0x94 (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:14 fixedparms:2 parmsonstk:1)
0x000000011023cae0 - 0x09000000088d4cf4 libjvm.so::InstanceKlass::initialize(JavaThread*)+0x60 (C++ uses_alloca saves_lr stores_bc gpr_saved:3 fixedparms:2 parmsonstk:1)
0x000000011023cb70 - 0x0900000008c40ea0 libjvm.so::initialize_class(Symbol*, JavaThread*)+0x64 (C++ uses_alloca saves_lr stores_bc gpr_saved:2 fixedparms:2 parmsonstk:1)
0x000000011023cc00 - 0x0900000008c35384 libjvm.so::Threads::create_vm(JavaVMInitArgs*, bool*)+0x6ec (C++ uses_alloca saves_lr stores_bc gpr_saved:8 fixedparms:2 parmsonstk:1)
0x000000011023d540 - 0x0900000008c5a91c libjvm.so::JNI_CreateJavaVM+0xa4 (C++ uses_alloca saves_lr stores_bc gpr_saved:8 fixedparms:3 parmsonstk:1)
0x000000011023d640 - 0x00000001000100f4 javac::JavaMain+0x148 (C++ saves_lr stores_bc gpr_saved:11 fixedparms:1 parmsonstk:1)
0x000000011023d730 - 0x000000010000ff74 javac::ThreadJavaMain+0x10 (C++ saves_lr stores_bc fixedparms:1 parmsonstk:1)
0x000000011023d7a0 - 0x090000000056204c libpthreads.a::_pthread_body+0xec (C saves_lr stores_bc gpr_saved:1 fixedparms:1 )
0x000000011023d820 - 0x0000000000000000

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms (Bug - P4)

Reviewers

Contributors

  • Martin Doerr <mdoerr@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23794/head:pull/23794
$ git checkout pull/23794

Update a local copy of the PR:
$ git checkout pull/23794
$ git pull https://git.openjdk.org/jdk.git pull/23794/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23794

View PR using the GUI difftool:
$ git pr show -t 23794

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23794.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 26, 2025

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 26, 2025

@MBaesken This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms

Co-authored-by: Martin Doerr <mdoerr@openjdk.org>
Reviewed-by: mdoerr, amitkumar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 35 new commits pushed to the master branch:

  • ab4b0ef: 8350889: GenShen: Break out of infinite loop of old GC cycles
  • 0a4c5a8: 8347804: GenShen: Crash with small GCCardSizeInBytes and small Java heap
  • f1398ec: 8350701: [JMH] test foreign.AllocFromSliceTest failed with Exception for size>1024
  • 3ae80bf: 8349766: GenShen: Bad progress after degen does not always need full gc
  • 2fd7156: 8347426: Invalid value used for enum Cell in iTypeFlow::StateVector::meet_exception
  • 939815f: 8347040: C2: assert(!loop->_body.contains(in)) failed
  • 8323ddf: 8346659: SnippetTaglet should report an error if provided ambiguous links
  • 3c9d64e: 8350858: [IR Framework] Some tests failed on Cascade Lake
  • d6d9447: 8350786: Some java/lang jtreg tests miss requires vm.hasJFR
  • e80b76b: 8276995: Bug in jdk.jfr.event.gc.collection.TestSystemGC
  • ... and 25 more: https://git.openjdk.org/jdk/compare/f529bf712d8946584999dfc98abea60c22c97167...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title JDK-8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms 8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms Feb 26, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 26, 2025
@openjdk
Copy link

openjdk bot commented Feb 26, 2025

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Feb 26, 2025
@MBaesken
Copy link
Member Author

/contributor add mdoerr

@openjdk
Copy link

openjdk bot commented Feb 26, 2025

@MBaesken
Contributor Martin Doerr <mdoerr@openjdk.org> successfully added.

@mlbridge
Copy link

mlbridge bot commented Feb 26, 2025

Webrevs

@MBaesken
Copy link
Member Author

MBaesken commented Feb 26, 2025

Hi @offamitkumar , s390x might have the same problem we face on ppc64, see here

https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/s390/compiledIC_s390.cpp#L58

Maybe you want to check this. On ppc64, the previously C2-only coding in CompiledDirectCall::emit_to_interp_stub was needed for non-C2 JVMs like minimal JVM (where only C1 is present).

@offamitkumar
Copy link
Member

Hi Matthias,

You mentioned that the crash happened during the build ? I just checked and at least the build is fine on s390x.

This is what I am using for configuration:

bash configure \
	--with-boot-jdk=$HOME/jjboot_jdk_23 \
	--with-jtreg=$HOME/jtreg \
	--with-gtest=$HOME/googletest \
	--with-jmh=build/jmh/jars \
	--with-debug-level=fastdebug \
         --with-jvm-variants=minimal \
	--with-native-debug-symbols=internal \
	--disable-precompiled-headers

@MBaesken
Copy link
Member Author

You mentioned that the crash happened during the build ? I just checked and at least the build is fine on s390x.

Yes during the minimal build ( --with-jvm-features=minimal --with-jvm-variants=minimal ).
Seems you miss --with-jvm-features=minimal .

@offamitkumar
Copy link
Member

Ok I ran another build with this configuration and still build was successful :

bash configure \
	--with-boot-jdk=$HOME/boot_jdk_23 \
	--with-jtreg=$HOME/jtreg \
	--with-gtest=$HOME/googletest \
	--with-jmh=build/jmh/jars \
  --with-jvm-variants=minimal \
  --with-jvm-features=minimal \
	--with-debug-level=fastdebug \
	--with-native-debug-symbols=internal \
	--disable-precompiled-headers

@MBaesken
Copy link
Member Author

Hi @offamitkumar this is a bit surprising because the matcher header is only included if COMPILER2 is defined
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/s390/compiledIC_s390.cpp#L32
and this should not be the case in minimal JVM , but if this somehow works on your side, then fine :-) !

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing it!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 27, 2025
@offamitkumar
Copy link
Member

Hi @offamitkumar this is a bit surprising because the matcher header is only included if COMPILER2 is defined https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/s390/compiledIC_s390.cpp#L32 and this should not be the case in minimal JVM , but if this somehow works on your side, then fine :-) !

I have finished tier1 on minimal build, will see if this issue gets reproduced by any of the tests.

Copy link
Member

@offamitkumar offamitkumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good.

@MBaesken
Copy link
Member Author

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented Feb 28, 2025

Going to push as commit 2af76de.
Since your change was applied there have been 35 commits pushed to the master branch:

  • ab4b0ef: 8350889: GenShen: Break out of infinite loop of old GC cycles
  • 0a4c5a8: 8347804: GenShen: Crash with small GCCardSizeInBytes and small Java heap
  • f1398ec: 8350701: [JMH] test foreign.AllocFromSliceTest failed with Exception for size>1024
  • 3ae80bf: 8349766: GenShen: Bad progress after degen does not always need full gc
  • 2fd7156: 8347426: Invalid value used for enum Cell in iTypeFlow::StateVector::meet_exception
  • 939815f: 8347040: C2: assert(!loop->_body.contains(in)) failed
  • 8323ddf: 8346659: SnippetTaglet should report an error if provided ambiguous links
  • 3c9d64e: 8350858: [IR Framework] Some tests failed on Cascade Lake
  • d6d9447: 8350786: Some java/lang jtreg tests miss requires vm.hasJFR
  • e80b76b: 8276995: Bug in jdk.jfr.event.gc.collection.TestSystemGC
  • ... and 25 more: https://git.openjdk.org/jdk/compare/f529bf712d8946584999dfc98abea60c22c97167...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 28, 2025
@openjdk openjdk bot closed this Feb 28, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 28, 2025
@openjdk
Copy link

openjdk bot commented Feb 28, 2025

@MBaesken Pushed as commit 2af76de.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants