fix: add get_pgcstack_fallback to non-allocating allowlist (aarch64 false positive)#105
Merged
topolarity merged 1 commit intoJun 22, 2026
Conversation
`fn_may_allocate` already whitelists `get_pgcstack` and `get_pgcstack_static`
as never-allocating, but omits the `get_pgcstack_fallback` variant that
aarch64 (Apple Silicon) codegen emits to fetch the per-task GC stack pointer.
As a result `classify_runtime_fn("jl_get_pgcstack_fallback")` returns
`(:runtime, true)` and `check_allocs` reports a spurious
`AllocatingRuntimeCall` for allocation-free functions on aarch64.
This mirrors the earlier fix for the `_static` variant (e44be86).
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
topolarity
approved these changes
Jun 22, 2026
Member
There was a problem hiding this comment.
This seems to suggest TLS is not getting setup correctly somehow @ChrisRackauckas-Claude which is probably worthy of further investigation, but this is a good fix regardless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fn_may_allocate(src/classify.jl) whitelistsget_pgcstackandget_pgcstack_staticas never-allocating, but omitsget_pgcstack_fallback— the variant aarch64 (Apple Silicon) codegen emits to fetch the per-task GC stack pointer.As a result,
classify_runtime_fn("jl_get_pgcstack_fallback")returns(:runtime, true), andcheck_allocsreports a spuriousAllocatingRuntimeCallfor allocation-free functions on aarch64.This one-liner adds
"get_pgcstack_fallback"to the never-allocates allowlist, right next to"get_pgcstack_static". It mirrors the earlier_staticfix in e44be86.Fixes #104.
Verification
Pkg.test()passes on Julia 1.10 with the patch applied.Context
_staticvariant for exactly the same reason;get_pgcstack_fallbackis a third pgcstack-fetch variant the whitelist missed.