-
Notifications
You must be signed in to change notification settings - Fork 43
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.js crash at startup on arm architecture #132
Comments
I succeeded : The CI is now using an arm architecture so the command
What I don't understand is that everything was working fine before these 2 commits : Maybe they should trigger a major version instead of a patch? |
Those commits only add prebuilt binaries for ARM. If your CI runs on x86 they are not used so I don't see any breaking change.
I don't know, there were no prebuilt binaries for ARM so the binary was probably created at install time on ARM devices. |
What is the platform/device that gives you the "Illegal Instructions (core dumped)" error? |
The device is running on a NXP i.MX Release Distro and the CPU architecture is ARMv7. The build generated by the Gitlab CI (running on a x86 cpu architecture) was running fine on the device with But is crashing now with |
Can you try to install |
Also what does the build generated by the Gitlab CI do? Does it generate a bundle, binary or something for x86 that is then run on ARM? |
Unfortunately, no :
The Gitlab CI does the following :
The For these dependencies, we have to copy them in a So the version the ci is installing for these "unbundlable" dependencies is not the one indicated in the package-lock.json, but the one in package.json (so it's installing minor & patch instead of exact version). We should be installing the package-lock.json versions instead, but we didn't find a good solution to do so yet. The dist/ folder is then simply copied into the arm device and executed there. |
To add further information : The device is using Node v8.9.4 |
So, now we removed the deprecated dependency "PhantomJS". The CI is using the docker image : https://hub.docker.com/r/arm32v7/node/. The installation en build step went well and should work on the arm arch. But, when executing the new resulting artifact, we still get the error "Illegal Instruction (core dumped)" on the arm device... But when executing the artifact and my local computer (arch x86), it works normally... |
So we managed to get internet access and npm on the device. When running |
Another experimentation : When I remove the folder prebuilds/linux-arm : It works ! So far it was working because the folder was missing and he must have used the "fallback.js" file instead. |
Yes, my only guess was that it was previously using the fallback code, which makes sense since you installed it on x86 and there was no prebuilt binary for ARM. To run the example linked above you can install it on any other device and move the whole directory inside the ARM device. I guess it will crash with the "Illegal Instructions" error. I did not test the ARMv7 native addon, I've only tested the ARMv6 version on a Raspberry Pi. |
I don't have an ARMv7 device so I can't test it myself but I think you can work around the issue by deleting the This will make it use the fallback code like it was with version 4.0.2 |
Ok, after running the example on the ARMv7 device, it crashes with "Illegal instruction (core dumped" as well.
I think I would rather try to find a way to use the package-lock fixed 4.0.2 version directly in my "deploy" script. But that means I wouldn't be able to upgrade this dependency anymore (until the issue with ARMv7 is fixed). I can also try to run |
The
What is weird is that "bufferutil" and "utf-8-validate" are not listed in the |
After debugging with a coworker, The binarie generated by the CI gives this :
Whereas another binarie on the device itself gives this :
It appears that, even though they are both arch ARMv7, c'est are incompatible, because of one uses arch So the solution for us, would be to run But my coworker told me there was many different and incompatible arch inside ARMv7 (or something like that). |
FYI Not installing |
I'm not sure if reverting 82bd20a is a good idea. cc: @BHSPitMonkey |
Actually, we didn't have bufferutil nor utf-8-validate as dependencies, that's why they weren't in the package-lock.json. But we still have to declare them as "external" to Webpack in order to create the bundle (since Webpack can't find them in our node_modules). In our deploy script, we were then installing A solution is to declare them as dependencies in our project, then Webpack can bundle them just fine in the final .js bundle. So we no longer have any binaries in a node_modules folder, which is great !
Hm, that means we could not declare them as dependencies : just add them to "external" in Webpack, and that should work. Thanks for the help ! |
I'm closing this due to inactivity. |
I have a CI on gitlab that builds applications for me using
npm install
. The CI runs on a x86 architecture but the builds worked so far on an arm based device.Since these commits :
The build no longer work on an arm based device, and the application crash with "Illegal Instructions (core dumped)".
So :
npm install --target_arch=arm
but it doesn't appear to workAny help on how to setup a Gitlab CI in order to make it work again would be appreciated.
The text was updated successfully, but these errors were encountered: