Skip to content

8360478: libjsig related tier3 jtreg tests fail when asan is configured#25978

Closed
MBaesken wants to merge 3 commits intoopenjdk:masterfrom
MBaesken:JDK-8360478
Closed

8360478: libjsig related tier3 jtreg tests fail when asan is configured#25978
MBaesken wants to merge 3 commits intoopenjdk:masterfrom
MBaesken:JDK-8360478

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Jun 25, 2025

There are a number of :tier3 HS jtreg tests using libjsig. Unfortunately they clash with asan, so it should be avoided to run them if asan is configured.

Examples :
runtime/signal/TestSigalrm.java
runtime/signal/TestSigbus.java

They run into errors like this

 stdout: [];
 stderr: [==59482==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

One option would be to avoid running those tests when asan is enabled.
Another option is to avoid the so called 'link order check' .
https://github.com/google/sanitizers/wiki/addresssanitizerflags

verify_asan_link_order - Check position of ASan runtime in library list (needs to be disabled when other library has to be preloaded system-wide)


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

Warning

 ⚠️ Found leading lowercase letter in issue title for 8360478: libjsig related tier3 jtreg tests fail when asan is configured

Issue

  • JDK-8360478: libjsig related tier3 jtreg tests fail when asan is configured (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25978

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 25, 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 Jun 25, 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:

8360478: libjsig related tier3 jtreg tests fail when asan is configured

Reviewed-by: dholmes, ihse

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

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-8360478: libjsig related tier3 jtreg tests fail when asan is configured 8360478: libjsig related tier3 jtreg tests fail when asan is configured Jun 25, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 25, 2025
@openjdk
Copy link

openjdk bot commented Jun 25, 2025

@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 Jun 25, 2025
@MBaesken
Copy link
Member Author

With this change, all HS :tier3 jtreg tests pass on my Linux ppc64le test machine .

@mlbridge
Copy link

mlbridge bot commented Jun 25, 2025

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

If this fixes the problem then it seems fine. I don't know why ASAN cares about the library order or the implications thereof.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 26, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jun 26, 2025
@MBaesken
Copy link
Member Author

Could maybe someone with MSVC give it a try? My MSVC installation does not like ASAN (in theory it should work there).

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

@magicus magicus left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

@magicus
Copy link
Member

magicus commented Jun 27, 2025

I don't know why ASAN cares about the library order or the implications thereof.

My understanding is that it wants to be injected first, and if you do LD_PRELOAD then another library might interfere with asan, and thus they want to warn for that.

@MBaesken
Copy link
Member Author

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented Jun 27, 2025

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 27, 2025

@MBaesken Pushed as commit a23de2e.

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

@tstuefe
Copy link
Member

tstuefe commented Jul 24, 2025

Saw this too late. I am unsure about this change, because it disables a rather necessary warning. ASAN interposes a number of APIs, e.g. malloc/free. Bad things can happen if that interposition does not cover the full JVM process.

E.g. you preload library1, which comes before ASAN interposition is in place, so it uses libc malloc. You then load ASAN, then the rest of JVM. Anything loaded after ASAN will route through ASAN's version of malloc/free. So different parts of the process could use different versions of malloc/free. That could be trouble since we don't know whether pointers returned from raw libc malloc are compatible with ASAN's version of free, and vice versa. Even if nothing like that happens, it would quietly disable ASAN for a part of the libjvm, e.g. in case of libjsig for the libjsig.

Unless we fully understand what would happen in these cases, I would not switch off these warning for the full process. Rather just switch off tests on ASAN builds that rely on LD_PRELOAD. We don't have that many (should only be libjsig, no?)

This is just my 5 cents. I think ASAN is really useful, and the bugs @MBaesken already found proves that.

@MBaesken
Copy link
Member Author

We could also flag the tests with @requires "!vm.asan" , that would be less intrusive but needs to be done per test .

Probably in practise both approaches work, for production we do not use ASAN anyways.

@tstuefe
Copy link
Member

tstuefe commented Jul 24, 2025

We could also flag the tests with @requires "!vm.asan" , that would be less intrusive but needs to be done per test .

I'd be totally fine with that

Probably in practise both approaches work, for production we do not use ASAN anyways.

Certainly.

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

Development

Successfully merging this pull request may close these issues.

5 participants