-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Getting 'illegal instruction' error on armv6 #283
Comments
There was an rpi thread on v8-users recently. I don't know if you were involved but it lists a few things you can try. If nothing else, can you post the output of |
I saw another thread. I´m trying command line arguments from that one. But this will take some time since the Pi is slow(probably will take till tomorrow morning). When it works should I do a PR so it will print an error message if people don't use these options and add it to #282 ? |
Yes, that would be great. |
@Cydox How did it work? |
I remember having the 'illegal instruction' error on the Raspberry Pi after successfully compiling node v0.11.8 or v0.11.9 on the Pi itself. I think the issue may be related to the following code (from deps/v8/src/base/cpu.cc): // Unfortunately, it seems that certain ARMv6-based CPUs
// report an incorrect architecture number of 7!
//
// See http://code.google.com/p/android/issues/detail?id=10812
//
// We try to correct this by looking at the 'elf_format'
// field reported by the 'Processor' field, which is of the
// form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
// an ARMv6-one. For example, the Raspberry Pi is one popular
// ARMv6 device that reports architecture 7.
if (architecture_ == 7) {
char* processor = cpu_info.ExtractField("Processor");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
}
delete[] processor;
} This code looks at the Everything works correctly on older versions of Raspbian with the following
However, on newer versions of Raspbian
Related issues: |
This is really getting crazy now. An hour ago it the build on my Pi worked, but now i was giving it a second test but this time it gives me 'illegal instruction'. Runnig
so it is detecting armv7 again. |
i think the reason why it didnt work is that |
I added this change to the Code: if (architecture_ == 7) {
std::cout << "7" << std::endl;
char* processor;
processor = cpu_info.ExtractField("Processor");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
}
processor = cpu_info.ExtractField("model name");
if (HasListItem(processor, "(v6l)")) {
std::cout << "6" << std::endl;
architecture_ = 6;
}
delete[] processor;
}
} I included iostream obviously and added the 'print' statements to see wether thoughs if statements
I only did a short |
gdb backtrace and disassemble:
|
@Cydox please type Again, this could be ignored, please hit the |
like that?
|
What if you'll hit |
here are a bunch of ´em :D
|
Any new ideas on what fails here? |
It's most likely the last SIGILL that we're interested in. If all else fails, turn on coredumps with |
Is this any help?
|
And here's thread 2:
Let me know if you need the dump and/or binary. |
@silverwind The second thread looks healthy, it's sleeping in a system call. What does |
|
Thanks. I think V8's feature detection is failing here. Does |
Unfortunately not. It gives a very similar crash:
Right now, I'm trying to compile with some flags, but it'll be another 1-2 hours before it completes:
|
If you still have the binary around, can you try |
Still very much the same, with the first or both flags:
|
Hrm, okay. Maybe it's worth building with |
It's already been build with
Let's await the current build, at least one guy on this thread reports success with these make options. |
@silverwind I already tried those options youre building with right now. I didn´t have succes @bnoordhuis I´m found out in some other thread that it could help to build with How can I use those options? It´s hard to figure out how the makefiles work on a screen of a phone. |
@Cydox It's probably easiest to hack them into the 'cflags' list in common.gypi, the one that now says |
Isn´t the architecture detection done in cpu.cc? if (architecture_ == 7) {
std::cout << "7" << std::endl;
char* processor;
processor = cpu_info.ExtractField("Processor");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
}
processor = cpu_info.ExtractField("model name");
if (HasListItem(processor, "(v6l)")) {
std::cout << "6" << std::endl;
architecture_ = 6;
}
delete[] processor;
}
} It printed '6' so it should have detected armv6 right? Or am I horrible wrong with this point? |
@Cydox I'm not 100% sure but I believe some ARMv6 cores support the movw/movt instructions. V8 may think yours is one when it's not (assuming it's crashing for the same reason as @silverwind.) |
Seems to be mostly timeouts... |
@silverwind Thanks! looks like io.js is holding up fairly well. Most failures seem to be in timing sensitive tests, the only real failures are parallel/test-dgram-error-message-address and maybe parallel/test-stringbytes-external and parallel/test-process-active-wraps. |
Woohoo! Great work everyone! |
thanks everyone! |
The elf_platform suffix in /proc/cpuinfo moved to the model name field in Linux 3.8. Out-of-tree patch pending https://codereview.chromium.org/867713003/ Fixes: nodejs#283 PR-URL: nodejs#559 Reviewed-By: Fedor Indutny <[email protected]>
VFPv3 is ARMv7-only, enabling it for ARMv6 is therefore always wrong. Mea culpa, I do believe I'm the original author of that change. Fixes: nodejs#283 PR-URL: nodejs#559 Reviewed-By: Fedor Indutny <[email protected]>
Awesome work, thank you! |
@SynerG yes this is on my list of things to do very soon, the real hassle is getting a good setup for doing builds with Raspbian Wheezy as lowest-common-denominator platform, of course gcc is the problem there. |
@rvagg thank you for working on the issue. In case it is of any help, I have just built io.js directly on my RPi using Xbian (based on Raspbian Wheezy). |
FYI, this is pretty good, only 12 failures on a pi, mostly timeouts I suspect: https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/118/nodes=iojs-armv6-raspbian-wheezy/console Also attempting a nightly: https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/68/nodes=iojs-armv6-raspbian-wheezy/console It's all very slow of course because it's native, but I'm hoping that ccache will make this more reasonable to include as a regular test target and build target. Time will tell. |
@rvagg I think we can close this issue as solved. I looked through the current test failures and they all seem to be various timeouts, nothing serious. |
@silverwind agreed; I did start work on a "very-slow" flag for the test builds so that when you're running the test suite on armv6, various tests can choose to extend their timeouts and time expectations, just so we can get past them. In one instance there, the max time expected is 1s but it's taking above 6s on a RPi. Process startup is particularly slow which is a big problem for the test suite. |
Port 297cadb from io.js. Original commit message: The elf_platform suffix in /proc/cpuinfo moved to the model name field in Linux 3.8. Out-of-tree patch pending https://codereview.chromium.org/867713003/ Fixes: nodejs/node#283 PR-URL: nodejs/node#559 Reviewed-By: Fedor Indutny <[email protected]>
Port 7d9d756 from io.js. Original commit message: VFPv3 is ARMv7-only, enabling it for ARMv6 is therefore always wrong. Mea culpa, I do believe I'm the original author of that change. Fixes: nodejs/node#283 PR-URL: nodejs/node#559 Reviewed-By: Fedor Indutny <[email protected]>
Here is the official patch from V8 team: https://github.com/v8/v8-git-mirror/blob/master/src/base/cpu.cc#L483-L499 I have created a pull request to solve this issue: #25625 |
I built io.js with the change #282 on armv6.
When running io.js i get an 'Illegal instruction' error. g++ and gcc are on version 4.8.3.
There where no errors while building. I don´t know what other information i could give you.
Just ask me for the information you need and i´ll post it.
The text was updated successfully, but these errors were encountered: