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

Node crashes with 'illegal instruction' on old CPUs without AVX support like AMD Opteron 23xx #48700

Closed
karussell opened this issue Jul 8, 2023 · 3 comments

Comments

@karussell
Copy link

karussell commented Jul 8, 2023

Version

20.4.0 or 16.20.1

Platform

Debian 11

Subsystem

No response

What steps will reproduce the bug?

Find the appropriate hardware and then:

git clone https://github.com/graphhopper/graphhopper-maps
cd graphhopper-maps
npm install
npm run build

=>

 graphhopper-maps@0.0.0 build
 webpack --config webpack.prod.js

Illegal instruction

How often does it reproduce? Is there a required condition?

Can be only reproduced on hardware with a AMD Opteron 23xx (Gen 3 Class Opteron).

See this thread for more context. The underlying problem is highly likely that the CPUs have no AVX support.

Unfortunately disabling avx functionality does not seem to work

Can I disable this when compiling node somehow? I only found this but this did not help. Or should I edit deps/v8/src/base/cpu.h and some more files directly?

What is the expected behavior? Why is that the expected behavior?

It is expected that "npm run build" succeeds on all CPU including older CPUs without AVX support.

What do you see instead?

npm crashes with just "Illegal instruction".

Additional information

Related to #704 and RocketChat/Rocket.Chat#23938

@karussell karussell changed the title Node crashes with 'illegal instruction' on old CPUs without AVX support like AMD Opteron 23xx or AMD FX-8300 Node crashes with 'illegal instruction' on old CPUs without AVX support like AMD Opteron 23xx Jul 8, 2023
@bnoordhuis
Copy link
Member

I'm fairly sure V8 conflates AVX with SSE3 in several places, meaning it assumes AVX is supported when SSE3 is. Fixes for that should go upstream, we won't carry out-of-tree V8 patches.

But check the stack trace in gdb first. Maybe the offending instruction originates somewhere else.

@obfusk
Copy link

obfusk commented Jul 8, 2023

We finally managed to get a track trace; looks like it's not nodejs itself but the sharp npm module and its embedded libvips using AVX.

@bnoordhuis
Copy link
Member

Looks like there's nothing to do on our end in that case. I'll go ahead and close this out then. Thanks for the update.

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

No branches or pull requests

3 participants