gcc-11 builds with --enable-lto cause test segfaults + runtime errorsΒ #38501
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
- Version: 16.0.0, 14.16.1, possibly others
- Platform: Linux
What steps will reproduce the bug?
- Switch active compiler to gcc-11
- Build node with --enable-lto
3a. To reproduce test segfault, run cctest
3b. To reproduce runtime errors, use this build of node to e.g. compile a recent version of Firefox
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior?
Node passes tests and runs correctly.
What do you see instead?
See e.g. https://bugs.gentoo.org/787158
Additional information
Enabling LTO for the same node versions works fine with gcc-10.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Activity
mkszuba commentedon May 1, 2021
Here is the output of the test suite.
cctest-segfault.log
addaleax commentedon May 2, 2021
@mkszuba Any chance you can use a native debugger to get a backtrace here, or provide binary + coredump?
mkszuba commentedon May 2, 2021
Sure, here you go.
node-14.16.1-cctest_backtrace.log
Disable LTO, since runtime errors occur with GCC 11
janhenke commentedon Jan 23, 2022
Ping this issue still exist and with GCC 11 being used more and more, also more and more people are affected by the lack of possible optimisations.
Is there a chance that someone with more experience can take a look into what is the cause of the problems when building with LTO enabled?
richardlau commentedon Jan 23, 2022
Does this happen with Node.js >=17.2.0/builds from the master branch? In particular, does #40631 (which fixed #40368) help?
I have already cherry-picked #40631 onto the v16.x-staging and v14.x-staging branches so it should go out in the releases planned for the end of January/beginning of February.
sapics commentedon Jan 30, 2022
I have confirmed that there are NO ERRORs in gcc-11 + --enable-lto.
Sorry, I have no idea that my test is equivalent to
cctestor not.I have tested as follows.
src: master branch + cherry-pick c6e4596 (#41772)
Platform: Ubuntu 20.04
cpu: Ryzen Threadripper
gcc -v: gcc 11.1.0
test as
rootwith following commandgithub-actions commentedon Jun 27, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actions commentedon Jul 28, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.