-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8330936: [ubsan] exclude function BilinearInterp and ShapeSINextSpan in libawt java2d from ubsan checks #23255
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
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
@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:
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 508 new commits pushed to the
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 |
The change looks ok and trivial. However I find nothing about an investigation what would need to be changed to eliminate the UB warning in code. |
I moved the ubsan 'exclusion' to a subissue and opened parent issue https://bugs.openjdk.org/browse/JDK-8348966 for the 2 overflows . |
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.
LGTM now with the updated bug synopsis. But somebody from client-libs has to give their blessings as well.
how it is possible to repro these warnings? |
Configure with '--enable-ubsan' added (on Linux; ubsan package needs to be installed on your distro). After the build, run the mentioned jtreg tests (java/awt/Scrollbar/AquaLFScrollbarTest/ScrollBarBorderTest.java and java/awt/BasicStroke/DashStrokeTest.java, if you run jtreg jdk :tier4 there might be a few other tests showing the issues too). |
Any more comments on this ? If not I would integrate it soon. |
Hi @mrserb any comments? Are you fine with the change ? |
I looked at the native code, and it seems to me that overflow is actually by design, when working with fractional pixel positions and color components. The mechanism being used to silence the warnings might be palatable in very small quantities, but I sincerely hope it is not the start of a pattern. If it is, then something less intrusive to the source code would be better. |
I agree, the findings have to be checked and not always this leads to a source change. |
/integrate |
Going to push as commit 40f150d.
Your commit was automatically rebased without conflicts. |
In java2d coding there are a few overflows (those are shown when running jtreg tests with ubsan enabled binaries)
jtreg test java/awt/Scrollbar/AquaLFScrollbarTest/ScrollBarBorderTest.java shows
jdk/src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c:683:16: runtime error: signed integer overflow: 1651910497 + 660764199 cannot be represented in type 'int'
#0 0x7efe59e6ece8 in BilinearInterp src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c:683
#1 0x7efe59e75e21 in Java_sun_java2d_loops_TransformHelper_Transform src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c:499
#2 0x7efe9b8dee7b ()
java/awt/BasicStroke/DashStrokeTest.java shows
src/java.desktop/share/native/libawt/java2d/pipe/ShapeSpanIterator.c:1366:21: runtime error: signed integer overflow: 1282539 + 2118518271 cannot be represented in type 'int'
#0 0x7fb97d7daf21 in ShapeSINextSpan src/java.desktop/share/native/libawt/java2d/pipe/ShapeSpanIterator.c:1366
#1 0x7fb97d62fa7e in AnyIntSetSpans src/java.desktop/share/native/libawt/java2d/loops/AnyInt.c:75
#2 0x7fb97d6a8816 in Java_sun_java2d_loops_FillSpans_FillSpans src/java.desktop/share/native/libawt/java2d/loops/FillSpans.c:92
#3 0x7fba12d07e7b ()
There is currently no need seen to adjust this coding, so exclude the methods from ubsan checking to avoid unneeded warnings.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23255/head:pull/23255
$ git checkout pull/23255
Update a local copy of the PR:
$ git checkout pull/23255
$ git pull https://git.openjdk.org/jdk.git pull/23255/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23255
View PR using the GUI difftool:
$ git pr show -t 23255
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23255.diff
Using Webrev
Link to Webrev Comment