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

Illegal Instruction in NodeJS #917

Closed
iamrecursion opened this issue Sep 28, 2020 · 27 comments
Closed

Illegal Instruction in NodeJS #917

iamrecursion opened this issue Sep 28, 2020 · 27 comments

Comments

@iamrecursion
Copy link
Contributor

iamrecursion commented Sep 28, 2020

It seems that sticking around alpine edge is turning up all sorts of bugs! This one is quite simple to reproduce, but I can provide a rootfs if necessary.

  1. Set your repositories to alpine edge.
  2. apk add nodejs
  3. Run node.

It will crash with an illegal instruction that boils down to the following:

50 illegal instruction at 0x56d4d529: 0f 72 f0 01 8b 00 66 0f
Output from `dmesg` for the crash
[    0.000000] 50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 383
               50 stub syscall 375
               50 illegal instruction at 0x56d4d529: 0f 72 f0 01 8b 00 66 0f 
               56 stub syscall 383
               56 stub syscall 383
               56 stub syscall 383
               56 stub syscall 383
               56 stub syscall 383
               56 stub syscall 383
@62f
Copy link

62f commented Oct 13, 2020

Shocking that after 'switching the repositories' from 3.12? to >3.12 and using "apk add", that the first thing I'd purposefully-omit= apk update & apk upgrade

@zerkotin
Copy link

zerkotin commented Feb 21, 2021

IMG_5076
All i get is “illegal instruction” when running either node or npm

@Askovia
Copy link

Askovia commented Sep 7, 2021

In case you haven't fixed it, I manage to fix it in my phone by also installing npm along with nodejs, since they are codependent

@zerkotin
Copy link

zerkotin commented Sep 7, 2021

I have both installed on my iPad and it doesn’t work, when calling both npm or node i get Illegal Instruction

@zerkotin
Copy link

zerkotin commented Sep 7, 2021

Update:
I updated and upgraded apk like so:
apk update
apk upgrade
Then removed node and npm
apk del nodejs
apk del npm
Then reinstalled them
apk add nodejs
apk add npm
Now it works - seems like the new apk updates adds and installs dependent libraries necessary to run it
node runs like a dream :)
You can close the ticket as far as im concerned.

Thank you (it took a while) but thank you.

@Askovia
Copy link

Askovia commented Sep 7, 2021

Also noticed that the error comes when you aren't running the AppStore Repos

@specious
Copy link

None of these proposed solutions are helping. Any advice on how to investigate what is causing this crash?

@specious
Copy link

iSH needs SSE2 instruction support: #90 (comment)

@specious
Copy link

This is the problem: #1473

@Ivan0x17
Copy link

Ivan0x17 commented Feb 22, 2022

"Node and npm" return
illegal instruction

Probably the problem is nodejs why npm It depends on nodejs and v8 javascript engine

Does anyone have a solution??

@iamrecursion
Copy link
Contributor Author

Wait until the next AppStore release.

@Ivan0x17
Copy link

Wait until the next AppStore release.

Ok 👍🏻, thank you so much for fast response about my question, good project!! , I hope to use node-red soon

@Diluka
Copy link

Diluka commented Apr 12, 2022

any updates?

@mfyz
Copy link

mfyz commented Apr 17, 2022

+1

@pro-gamer007
Copy link

+2

@saagarjha
Copy link
Member

We don't really need votes for this issue, it's already been fixed and will ship in the next release.

@pro-gamer007
Copy link

When will the next release be?

@remino
Copy link

remino commented May 25, 2022

When is the next release?

@luni-moon
Copy link

luni-moon commented Jun 3, 2022

I’m getting the same issue on the most recent edge branch of Alpine, and after updating and upgrading, and installing the pkgs with —-no-cache, it broke nodejs and npm. None of the solutions said to work above, worked on my local device. Any help would be appreciated! Thanks!

EDIT: I did some research, and was told the following tag would work, but the--jitless flag has virtually no effect, as seen here:

# node --jitless src/index.js
Warning: disabling flag --expose_wasm due to conflicting flags
Illegal instruction

According to the NODEJS Documentation, --jitless is to:

Disable runtime allocation of executable memory. This may be required on some platforms for security reasons. It can also reduce attack surface on other platforms, but the performance impact may be severe.

This flag is inherited from V8 and is subject to change upstream.
It may disappear in a non-semver-major release.

And according to v8.dev, it is supposed to make NODEJS work on iOS devices, as seen in point number one:

But in some situations it can be desirable to run V8 without allocating executable memory:

  1. Some platforms (e.g. iOS, smart TVs, game consoles) prohibit write access to executable memory for non-privileged applications, and it has thus been impossible to use V8 there so far; and
  2. disallowing writes to executable memory reduces the attack surface of the application for exploits.

So, this flag should be able to work to make NODEJS to work on iSH, but it doesn’t. This could be a great starting point though for ideas.

@vkhv
Copy link

vkhv commented Jun 16, 2022

+1

@famiclone
Copy link

Any updates?

@TheGhostboi64
Copy link

I’m also getting the same problem

@vkhv
Copy link

vkhv commented Jun 26, 2022

Does anyone know how to run node.js on ipad? Another way

@specious
Copy link

Look at #1482.

@Fonysony
Copy link

Fonysony commented Jul 2, 2022

#1482 Actually works, just had to use vim to switch the repo into 1.12 and download node 12.22.12-r0. One issue is that it doesn't run well at times.

@saagarjha
Copy link
Member

iSH 1.3 is out, which has fixes for this issue. Please try it out and file new issues with what you encounter!

@dishanaik
Copy link

iSH 1.3 is out, which has fixes for this issue. Please try it out and file new issues with what you encounter!

Whoa! Finally. Thanks

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