-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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 when calling Math.exp() #1376
Comments
I'd like to know what instruction it's tripping on. Can you try this?
|
But io.js has a strange behavior since calling only |
Oh, I forgot that openssl does feature detection. Can you repeat the above (enter |
|
Ah, movt again? I'm not sure how that can happen, that should have been fixed as of 297cadb. Can you post the contents of /proc/cpuinfo? What happens when you pass |
Of course:
Using |
Thanks. I can't think of a plausible reason why it's failing. @rvagg Can I get (or do I still have) access to the rpi1 buildbot? |
Confirmed on my RPi1, RPi2 is fine. |
Might have a partial stack there:
|
Ah, interesting. What happens when you run with |
Works:
|
Okay, good to know. Just to be sure, is the offending instruction in the top stack frame a movt for you as well or is it e.g. a vmov? |
Looks pretty much the same as @tberthe's:
This is from a core dump. For some reason, I can't get it to crash while live debugging, I blame it on my shell. |
Tried all
|
The other two functions show the exact same crash signature, so they're just calling into |
Also, current v8 options:
|
The code in upstream V8 seems to be identical so it's probably best to file an issue in the V8 bug tracker. |
This is how far I got. Still interested in finding the cause myself, but v8 guys might be faster to find this ;) |
V8 issue: https://code.google.com/p/v8/issues/detail?id=4019 /cc @Fishrock123 - this and the |
@bnoordhuis You mean in future release notes? Sure. |
@bnoordhuis still want to play with this?
The network is slow on these but there is a reference clone of io.js so you can use |
(updated comment to be |
@bnoordhuis let me know if above ssh works for you 😉 |
Someone from ARM promised to look at it today so I'll wait for his findings. @silverwind Go ahead and delete my account on your rpi. And thanks again. :-) |
@bnoordhuis thanks 😉 I think it's worth to float a patch for this until the fix lands in v8. |
The "fast" implementation of Math.exp() and Math.tanh() emits ARMv7 movt/movw instructions on ARMv6 (notably, the original Raspberry Pi.) Disable fast math for now. The adventurous can enable it again with the --fast_math switch. Refs: nodejs#1376 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019
The "fast" implementation of Math.exp() and Math.tanh() emits ARMv7 movt/movw instructions on ARMv6 (notably, the original Raspberry Pi.) Disable fast math for now. The adventurous can enable it again with the --fast_math switch. PR-URL: nodejs#1398 Refs: nodejs#1376 Reviewed-By: Roman Reiss <[email protected]> V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019
Notable changes: * C++ API: Fedor Indutny contributed a feature to V8 which has been backported to the V8 bundled in io.js. SealHandleScope allows a C++ add-on author to seal a HandleScope to prevent further, unintended allocations within it. Currently only enabled for debug builds of io.js. This feature helped detect the leak in #1075 and is now activated on the root HandleScope in io.js. (Fedor Indutny) #1395. * ARM: This release includes significant work to improve the state of ARM support for builds and tests. The io.js CI cluster's ARMv6, ARMv7 and ARMv8 build servers are now all (mostly) reporting passing builds and tests. - ARMv8 64-bit (AARCH64) is now properly supported, including a backported fix in libuv that was mistakenly detecting the existence of `epoll_wait()`. (Ben Noordhuis) #1365. - ARMv6: #1376 reported a problem with Math.exp() on ARMv6 (incl Raspberry Pi). The culprit is erroneous codegen for ARMv6 when using the "fast math" feature of V8. --nofast_math has been turned on for all ARMv6 variants by default to avoid this, fast math can be turned back on with --fast_math. (Ben Noordhuis) #1398. - Tests: timeouts have been tuned specifically for slower platforms, detected as ARMv6 and ARMv7. (Roman Reiss) #1366. * npm: Upgrade npm to 2.7.6. See the release notes (https://github.com/npm/npm/releases/tag/v2.7.6) for details.
Is this fixed (and can be closed) or are we waiting for the v8 update on this? |
We're working around it now by disabling fast math. The core issue (v8:4019) is still unfixed. |
Is it still happening? |
Yes, of course: $ iojs --fast-math -p "Math.exp(-1)"
[1] 2773 illegal hardware instruction (core dumped) iojs --fast-math -p "Math.exp(-1)" Patch has landed it seems: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2%5E!/#F0 |
For reference, the first V8 version that patch is available is 4.5.24. |
Ref: nodejs#1376 Ref: nodejs#1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: nodejs#2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Ref: #1376 Ref: #1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: #2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
So this has been resolved now? |
Ref: nodejs#1376 Ref: nodejs#1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: nodejs#2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Yes, it has been resolved by the V8 4.5 upgrade. Fast math is back with 074315f |
Ref: #1376 Ref: #1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: #2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Ref: #1376 Ref: #1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: #2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Ref: #1376 Ref: #1398 Issue fixed in V8: https://chromium.googlesource.com/v8/v8/+/81703350bbb9923d211fe5b79e90bd458b0916e2 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4019 PR-URL: #2592 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
I'm using io.js on a Raspberry Pi (Raspbian) and calling
Math.exp()
generates anillegal instruction
.I have tryed many packages: iojs-v1.2.0-linux-armv6l.tar.gz, iojs-v1.4.1-linux-armv6l.tar.gz and iojs-v1.6.4-linux-armv6l.tar.gz
For example, a simple file with:
produces this error.
The text was updated successfully, but these errors were encountered: