|
From: <sv...@va...> - 2012-07-18 23:01:09
|
philippe 2012-07-19 00:01:02 +0100 (Thu, 19 Jul 2012)
New Revision: 12758
Log:
Fix 303624 segmentation fault on Android 4.1 (e.g. on android emulator or Galaxy Nexus OMAP)
Valgrind was crashing systematically on Android 4.1.
This crash is caused by AT_IGNORE-ing AT_BASE.
This AT_IGNORE was needed to have breakpoints in shared libs
be handled properly (not very clear what is the problem
in the interaction between Valgrind GDBSERVER, AT_BASE and GDB).
Waiting to better understand all this, as a temporary bypass,
this patch ensures we do not ignore the AT_BASE on android.
The possible consequence is that breakpoints might be inserted
by the Valgrind gdbserver at wrong addresses in shared lib.
(any feedback on that is welcome).
Valgrind was build and then "proved" to work on Android emulator 4.0
and emulator 4.1, by using memcheck on one executable.
Modified files:
trunk/NEWS
trunk/README.android
trunk/README.android_emulator
trunk/coregrind/m_initimg/initimg-linux.c
Modified: trunk/README.android_emulator (+0 -2)
===================================================================
--- trunk/README.android_emulator 2012-07-18 23:36:37 +01:00 (rev 12757)
+++ trunk/README.android_emulator 2012-07-19 00:01:02 -23:00 (rev 12758)
@@ -42,8 +42,6 @@
# Android sdk 20
# Android platform tools 12
-# Android 4.1 (API 16) does not work.
-
# then define a virtual device:
Tools -> Manage AVDs...
# I define an AVD Name with 64 Mb SD Card, (4.0.3, api 15)
Modified: trunk/coregrind/m_initimg/initimg-linux.c (+6 -1)
===================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c 2012-07-18 23:36:37 +01:00 (rev 12757)
+++ trunk/coregrind/m_initimg/initimg-linux.c 2012-07-19 00:01:02 -23:00 (rev 12758)
@@ -668,8 +668,13 @@
/* When gdbserver sends the auxv to gdb, the AT_BASE has
to be ignored, as otherwise gdb adds this offset
to loaded shared libs, causing wrong address
- relocation e.g. when inserting breaks. */
+ relocation e.g. when inserting breaks.
+ However, ignoring AT_BASE makes V crash on Android 4.1.
+ So, keep the AT_BASE on android for now.
+ ??? Need to dig in depth about AT_BASE/GDB interaction */
+# if !defined(VGPV_arm_linux_android)
auxv->a_type = AT_IGNORE;
+# endif
auxv->u.a_val = info->interp_base;
break;
Modified: trunk/README.android (+4 -1)
===================================================================
--- trunk/README.android 2012-07-18 23:36:37 +01:00 (rev 12757)
+++ trunk/README.android 2012-07-19 00:01:02 -23:00 (rev 12758)
@@ -6,10 +6,13 @@
Android 4.0.3 running on a (rooted, AOSP build) Nexus S.
Android 4.0.3 running on Motorola Xoom.
Android 4.0.3 running on android emulator.
+ Android 4.1 running on android emulator.
Android 2.3.4 on Nexus S worked at some time in the past.
-It is known not to work on Android 4.1 running on android emulator.
+On android, GDBserver might insert breaks at wrong addresses.
+Feedback on this welcome.
+
Other configurations and toolchains might work, but haven't been tested.
Feedback is welcome.
Modified: trunk/NEWS (+1 -1)
===================================================================
--- trunk/NEWS 2012-07-18 23:36:37 +01:00 (rev 12757)
+++ trunk/NEWS 2012-07-19 00:01:02 -23:00 (rev 12758)
@@ -251,8 +251,8 @@
303127 Power test suite fixes for frsqrte, vrefp, and vrsqrtefp instructions.
303250 "Assertion `instrs_in->arr_used <= 10000' failed" on
OpenSSL with --track-origins=yes
+303624 segmentation fault on Android 4.1 (e.g. on android emulator or Galaxy Nexus OMAP)
-
Release 3.7.0 (5 November 2011)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.7.0 is a feature release with many significant improvements and the
|