-
Notifications
You must be signed in to change notification settings - Fork 57
build: use heap trampolines instead of stack based trampolines #905
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
base: main
Are you sure you want to change the base?
Conversation
The world is moving towards stacks that are not executable. Fixes #866
|
Surely these changes should be implemented upstream in ForUM and GYRE, not in MESA?
… On Dec 26, 2025, at 6:22 PM, Vincent Vanlaer ***@***.***> wrote:
The world is moving towards stacks that are not executable.
Fixes #866
Note: this requires some testing on multiple platforms since these trampolines are architecture dependent
You can view, comment on, or merge this pull request online at:
#905
Commit Summary
• 58612e9 build: use heap trampolines instead of stack based trampolines
File Changes
(3 files)
• M forum/Makefile (2)
• M gyre/Makefile (2)
• M make/compile-settings-gnu.mk (2)
Patch Links:
• https://github.com/MESAHub/mesa/pull/905.patch
• https://github.com/MESAHub/mesa/pull/905.diff
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
|
Also, from reading the docs for -ftrampoline-impl=heap, it seems it is intended for gcc >= 14. But the SDK is still gcc 13.3.0.
… On Dec 26, 2025, at 6:30 PM, Richard Townsend ***@***.***> wrote:
Surely these changes should be implemented upstream in ForUM and GYRE, not in MESA?
> On Dec 26, 2025, at 6:22 PM, Vincent Vanlaer ***@***.***> wrote:
>
> The world is moving towards stacks that are not executable.
> Fixes #866
> Note: this requires some testing on multiple platforms since these trampolines are architecture dependent
> You can view, comment on, or merge this pull request online at:
> #905
> Commit Summary
> • 58612e9 build: use heap trampolines instead of stack based trampolines
> File Changes
> (3 files)
> • M forum/Makefile (2)
> • M gyre/Makefile (2)
> • M make/compile-settings-gnu.mk (2)
> Patch Links:
> • https://github.com/MESAHub/mesa/pull/905.patch
> • https://github.com/MESAHub/mesa/pull/905.diff
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
|
Good catch, indeed it requires GCC 14 at least (I usually develop on newer GCC versions for practical reasons). In any case, we do require the flags in MESA itself, but sure these flags can also be applied in forum/gyre instead of passing them in. |
|
We could also use -Wl,-z,noexecstack — see conda-forge/ctng-compiler-activation-feedstock#143
… On Dec 26, 2025, at 6:36 PM, Vincent Vanlaer ***@***.***> wrote:
VincentVanlaer left a comment (MESAHub/mesa#905)
Good catch, indeed it requires GCC 14 at least (I usually develop on newer GCC versions for practical reasons). In any case, we do require the flags in MESA itself, but sure these flags can also be applied in forum/gyre instead of passing them in.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
|
Unfortunately, that only works if none of the code that requires a trampoline is used at runtime. The eos unit tests hit this, which causes a segfault (as it's trying to execute non-executable stack memory). |
|
Fair enough.
What are thoughts on upgrading the SDK to gcc 14, and then going with Vincent’s solution?
… On Dec 26, 2025, at 6:53 PM, Vincent Vanlaer ***@***.***> wrote:
VincentVanlaer left a comment (MESAHub/mesa#905)
Unfortunately, that only works if none of the code that requires a trampoline is used at runtime. The eos unit tests hit this, which causes a segfault (as it's trying to executable non-executable stack memory).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
|
The new build system is already going to be a big change, so I say we take the opportunity to leap ahead in GCC version. Why not go straight to GCC 15.2, which seems to be the latest version? |
The world is moving towards stacks that are not executable.
Fixes #866
Note: this requires some testing on multiple platforms since these trampolines are architecture dependent