-
Notifications
You must be signed in to change notification settings - Fork 460
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
8296654: [macos] Crash when launching JavaFX app with JDK that targets SDK 13 #981
8296654: [macos] Crash when launching JavaFX app with JDK that targets SDK 13 #981
Conversation
👋 Welcome back kcr! A progress list of the required criteria for merging this PR into |
@aghaisas Can you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a x86_64 Mac system. I was unable to simulate the crash using the smart way
described in JDK-8297131. I wonder whether the bug is aarch64 only?
I see that all the occurrences of self->trackingRect
in the codebase have null check now.
Approving as it looks the obvious fix.
@kevinrushforth 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:
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 ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't reproduce a crash either, but the proposed changes look good.
If this were Java code, I would be more cautious as a NullPointer could be catched and lead to different behavior. However, in this ObjectiveC code there is no reasonable flow that would keep working with null references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce the crash on an M1 Mac, and the proposed change fixes the problem.
Thanks for the additional reviews. Btw, I was able to reproduce the crash on a Mac x64 system running Ventura, and this fixes it there as well. |
/integrate |
Going to push as commit 5b96d34. |
@kevinrushforth Pushed as commit 5b96d34. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Apple has changed the behavior for applications that are built using the macOS SDK 13 (which is what XCode 14 uses), such that passing in a null tracking rect to
NSView::removeTrackingRect
will cause now cause a crash. This has exposed a latent bug in the JavaFX macOS glass code that removes the previous tracking rect even if it is null insetFrame
,setFrameSize
, andupdateTrackingAreas
.The fix is to check that the current tracking rect is non null before calling
removeTrackingRect
as suggested in both this bug report and duplicate bug JDK-8297131. The latter bug report describes an easy way to reproduce this without building your own JDK, by making a copy of the JDK and modifying the meta-data that indicates the target version of the macOS SDK. I did that, and can reproduce this crash with any JavaFX program without this fix, and verified that it works correctly with this fix.NOTE: it is the version of the SDK (Xcode) that the JDK is targeted to that matters. It is irrelevant what version of the SDK (i.e., what Xcode) is used to build JavaFX. This make this a more serious bug than it otherwise would be.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/981/head:pull/981
$ git checkout pull/981
Update a local copy of the PR:
$ git checkout pull/981
$ git pull https://git.openjdk.org/jfx pull/981/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 981
View PR using the GUI difftool:
$ git pr show -t 981
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/981.diff