-
Notifications
You must be signed in to change notification settings - Fork 31
illegal hardware instruction (core dumped) on Intel Penryn CPU #20
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
Comments
Is it possible that the machine which compiled this module is different than the machine on which it is running? |
Nope. I did an npm install after manually removing the node_modules folder to ensure that the latest version of sse4_crc32 is used and compiled on my machine directly. |
That's strange. It sounds like your compiler is generating code for your machine that won't actually run on your machine. Internally, we use these compiler intrinsics here: https://github.com/Voxer/sse4_crc32/blob/master/src/crc32c.c#L55 And we try to tell the compiler to do the right thing here: https://github.com/Voxer/sse4_crc32/blob/master/binding.gyp#L14 But somehow, this isn't working for you. Could it be that your environment is inheriting some compiler flags that are not correct, but this is the first module for which it actually mattered? It might be that there are other compiler flags we need to set in your environment to tell the compiler to generate valid code for your machine. Hopefully this is enough information for you to dig deeper into this and figure out what those flags are. |
Looking at https://github.com/Voxer/sse4_crc32/blob/master/binding.gyp#L14 it seems you are setting a compiler flag to explicitly enable SSE4.2. I'm not familiar with node-gyp but I suppose the cflags are simply passed on to GCC. My machine doesn't support SSE4.2 (nor do most pre-Nehalem CPUs I believe). Looking at https://github.com/Voxer/sse4_crc32/blob/master/src/crc32c.c you seem to be using _mm_crc32_u64, _mm_crc32_u32, _mm_crc32_u16 and _mm_crc32_u8 all of which seem to be specific to SSE4.2 and thus the trouble. I tried compiling with cflags set to -march=native (which applies the best possible cflags depending on how new the CPU is) and the compile failed. I'm pasting the relevant output of
There seems to be no fallback mechanism to provide an alternative if the CPU doesn't support SSE4.2. Could a code ask GCC to execute a different function on an older machine ? BTW, to reproduce this error, you'll probably need to try out this code on a slightly older CPU which doesn't support SSE4.2. I'll recommend an Atom CPU seeing that most of the older ones don't support SSE 4.2. |
@mahtuag There are 2 issues at play here.
|
TLDR. I don't think failed to build on non supporting platforms is a bug. As software fallback within this package needs lots of work. Which is not On the other hand if you done it wrong, it would affect hardware
|
@mahtuag Check out version 3.0.0 of the library. This version implements a fallback feature as well for older systems. Perhaps this can fix the issue you are seeing. |
Closing this. Please reopen if problem persists. |
For completeness, I ran into the issue on a SSE4.1 machine in my test environment. So I don't think its nullifying the project's name. The machine is a Core2 Duo, Debian 8.2, GCC 4.9 combination. It lacked SSE4.2 and String and Text New Instructions (STNI). Here's the preprocessor dump of preprocessor macros of interest. If
|
@noloader Can you please re run the test with the latest version (v5.0.0)? It has been updated to better handle hardware-support detection. |
I will do this asap.
|
I have a laptop running an Intel T4400 (Core 2 architecture 45nm Penryn; SSE4 not natively supported as you can see here), Fedora 21 x86_64 and Node.js installed from the official repositories (currently v0.10.33).
Ran into a weird issue with gcloud-node which was traced to sse4_crc32.
Setup:
Script
Output
The text was updated successfully, but these errors were encountered: