Skip to content
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

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

Open
mkszuba opened this issue May 1, 2021 · 6 comments
Open

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

mkszuba opened this issue May 1, 2021 · 6 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@mkszuba
Copy link

mkszuba commented May 1, 2021

  • 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.

@mkszuba
Copy link
Author

mkszuba commented May 1, 2021

Here is the output of the test suite.

cctest-segfault.log

@addaleax
Copy link
Member

addaleax commented May 2, 2021

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

@mkszuba
Copy link
Author

mkszuba commented May 2, 2021

Sure, here you go.
node-14.16.1-cctest_backtrace.log

clrpackages pushed a commit to clearlinux-pkgs/nodejs that referenced this issue May 18, 2021
@targos targos added the build Issues and PRs related to build files or the CI. label Aug 9, 2021
@janhenke
Copy link

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
Copy link
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.

@sapics
Copy link
Contributor

sapics commented 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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

6 participants