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

8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars #249

Closed
wants to merge 8 commits into from

Conversation

@johanvos
Copy link
Collaborator

johanvos commented Jun 9, 2020

This addresses https://bugs.openjdk.java.net/browse/JDK-8246348


Progress

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

Issue

  • JDK-8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars

Reviewers

  • Phil Race (prr - Reviewer)
  • Kevin Rushforth (kcr - Reviewer)

Download

$ git fetch https://git.openjdk.java.net/jfx pull/249/head:pull/249
$ git checkout pull/249

johanvos added 2 commits Jun 9, 2020
A surrogate pair only counts for 1 character (and not for 2).
This fixes JDK-8246348
…parate

UTF 8 strings for each TextRun
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 9, 2020

👋 Welcome back jvos! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@johanvos johanvos changed the title [WIP] 8246348: Crash in libpango on ubuntu 20.04 [WIP] 8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars Jun 10, 2020
Add test that will fail on Ubuntu 20.04 if this PR is not applied.
The test is currently commented, as PGFont.getResource returns null
for fonts in testing.
@johanvos johanvos changed the title [WIP] 8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars 8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars Jun 10, 2020
@openjdk openjdk bot added the rfr label Jun 10, 2020
@mlbridge
Copy link

mlbridge bot commented Jun 10, 2020

@kevinrushforth
Copy link
Member

kevinrushforth commented Jun 10, 2020

/reviewers 2

@kevinrushforth kevinrushforth self-requested a review Jun 10, 2020
@openjdk
Copy link

openjdk bot commented Jun 10, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@prrace
Copy link
Collaborator

prrace commented Jun 11, 2020

Instead of a space you could use a ZWNJ U+FEFF. Because that is also the endian-ness
mark, Unicode actually prefers you now to use U+2060 but you need to make sure these
are processed correctly by pango. Unlike a space they should have no rendering effect - not even an advance.

check on 0 char not needed anymore
@kevinrushforth
Copy link
Member

kevinrushforth commented Jun 12, 2020

Once you address the question of storing a null value in the Map, the only remaining question I have is whether to use a LinkedHashMap instead of an ordinary HashMap. In general, I like the predictability of a LinkedHashMap for maps that are iterated, but in this case, I don't feel strongly about it one way or the other.

Only store the pointer to the utf8 string if its creation was successful
@kevinrushforth
Copy link
Member

kevinrushforth commented Jun 12, 2020

The fix looks good now.

As for the test, even if StubFont were updated to provide a real font, the StubToolkit doesn't load Prism (so none of the text rendering code is exercised). Do you think you could instead add a simple test or two in the system tests project instead (maybe one testing UTF16 chars and one with a 0 char)?

@prrace
prrace approved these changes Jun 12, 2020
@johanvos
Copy link
Collaborator Author

johanvos commented Jun 15, 2020

As for the test, even if StubFont were updated to provide a real font, the StubToolkit doesn't load Prism (so none of the text rendering code is exercised). Do you think you could instead add a simple test or two in the system tests project instead (maybe one testing UTF16 chars and one with a 0 char)?

I added a systemtest

Copy link
Member

kevinrushforth left a comment

The new test look good. I confirm that it fails without your patch and passes with your patch. I added a few suggestions to bring it in line with current best practices.

revert ignored test in :graphics
@openjdk openjdk bot removed the rfr label Jun 15, 2020
@openjdk openjdk bot added the rfr label Jun 15, 2020
Copy link
Member

kevinrushforth left a comment

Looks good.

@prrace
prrace approved these changes Jun 15, 2020
@openjdk
Copy link

openjdk bot commented Jun 15, 2020

@johanvos This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars

Reviewed-by: prr, kcr
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 18 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 automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate b2008913d7dbb3f38d006019a6e634f151496313.

➡️ 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 label Jun 15, 2020
@johanvos
Copy link
Collaborator Author

johanvos commented Jun 15, 2020

/integrate

@openjdk openjdk bot closed this Jun 15, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Jun 15, 2020
@openjdk
Copy link

openjdk bot commented Jun 15, 2020

@johanvos The following commits have been pushed to master since your change was applied:

  • b200891: 8244824: TableView : Incorrect German translation
  • b2b46eb: 8242892: SpinnerValueFactory has an implicit no-arg constructor
  • afa805f: 8245575: Show the ContextMenu of input controls with long press gesture on iOS
  • 5304266: 8245635: GlassPasteboard::getUTFs fails on iOS
  • ba501ef: 8246357: Allow static build of webkit library on linux
  • a02e09d: 8246195: ListViewSkin/Behavior: misbehavior on switching skin
  • 9749982: 8246204: No 3D support for newer Intel graphics drivers on Linux
  • 6bd0e22: 8239095: Upgrade libFFI to the latest 3.3 version
  • 853ac78: 8245282: Button/Combo Behavior: memory leak on dispose
  • a78b3fb: 8242523: Update the animation and clip envelope classes
  • 1ab653c: 8244657: ChoiceBox/ToolBarSkin: misbehavior on switching skin
  • 804ccce: 8244195: [TEST_BUG] Convert the system tests TabPanePermuteGetTabsTest to unit test
  • 9edba9c: 8243110: SVGTest.testSVGRenderingWithPattern fails intermittently
  • 168b7f7: 8246099: Intermittent test failures in SandboxAppTest
  • c41777e: 8245634: [TestBug] Enable and fix tests ignored with message "impl_cssSet API removed"
  • 3ceee69: 8245499: Text input controls should show handles on iOS
  • 8914bd2: 8234540: javafx.web LeakTest.testGarbageCollectability fails intermittently
  • 16f446a: 8234876: Unit test classes should not extend Application

Your commit was automatically rebased without conflicts.

Pushed as commit bf2e972.

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.