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

8331298: avoid alignment checks in UBSAN enabled build #18998

Closed
wants to merge 1 commit into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Apr 29, 2024

Currently we run into some alignment related issues when building with '--enable-ubsan' . Those errors already occur in the build. Fixing them might take some time and maybe also some discussion if it is worth the effort ,
So for now the alignment related checks should be disabled to get the UBSAN build working.
Example :

/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:128:13: runtime error: store to misaligned address 0x15099c3cf4ce for type 'int', which requires 4 byte alignment
0x15099c3cf4ce: note: pointer points here
00 80 0f 86 00 00 00 00 3d 06 00 00 80 76 60 3d 07 00 00 80 76 40 3d 08 00 00 80 76 20 3d 1e 00
^
#0 0x1509b3b04f10 in MacroAssembler::pd_patch_instruction(unsigned char*, unsigned char*, char const*, int) /jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:128
#1 0x1509b3b04f10 in Label::patch_instructions(MacroAssembler*) /jdk/src/hotspot/share/asm/assembler.cpp:201
#2 0x1509b940b6d8 in VM_Version_StubGenerator::generate_get_cpu_info() /jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:381
#3 0x1509b94059bd in VM_Version::initialize() /jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:2138
#4 0x1509b93fb56e in VM_Version_init() /jdk/src/hotspot/share/runtime/vm_version.cpp:32
#5 0x1509b61ef947 in init_globals() /jdk/src/hotspot/share/runtime/init.cpp:126
#6 0x1509b8fb0e29 in Threads::create_vm(JavaVMInitArgs*, bool*) /jdk/src/hotspot/share/runtime/threads.cpp:553
#7 0x1509b67da3d7 in JNI_CreateJavaVM_inner /jdk/src/hotspot/share/prims/jni.cpp:3581
#8 0x1509b67da3d7 in JNI_CreateJavaVM /jdk/src/hotspot/share/prims/jni.cpp:3672
#9 0x1509c0eed957 in InitializeJVM /jdk/src/java.base/share/native/libjli/java.c:1550
#10 0x1509c0eed957 in JavaMain /jdk/src/java.base/share/native/libjli/java.c:491
... (rest of output omitted)


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-8331298: avoid alignment checks in UBSAN enabled build (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18998

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 29, 2024

👋 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 Apr 29, 2024

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

8331298: avoid alignment checks in UBSAN enabled build

Reviewed-by: erikj, mdoerr

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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-8331298: avoid alignment checks in UBSAN enabled build 8331298: avoid alignment checks in UBSAN enabled build Apr 29, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 29, 2024
@openjdk
Copy link

openjdk bot commented Apr 29, 2024

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

  • build

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 build build-dev@openjdk.org label Apr 29, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 29, 2024

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 29, 2024
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.

I wish we could fix all UB, but that seems unrealistic for the time being. LGTM.

@MBaesken
Copy link
Member Author

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented Apr 30, 2024

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

  • b128bd7: 8331021: Deprecate and then obsolete the DontYieldALot flag
  • 819f3d6: 8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier
  • eb88343: 8331164: createJMHBundle.sh download jars fail when url needed to be redirected
  • 9b423a8: 8330253: Remove verify_consistent_lock_order
  • 4e42294: 8329004: Update Libpng to 1.6.43
  • bdcc240: 8331087: Move immutable nmethod data from CodeCache
  • 8b8fb64: 8324776: runtime/os/TestTransparentHugePageUsage.java fails with The usage of THP is not enough

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 30, 2024

@MBaesken Pushed as commit 60b61e5.

💡 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
build build-dev@openjdk.org integrated Pull request has been integrated
3 participants