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

Rename arenaAlloc to fix collision with GHC RTS #992

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

Baltoli
Copy link
Contributor

@Baltoli Baltoli commented Feb 22, 2024

This fixes a rather unpleasant bug when using the C bindings from the Haskell backend, whereby recent changes to the dynamic loader on macOS break symbol lookup from dynamic libraries.

The result of this change is that calls to the backend's arenaAlloc function were ending up in the Haskell RTS's function of the same name, meaning that we got garbage memory allocated all over the place. There's no sensible fix here other than to rename our function and avoid the collision by doing so.

@Baltoli Baltoli marked this pull request as ready for review February 22, 2024 14:01
@Baltoli Baltoli changed the title Do renaming Rename arenaAlloc to fix collision with GHC RTS Feb 22, 2024
Copy link
Contributor

@goodlyrottenapple goodlyrottenapple left a comment

Choose a reason for hiding this comment

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

This does indeed fix the issue when loading the llvm backend as a library on macos

@rv-jenkins rv-jenkins merged commit 34a33b0 into master Feb 22, 2024
7 checks passed
@rv-jenkins rv-jenkins deleted the rename-arena-alloc branch February 22, 2024 15:04
Baltoli added a commit that referenced this pull request Feb 27, 2024
This fixes a rather unpleasant bug when using the C bindings from the
Haskell backend, whereby [recent
changes](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246462) to
the dynamic loader on macOS break symbol lookup from dynamic libraries.

The result of this change is that calls to the backend's `arenaAlloc`
function were ending up in the Haskell RTS's function of the same name,
meaning that we got garbage memory allocated all over the place. There's
no sensible fix here other than to rename our function and avoid the
collision by doing so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants