Skip to content

8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free#30811

Closed
prrace wants to merge 1 commit intoopenjdk:masterfrom
prrace:ffm_free
Closed

8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free#30811
prrace wants to merge 1 commit intoopenjdk:masterfrom
prrace:ffm_free

Conversation

@prrace
Copy link
Copy Markdown
Contributor

@prrace prrace commented Apr 18, 2026

We need to use FFM to locate free() because we use malloc() as located by FFM.
If these two don't match, then it can cause problems and confusion.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Warning

 ⚠️ Found leading lowercase letter in issue title for 8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free

Issue

  • JDK-8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30811/head:pull/30811
$ git checkout pull/30811

Update a local copy of the PR:
$ git checkout pull/30811
$ git pull https://git.openjdk.org/jdk.git pull/30811/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30811

View PR using the GUI difftool:
$ git pr show -t 30811

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30811.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Apr 18, 2026

👋 Welcome back prr! 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
Copy Markdown

openjdk Bot commented Apr 18, 2026

@prrace 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:

8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free

Reviewed-by: kizune, azvegint, jdv

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 152 new 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 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 changed the title 8378603 8378603: libfontmanager FFM path needs to use FFM to locate both malloc and free Apr 18, 2026
@openjdk openjdk Bot added the client client-libs-dev@openjdk.org label Apr 18, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 18, 2026

@prrace The following label will be automatically applied to this pull request:

  • client

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
Copy link
Copy Markdown

openjdk Bot commented Apr 18, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: client. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Apr 18, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Apr 18, 2026

Webrevs

@mrserb
Copy link
Copy Markdown
Member

mrserb commented Apr 21, 2026

I wonder why this is not considered ffm bug. Since free/malloc/ and other methods used via ffm bindings use different functions than the same jni libraries, it is unclear why LD_PRELOAD does not affect ffm?

@prrace
Copy link
Copy Markdown
Contributor Author

prrace commented Apr 21, 2026

I wonder why this is not considered ffm bug. Since free/malloc/ and other methods used via ffm bindings use different functions than the same jni libraries, it is unclear why LD_PRELOAD does not affect ffm?

This was already raised with FFM devs. It is behaving as designed. Docs on Linker were referenced to support this.

I think it is this text.

"In addition, a linker provides a way to look up foreign functions in libraries that conform to the ABI. Each linker chooses a set of libraries that are commonly used on the OS and processor combination associated with the ABI. For example, a linker for Linux/x64 might choose two libraries: libc and libm. The functions in these libraries are exposed via a symbol lookup."

Hence this PR.

@prrace
Copy link
Copy Markdown
Contributor Author

prrace commented Apr 21, 2026

@jayathirthrao @prsadhuk please review

Copy link
Copy Markdown
Member

@azuev-java azuev-java left a comment

Choose a reason for hiding this comment

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

Looks good.

@mrserb
Copy link
Copy Markdown
Member

mrserb commented Apr 22, 2026

"In addition, a linker provides a way to look up foreign functions in libraries that conform to the ABI. Each linker chooses a set of libraries that are commonly used on the OS and processor combination associated with the ABI. For example, a linker for Linux/x64 might choose two libraries: libc and libm. The functions in these libraries are exposed via a symbol lookup."

Is there any public information about that discussion? From the description above it is unclear why LD_PRELOAD is not supported it sounds like a regression. For such bugs we will always need to check the whole third party libraries that uses malloc/free/calloc/etc and make sure it is not mixed with similar methods loaded by FFM?

@prrace
Copy link
Copy Markdown
Contributor Author

prrace commented Apr 22, 2026

"In addition, a linker provides a way to look up foreign functions in libraries that conform to the ABI. Each linker chooses a set of libraries that are commonly used on the OS and processor combination associated with the ABI. For example, a linker for Linux/x64 might choose two libraries: libc and libm. The functions in these libraries are exposed via a symbol lookup."

Is there any public information about that discussion? From the description above it is unclear why LD_PRELOAD is not supported it sounds like a regression. For such bugs we will always need to check the whole third party libraries that uses malloc/free/calloc/etc and make sure it is not mixed with similar methods loaded by FFM?

It was an internal discussion, but nonetheless the outcome is the same and the FFM team have no plans to make changes.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Apr 24, 2026
@prrace
Copy link
Copy Markdown
Contributor Author

prrace commented Apr 27, 2026

/integrate

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 27, 2026

Going to push as commit 704efcb.
Since your change was applied there have been 161 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Apr 27, 2026
@openjdk openjdk Bot closed this Apr 27, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 27, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 27, 2026

@prrace Pushed as commit 704efcb.

💡 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

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants