Skip to content

JDK-8276572: Fake libsyslookup.so library causes tooling issues#6245

Closed
gnu-andrew wants to merge 1 commit intoopenjdk:masterfrom
gnu-andrew:submit/JDK-8276572
Closed

JDK-8276572: Fake libsyslookup.so library causes tooling issues#6245
gnu-andrew wants to merge 1 commit intoopenjdk:masterfrom
gnu-andrew:submit/JDK-8276572

Conversation

@gnu-andrew
Copy link
Member

@gnu-andrew gnu-andrew commented Nov 4, 2021

The lack of anything to compile in syslookup.c is leading to a number of issues in our tooling, on some architectures more than others (s390x seems to be the most problematic). They expect to be able to retrieve debuginfo and compiler flags from generated .so files and fail with libsyslookup.so

This simple patch adds a dummy function to syslookup.c so it appears more like a regular file to be compiled. I can't see this causing a problem with the symbol lookup, but we could filter it out on the Java side if need be.


Progress

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

Issue

  • JDK-8276572: Fake libsyslookup.so library causes tooling issues

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6245

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 4, 2021

👋 Welcome back andrew! 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 Pull request is ready for review label Nov 4, 2021
@openjdk
Copy link

openjdk bot commented Nov 4, 2021

@gnu-andrew The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Nov 4, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 4, 2021

Webrevs

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

This makes sense to me, but @mcimadamore should ack this.

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Looks ok. As long as we don't introduce more dependencies.

One question: would introducing a static function (so, not visible in the resulting DLL) be good enough?

@openjdk
Copy link

openjdk bot commented Nov 4, 2021

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

8276572: Fake libsyslookup.so library causes tooling issues

Reviewed-by: shade, mcimadamore

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

  • 96c396b: 8276151: AArch64: Incorrect result for double to int vector conversion
  • 7281861: 8272065: jcmd cannot rely on the old core reflection implementation which will be changed after JEP 416
  • 8e17ce0: 8275185: Remove dead code and clean up jvmstat LocalVmManager
  • 396132f: 8275509: ModuleDescriptor.hashCode isn't reproducible across builds
  • 9ad4d3d: 8276025: Hotspot's libsvml.so may conflict with user dependency
  • e21b5c7: 8276650: GenGraphs does not produce deterministic output
  • 7b1916e: 8233557: [TESTBUG] DoubleClickTitleBarTest.java fails on macOs
  • 8ec80c4: 8276653: Missing row headers in j.l.Character docs
  • 7e87f94: 8276652: Missing row headers in MethodHandles.Lookup docs
  • dcf36f8: 8275670: ciReplay: java.lang.NoClassDefFoundError when trying to load java/lang/invoke/LambdaForm$MH
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/603bba282a089928fd23f8da23a7c1b2d52944ef...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 Pull request is ready to be integrated label Nov 4, 2021
@judovana
Copy link
Contributor

judovana commented Nov 4, 2021

Most likely bad idea, but isnt there an threat, that the method will be dropped by optimising compiler?

@mcimadamore
Copy link
Contributor

Most likely bad idea, but isnt there an threat, that the method will be dropped by optimising compiler?

It is a possibility that the function will be dropped, but maybe worth a try.

@gnu-andrew
Copy link
Member Author

Looks ok. As long as we don't introduce more dependencies.

One question: would introducing a static function (so, not visible in the resulting DLL) be good enough?

I did wonder about this too. I'll have to check it still resolves the issues we see before updating the PR.

@gnu-andrew
Copy link
Member Author

Ok, if it works, it's still going to be messy, as we have to disable this warning:

/home/andrew/projects/openjdk/upstream/jdk/src/jdk.incubator.foreign/share/native/libsyslookup/syslookup.c:31:14: error: 'syslookup' defined but not used [-Werror=unused-function]
 static char* syslookup() {
              ^~~~~~~~~

@shipilev
Copy link
Member

shipilev commented Nov 5, 2021

What do we have to lose if we have the non-static method in this library? I think it is less risky and intrusive than disabling warnings, making sure linkers are not removing the unused definiton, etc. IIRC, some toolchains (S390?) have linkers configured to strip unused symbols. Let's go with the PR in its current form.

@judovana
Copy link
Contributor

judovana commented Nov 5, 2021

Shouldn't the single volatile variable around prevent that?

@mcimadamore
Copy link
Contributor

mcimadamore commented Nov 5, 2021

For the records, I'm fine with proposed patch - I asked questions about possible alternatives. It seems like the alternatives work 50%, so let's go with proposed approach.

@gnu-andrew
Copy link
Member Author

Thanks. I agree the original feels safer and I'd rather avoid the ugly mess I needed with pragmas to get it to compile with an unused static function.

@gnu-andrew
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 5, 2021

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 5, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 5, 2021
@openjdk
Copy link

openjdk bot commented Nov 5, 2021

@gnu-andrew Pushed as commit a472433.

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

@gnu-andrew
Copy link
Member Author

/backport 17u

@openjdk
Copy link

openjdk bot commented Nov 5, 2021

@gnu-andrew Unknown command backport - for a list of valid commands use /help.

@gnu-andrew
Copy link
Member Author

/help

@openjdk
Copy link

openjdk bot commented Nov 5, 2021

@gnu-andrew Available commands:

  • covered - used when employer has signed the OCA
  • help - shows this text
  • signed - used after signing the OCA
  • test - used to run tests

@gnu-andrew
Copy link
Member Author

Ok, I see, it has to be issued on the commit... didn't realise you could comment on such things.

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

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants