Sitelet https://github.com/nodejs/node/issues/38501
Skip to content

gcc-11 builds with --enable-lto cause test segfaults + runtime errors #38501

Description

@mkszuba
  • Version: 16.0.0, 14.16.1, possibly others
  • Platform: Linux

What steps will reproduce the bug?

  1. Switch active compiler to gcc-11
  2. 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.

Activity

  1. mkszuba commented on May 1, 2021

    @mkszuba
    Author

    Here is the output of the test suite.

    cctest-segfault.log

  2. addaleax commented on May 2, 2021

    @addaleax
    Member

    @mkszuba Any chance you can use a native debugger to get a backtrace here, or provide binary + coredump?

  3. mkszuba commented on May 2, 2021

    @mkszuba
    Author
  4. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Aug 9, 2021
  5. janhenke commented on Jan 23, 2022

    @janhenke

    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?

  6. richardlau commented on Jan 23, 2022

    @richardlau
    Member

    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.

  7. sapics commented on Jan 30, 2022

    @sapics
    Contributor

    I have confirmed that there are NO ERRORs in gcc-11 + --enable-lto.
    Sorry, I have no idea that my test is equivalent to cctest or 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 root with following command

    export CFLAGS="-march=native"
    export CXXFLAGS="-march=native"
    export CPPFLAGS="-march=native"
    ./configure --experimental-enable-pointer-compression --enable-lto
    make -j60
    make -j60 test
  8. github-actions commented on Jun 27, 2026

    @github-actions
    Contributor

    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.

  9. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jun 27, 2026
  10. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions