Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269923: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java failed with "FATAL ERROR in native method: Primitive type array expected but not received for JNI array operation" #4696

Closed
wants to merge 3 commits into from

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Jul 6, 2021

On Posix compatible platforms, when abort with code dump, it exits with os:abort(), which has exit code 134.

  if (dump_core) {
    LINUX_ONLY(if (DumpPrivateMappingsInCore) ClassLoader::close_jrt_image();)
    ::abort(); // dump core
  }

but not on Windows, where it still exits with 1.

  CloseHandle(dumpFile);
  win32::exit_process_or_thread(win32::EPT_PROCESS, 1);

The test expects exit code 134 when jni check fails, so it fails on Windows. Maybe we should have Windows also to return 134 for consistence?

The fix changes the check to non-zero exit code.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269923: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java failed with "FATAL ERROR in native method: Primitive type array expected but not received for JNI array operation"

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4696/head:pull/4696
$ git checkout pull/4696

Update a local copy of the PR:
$ git checkout pull/4696
$ git pull https://git.openjdk.java.net/jdk pull/4696/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4696

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4696.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 6, 2021

👋 Welcome back zgu! 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 openjdk bot added the rfr label Jul 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 6, 2021

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

  • hotspot-runtime

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-runtime label Jul 6, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 6, 2021

Webrevs

Copy link
Member

@dcubed-ojdk dcubed-ojdk left a comment

Thumbs up.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 6, 2021

@zhengyu123 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:

8269923: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java failed with "FATAL ERROR in native method: Primitive type array expected but not received for JNI array operation"

Reviewed-by: dcubed, dholmes

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 12 new commits pushed to the master branch:

  • 01c29d8: 8266407: remove jdk.internal.javac.PreviewFeature.Feature.SEALED_CLASSES
  • 7a4f08a: Merge
  • 0d1cd3a: 8269825: [TESTBUG] Missing testing for x86 KNL platforms
  • e0c130f: 8269955: ProblemList compiler/vectorapi/VectorCastShape[64|128]Test.java tests on x86
  • 1166ef2: 8268966: AArch64: 'bad AD file' in some vector conversion tests
  • 3a69024: 8225667: Clarify the behavior of System::gc w.r.t. reference processing
  • 2b20778: 8269568: JVM crashes when running VectorMask query tests
  • 0f4e07b: 8269661: JNI_GetStringCritical does not lock char array
  • df1364b: 8269575: C2: assert(false) failed: graph should be schedulable after JDK-8252372
  • 6d8fc72: 8268883: C2: assert(false) failed: unscheduable graph
  • ... and 2 more: https://git.openjdk.java.net/jdk/compare/4dfcf53a8bf2ca8717e418b1cbd66ba263b77980...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 added the ready label Jul 6, 2021
@dcubed-ojdk
Copy link
Member

@dcubed-ojdk dcubed-ojdk commented Jul 6, 2021

@zhengyu123 - I forgot to ask about what testing has been done?

Copy link
Member

@dholmes-ora dholmes-ora left a comment

The fix is good.

The 134 exit code on Posix systems comes from the fact that abort() raises SIGABRT, which is signal number 6 (b0110) . The exit code of the process is set by the OS in the lower 8 bits of the return value: bits 0-6 contains the signal number; bit 7 is set if a core dump occurs. So we have an exit value of b10000110 == decimal 134.

It is debatable whether we should make Windows behave the same for our os::abort.

Thanks,
David

@zhengyu123
Copy link
Contributor Author

@zhengyu123 zhengyu123 commented Jul 7, 2021

@dcubed-ojdk @dholmes-ora Thanks for the reviews. GHA all clean.

@zhengyu123
Copy link
Contributor Author

@zhengyu123 zhengyu123 commented Jul 7, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jul 7, 2021

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

  • 77a5b7b: 8269761: idea.sh missing .exe suffix when invoking javac on WSL
  • 248aa50: 8269294: Verify_before/after_young_collection should execute all verification
  • 18b80c7: 8269908: Move MemoryService::track_memory_usage call into G1MonitoringScope
  • a685011: 8269022: Put evacuation failure string directly into gc=info log message
  • 72530ef: 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events
  • 3d090e7: 8267625: AARCH64: typo in LIR_Assembler::emit_profile_type
  • a9e2010: 8268425: Show decimal nid of OSThread instead of hex format one
  • 01c29d8: 8266407: remove jdk.internal.javac.PreviewFeature.Feature.SEALED_CLASSES
  • 7a4f08a: Merge
  • 0d1cd3a: 8269825: [TESTBUG] Missing testing for x86 KNL platforms
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/4dfcf53a8bf2ca8717e418b1cbd66ba263b77980...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 7, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 7, 2021

@zhengyu123 Pushed as commit bffb1a7.

💡 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-runtime integrated
3 participants