-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8287609: macOS: SIGSEGV at [CoreFoundation] CFArrayGetCount / sun.font.CFont.getTableBytesNative #8962
Conversation
👋 Welcome back YaaZ! A progress list of the required criteria for merging this PR into |
Where do you read it can return null ? https://developer.apple.com/documentation/coretext/1510774-ctfontcopyavailabletables?language=objc says nothing .. |
I didn't find anything in documentation too, but it does return null, I checked with a debugger |
All supported font formats on macOS have such tables, so it must be something else. |
It looks for a "maxp" table which is absent for this font. If you look down the stack, it's trying to find units per em and if we return NULL, then it just falls back to upem=1000 (libharfbuzz/hb-ot-head-table.hh:53):
And as I can see, nobody expects |
It looks for a "maxp" table which is absent for this font. Are you sure ? I know that is what we are looking for but we call an API to get all tables without And that is a REQUIRED table per opentype + apple truetype Of course getTableBytesNative isn't guaranteed to return a table because you could ask for the 'abcd' table .. |
Sorry for the confusion, "maxp" being absent was only my assumption: So this is a very old font and I couldn't even find a tool which could edit it or at least parse and see what's inside, CoreText API is not very helpful as well. But the thing is: we can actually render this font, problems begins when we try to do a full layout, so in my opinion, adding this null-check is okay, we're just not doing anything useful in our layout code instead of crashing :). And also if I'm not missing something, my change doesn't affect any behavior other that fixing the crash, look:
So it looks like there's really no behavior changed other than not crashing. In my tests text is properly rendered with |
oh my gosh .. it is a font designed for PRE-macOSX . meaning mac. so it is an ATM font with a resource fork and current macOS |
@YaaZ 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 66 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prrace) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@prrace could you sponsor this, please? And also I believe this should be backported, but I don't know what the process is, where can I read about it? |
/sponsor |
Going to push as commit 8c460b0.
Your commit was automatically rebased without conflicts. |
how do to backports is documented here : https://wiki.openjdk.java.net/display/SKARA/Backports |
Mailing list message from Justin Senseney on client-libs-dev: Please remove me from your database On Sat, Jun 4, 2022, 20:20 Nikita Gubarkov <duke at openjdk.java.net> wrote: |
Mailing list message from Justin Senseney on client-libs-dev: Please remove me from your mailing list On Sat, Jun 4, 2022, 20:12 Phil Race <prr at openjdk.java.net> wrote: |
Hi @prrace! Bot says I cannot use |
You can create a backport PR as regular one: create a branch in your fork of jdk18u, apply the changeset, commit and push the branch. Now create a PR with the title Backport |
CTFontCopyAvailableTables
can return null, which causes subsequent call toCFArrayGetCount
to crash with SEGFAULT, just added a null-check.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8962/head:pull/8962
$ git checkout pull/8962
Update a local copy of the PR:
$ git checkout pull/8962
$ git pull https://git.openjdk.java.net/jdk pull/8962/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8962
View PR using the GUI difftool:
$ git pr show -t 8962
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8962.diff