Skip to content

Restore the vtable pointer of received cache nodes - #229

Merged
trquinn merged 2 commits into
N-BodyShop:masterfrom
UIUC-PPL:fix-vtable-restore
Sep 29, 2026
Merged

trquinn merged 2 commits into
N-BodyShop:masterfrom
UIUC-PPL:fix-vtable-restore

Conversation

@lvkale

@lvkale lvkale commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Nodes in a node-cache reply are copied as raw bytes, vtable pointer included. Where processes map the executable at different addresses (a position-independent executable under address-space randomization, as on macOS, where every arm64 executable is PIE), that pointer is invalid in the receiving process and the first virtual call on a received node crashes. Two-process runs on macOS fail this way at the first remote fetch; single-process runs are unaffected. Fixed-address executables (readelf type EXEC, the usual Linux HPC build) never see it because every process loads the binary at its link address.

unpackSingle() already contained the restore, commented out with a note about an old PGI problem; this enables it. teststep energy and restart pass at 1x2, 2x2, 3x2 and 2x1 processes on macOS and on Anvil with it.

Orthogonal to the node-cache work in #228, which includes this commit; merging this first shrinks that diff.

🤖 Generated with Claude Code

Nodes in a cache reply are copied as raw bytes, vtable pointer included.
Where processes map the executable at different addresses (a
position-independent executable under address-space randomization, as
on macOS) that pointer is invalid in the receiver and the first virtual
call on a received node crashes: two-process runs failed on macOS this
way. Fixed-address executables (readelf type EXEC, the usual Linux HPC
build) are unaffected. The restore was already written and commented
out; enable it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@trquinn trquinn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please correct the indicated comment to prevent confusion in the future. Thanks,

Comment thread CacheInterface.cpp Outdated
The saved pointer is now used by unpackSingle().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trquinn
trquinn merged commit 8dfe8d1 into N-BodyShop:master Sep 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants