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

8252412: [macos11] system dynamic libraries removed from filesystem #2119

Closed
wants to merge 1 commit into from

Conversation

Martin-Buchholz
Copy link
Member

@Martin-Buchholz Martin-Buchholz commented Jan 17, 2021


Progress

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

Issue

  • JDK-8252412: [macos11] system dynamic libraries removed from filesystem

Reviewers

Contributors

  • Dominik Röttsches <drott@google.com>

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2119/head:pull/2119
$ git checkout pull/2119

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 17, 2021

👋 Welcome back martin! 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 Jan 17, 2021

@Martin-Buchholz 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 core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review labels Jan 17, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 17, 2021

Webrevs

@Martin-Buchholz Martin-Buchholz changed the title 8252412: [macos11] File-based loading of dynamic libraries deprecated 8252412: [macos11] system dynamic libraries removed from filesystem Jan 18, 2021
@drott
Copy link
Contributor

drott commented Jan 18, 2021

Hi @drott, thanks for making a comment in an OpenJDK project!

All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user drott for the summary.

If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.

Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.

@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 18, 2021

/contributor Dominik Röttsches drott@google.com

@openjdk
Copy link

openjdk bot commented Jan 18, 2021

@Martin-Buchholz Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 18, 2021

/contributor Dominik Röttsches drott@google.com

@openjdk
Copy link

openjdk bot commented Jan 18, 2021

@Martin-Buchholz Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 18, 2021

/contributor add Dominik Röttsches drott@google.com

@openjdk
Copy link

openjdk bot commented Jan 18, 2021

@Martin-Buchholz
Contributor Dominik Röttsches <drott@google.com> successfully added.

lib = PCSC_FRAMEWORK;
if (new File(lib).isFile()) {
if (new File(lib).getParentFile().isDirectory()) {
Copy link
Contributor

@jianglizhou jianglizhou Jan 22, 2021

Choose a reason for hiding this comment

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

This is outside of my normal area, could you please explain why checking the existence of the containing directory is equivalent to checking the file here? Does it provide the expected behavior on all unix-like platforms or only macos?

Could you please also provide a jtreg test for this change?

Copy link
Member Author

@Martin-Buchholz Martin-Buchholz Jan 22, 2021

Choose a reason for hiding this comment

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

The directory structure is intact - only the file is removed from the filesystem.
More generally, for many frameworks, where there used to be

/System/Library/Frameworks//.framework/Versions/Current/

the file is gone, but

/System/Library/Frameworks//.framework/Versions/Current/

remains.

I don't think we need a jtreg test, since any functionality associated with PCSC is broken on this platform. I added label noreg-other

Copy link
Contributor

@jianglizhou jianglizhou Jan 22, 2021

Choose a reason for hiding this comment

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

Ok, I see Java_sun_security_smartcardio_PlatformPCSC_initialize does dlopen using the 'jLibName' (string) obtained from getLibraryName() and throws IOException if dlopen fails. The change seems safe enough.

I'm wondering if you want to check the file first then check the parent directory if the file does not exist. Not sure if that's a little more optimal on older macos, so I'll leave that to you to decide.

For the jtreg test, how about converting Dominik's TestPCSC? As the file is a shared for 'unix' platforms, it feels safer at least with some level of unit test. Could you please give some more contexts about the functionalities associated with PCSC are broken on macos?

Copy link
Contributor

@jianglizhou jianglizhou Jan 22, 2021

Choose a reason for hiding this comment

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

Martin and I had an off-line chat and Martin convinced me that the existing jtreg tests (such as test/jdk/javax/smartcardio and test/jdk/sun/security/smartcardio are sufficient) to cover the case.

Choose a reason for hiding this comment

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

Right, existing tests should cover this already since running the test requires that the library must be loaded.
Changes look fine, thanks for fixing this.
Kind of surprised the existing filtering didn't catch this as security-related changes and send this to security group for review.

@mlbridge
Copy link

mlbridge bot commented Jan 22, 2021

Mailing list message from Martin Buchholz on core-libs-dev:

My github comment was mangled forwarding to core-libs. I suspect the skara
bidirectional mailing list forwarding bot discards lines with leading "/"
.

Instead the bot should pass on unrecognized github comment commands
unmodified.

On Fri, Jan 22, 2021 at 12:12 PM Martin Buchholz <martin at openjdk.java.net>
wrote:

@openjdk
Copy link

openjdk bot commented Jan 22, 2021

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

8252412: [macos11] system dynamic libraries removed from filesystem

Co-authored-by: Dominik Röttsches <drott@google.com>
Reviewed-by: jiangli, valeriep

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

  • 5cdcce1: 8260307: Do not include method.hpp in frame.hpp
  • 6f2a394: Merge
  • 685c03d: 8259271: gc/parallel/TestDynShrinkHeap.java still fails "assert(covered_region.contains(new_memregion)) failed: new region is not in covered_region"
  • d90e06a: 8259775: [Vector API] Incorrect code-gen for VectorReinterpret operation
  • ede1bea: 8227695: assert(pss->trim_ticks().seconds() == 0.0) failed: Unexpected partial trimming during evacuation
  • 62eab50: 8255199: Catching a few NumberFormatExceptions in xmldsig
  • a5367cb: 8247619: Improve Direct Buffering of Characters
  • aa57d07: 8259214: MetaspaceClosure support for Arrays of MetaspaceObj
  • bdc305e: 8258917: NativeMemoryTracking is handled by launcher inconsistenly
  • 7be9113: 8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile()
  • ... and 221 more: https://git.openjdk.java.net/jdk/compare/e7c174083a3df8711568fadf77ad513c7a582443...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 Jan 22, 2021
@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 23, 2021

Last call for a reviewer familiar with macos or smartcardio. In case of crickets I will submit soon.

lib = PCSC_FRAMEWORK;
if (new File(lib).isFile()) {
if (new File(lib).getParentFile().isDirectory()) {

Choose a reason for hiding this comment

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

Right, existing tests should cover this already since running the test requires that the library must be loaded.
Changes look fine, thanks for fixing this.
Kind of surprised the existing filtering didn't catch this as security-related changes and send this to security group for review.

@AlanBateman
Copy link
Contributor

AlanBateman commented Jan 23, 2021

/label add security
/label remove core-libs

@openjdk openjdk bot added the security security-dev@openjdk.org label Jan 23, 2021
@openjdk
Copy link

openjdk bot commented Jan 23, 2021

@AlanBateman
The security label was successfully added.

@openjdk openjdk bot removed the core-libs core-libs-dev@openjdk.org label Jan 23, 2021
@openjdk
Copy link

openjdk bot commented Jan 23, 2021

@AlanBateman
The core-libs label was successfully removed.

@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 27, 2021

@drott @valeriepeng @AlanBateman @jianglizhou Thanks all !

@Martin-Buchholz
Copy link
Member Author

Martin-Buchholz commented Jan 27, 2021

/integrate

@openjdk openjdk bot closed this Jan 27, 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 Jan 27, 2021
@openjdk
Copy link

openjdk bot commented Jan 27, 2021

@Martin-Buchholz Since your change was applied there have been 272 commits pushed to the master branch:

  • e1411fd: 6606673: Path2D.Double, Path2D.Float and GeneralPath ctors throw exception when initialCapacity is negative
  • 6f2be9c: 8246112: Remove build-time and run-time checks for clock_gettime and CLOCK_MONOTONIC
  • 19b6f61: 8260334: Remove deprecated sv_for_node_id() from Compile
  • 1bebd41: 8260421: Shenandoah: Fix conc_mark_roots timing name and indentations
  • 42cef27: 8260343: Delete obsolete classes in the Windows L&F
  • 9f0a043: 8260286: Manual Test "ws/open/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java" fails
  • fd00ed7: 8256298: Shenandoah: Enable concurrent stack processing
  • b07797c: 8260391: Remove StringCoding::err
  • af8a08f: 8260378: [TESTBUG] DcmdMBeanTestCheckJni.java reports false positive
  • 8d2f77f: 8260406: Do not copy pure java source code to gensrc
  • ... and 262 more: https://git.openjdk.java.net/jdk/compare/e7c174083a3df8711568fadf77ad513c7a582443...master

Your commit was automatically rebased without conflicts.

Pushed as commit c836da3.

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