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 crash on mips (AR9330) #2442

Closed
zoobab opened this issue Feb 29, 2016 · 9 comments
Closed

node crash on mips (AR9330) #2442

zoobab opened this issue Feb 29, 2016 · 9 comments

Comments

@zoobab
Copy link

zoobab commented Feb 29, 2016

Hi,

Node is crashing when I try to do a simple hello world on a MIPS target:

root@OpenWrt:/tmp# cat /root/hello-nodejs.js 
console.log("Hello World");
root@OpenWrt:/tmp# node /root/hello-nodejs.js 
Illegal instruction
root@OpenWrt:/tmp# node -v
v0.12.7

I am building it on a r48724, and compiling the same and executing it on x64 target works fine:

~ # node -v
v0.12.7
~ # node /root/hello.js 
Hello World

For the record, I try on a GL150:

root@OpenWrt:/tmp# cat /proc/cpuinfo 
system type             : Atheros AR9330 rev 1
machine                 : GL AR150
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 265.42
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
@tpham3783
Copy link

​Ben,

Can you make sure software floating point is supported in the kernel. I
got the same error the other day and enabling softfloat had solved it.

-tp

@tpham3783
Copy link

tpham3783 commented Feb 29, 2016 via email

@zoobab
Copy link
Author

zoobab commented Feb 29, 2016

Yes, it is enabled:

zoobab@esivisu /home/zoobab/soft/openwrt [16]$ grep "CONFIG_SOFT_FLOAT" .config
CONFIG_SOFT_FLOAT=y

I could quickly check if I have the same problem with nodejs+15.05.

@tpham3783
Copy link

​Please make sure that this option is enabled in the kernel too, its under
kernel type->MIPS FPU Emulation.

CONFIG_MIPS_FPU_EMULATOR=y

@zoobab
Copy link
Author

zoobab commented Feb 29, 2016

Yeah, now that works. Is it necessary to change the node package for this problem?

@tpham3783
Copy link

​Great!

It is actually a target/board config. Some targets will support hardfloat,
some will support softfloat, others by default wont support any. Its a
good idea to enable softfloat emulation by default for all targets if no
hard-float is detected in the target CPU. I'll leave it up to the
developers as to how to enable the feature.

@karlp
Copy link
Contributor

karlp commented May 24, 2016

Duplicate of #2633 ?

@diizzyy
Copy link
Contributor

diizzyy commented Jun 2, 2017

@zoobab
Is this still an issue or is it fixed?

@diizzyy
Copy link
Contributor

diizzyy commented Jun 9, 2017

Problem/Solution explained in #2633
@thess @hnyman @NeoRaider
Please close this

@yousong yousong closed this as completed Jan 26, 2018
yousong added a commit to yousong/packages that referenced this issue Jan 26, 2018
It requires a hardware or software emulated fpu, otherwise the program
can fail with SIGILL.  See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 27, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 29, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 30, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit that referenced this issue Feb 9, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See #1937, #2633, #2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lynxis pushed a commit to lynxis/packages that referenced this issue Jan 3, 2019
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
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

5 participants