Status: New
Owner: ----
New issue 3387 by [email protected]: V8 standalone app dies with SIGILL
only on release signed APKs
http://code.google.com/p/v8/issues/detail?id=3387
I'm using v8 embedded into a C++ application using Android NDK. It works
fine on many devices but it crashes with SIGILL on the Samsung Galaxy Tab
10.1 using a release signed APK (Android 4.0.4). The weird thing is that
the debug signed apk runs perfect on the Galaxy Tab 10.1. I have checked
the .so library in both debug/release apks and both are equal, the md5 is
the same.
I've created a minimal testcase that reproduces the problem. I've tested
with many v8 versions (3.22, 3.23, 3.26, etc), with many compilation flags
(armeabi, armeabi-v7a, -mfpu=vfpv3-d16, etc.), enabling or disabling v8
snapshot, but the crash remains alive in release signed apks. Testcase
detailed here:
http://stackoverflow.com/questions/24160617/v8-standalone-app-dies-with-sigill-only-on-release-signed-apks/24168131#24168131
After some v8 internals debugging I've found the issue
The problem is the V8 cpu feature detection. V8 extracts the information
exposed by the kernel via /proc/cpuinfo. This is the CPUInfo for Galaxy Tab
10.1:
E/Paradox ( 9512): Info-> Processor : ARMv7 Processor rev 0 (v7l)
E/Paradox ( 9512): processor : 0
E/Paradox ( 9512): BogoMIPS : 1998.84
E/Paradox ( 9512):
E/Paradox ( 9512): processor : 1
E/Paradox ( 9512): BogoMIPS : 1998.84
E/Paradox ( 9512):
E/Paradox ( 9512): Features : swp half thumb fastmult vfp edsp vfpv3
vfpv3d16 tls
E/Paradox ( 9512): CPU implementer : 0x41
E/Paradox ( 9512): CPU architecture: 7
E/Paradox ( 9512): CPU variant : 0x1
E/Paradox ( 9512): CPU part : 0xc09
E/Paradox ( 9512): CPU revision : 0
E/Paradox ( 9512):
E/Paradox ( 9512): Hardware : p3
E/Paradox ( 9512): Revision : 000e
E/Paradox ( 9512): Serial : 4641120a0ab4919e
E/Paradox ( 9512): EO DATAAAAAAAAA
The problem is that features field has both vfpv3 and vfpv3d16 values
(vfpv3d16 is a limited vfpv3 version with only 16 64-bit FPU registers).
V8 parses CPUInfo assuming that both values are not defined at the same
time (cpu.cc file:
if (HasListItem(features, "vfpv3")) {
has_vfp3_ = true;
has_vfp3_d32_ = true;
} else if (HasListItem(features, "vfpv3d16")) {
has_vfp3_ = true;
}
Fix: Just change the else to a new if, and set has_vfp3_d32_ to false
if (HasListItem(features, "vfpv3")) {
has_vfp3_ = true;
has_vfp3_d32_ = true;
}
if (HasListItem(features, "vfpv3d16")) {
has_vfp3_ = true;
has_vfp3_d32_ = false;
}
It works.
The difference between debug and release signed apk is that on debug build
V8 manages to load data through ReadELFHWCaps, but in a release signed apk
it fallbacks to CPUInfo.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.