-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
V8 SIGILL on v0.12 on Raspberry Pi #8589
Description
I believe this is different from the issue mentioned in #8549 so I'm raising this separately.
There are two issues with the 0.12 build on ARM at the moment that prevent it from running correctly (although it builds without issues)
Firstly, there is a crash that is introduced when vfpv3 is used as arm_fpu (this is the default in the 0.12 configure because apparently V8 doesn't support vfpv2 which is the default in 0.10). However if I compile with it set to something else like "fpu" or "vfpv2" it does compile and start, although that's likely not the best fix ... The comment about V8 not supporting v2 is here in configure:
o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
Second issue is that while it does compile or start with the above change on older kernel versions, for more recent ones (anything "current") it fails because V8 is doing CPU detection based on /proc/cpuinfo which changed as a result of this delta in the Linux kernel:
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/arch/arm/kernel/setup.c?id=b4b8f770eb10a1bccaf8aa0ec1956e2dd7ed1e0a
The change modified the line on which (v6l) shows up from "Processor" to "model name". Here is the output on my "old" kernel 3.2.27+:
sxa@raspberrypi ~ $ head -2 /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Here it is on a newer one (3.12.22+)
sxa@pi ~ $ head -2 /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
Line 370 of https://github.com/joyent/node/blob/master/deps/v8/src/cpu.cc is scanning for the line prefixed "Processor" to be able to set the CPU flags correctly. Modifying the code to check for both options allows Node to execute on both old and new kernels:
if (architecture_ == 7) {
char* processor = cpu_info.ExtractField("Processor");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
} else {
delete[] processor;
processor = cpu_info.ExtractField("model name");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
}
}
delete[] processor;
}
EDIT: There is a V8 report describing the second issue at https://code.google.com/p/v8/issues/detail?id=3112 although it hasn't had any activity since February