]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix 303624 segmentation fault on Android 4.1 (e.g. on android emulator or Galaxy...
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 18 Jul 2012 23:01:02 +0000 (23:01 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 18 Jul 2012 23:01:02 +0000 (23:01 +0000)
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.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12758

NEWS
README.android
README.android_emulator
coregrind/m_initimg/initimg-linux.c

diff --git a/NEWS b/NEWS
index e42f50bfc2e3ddab01f016045966b704e50d2165..22c34b5a1691dd8d79c82f7c6f7003601f81d102 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -251,7 +251,7 @@ n-i-bz  Fix assert in gdbserver for watchpoints watching the same address
 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)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 9c43d7ee7946d8ab2e524587578ffc55b98bd524..397a01d51ad4439c40e9b25ddea872e7e8ad9df6 100644 (file)
@@ -6,9 +6,12 @@ This is known to work at least for :
   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.
index 4808c484b531ea1b84d309461329bdad1cd5d62d..754895965deb65e5cecdb1b7fbde788be0d9e60a 100644 (file)
@@ -42,8 +42,6 @@ android
 #     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)
index 691b381a9492b50344f025aff05e6644de196641..dd68d6b0615299d67372d56004638ba74e6ad2e5 100644 (file)
@@ -668,8 +668,13 @@ Addr setup_client_stack( void*  init_sp,
             /* 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;