]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix a redirection bug created by the overhaul of m_redir.c. Bug
authorJulian Seward <jseward@acm.org>
Sun, 12 Mar 2006 00:39:19 +0000 (00:39 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 12 Mar 2006 00:39:19 +0000 (00:39 +0000)
caused hardwired Actives to be discarded at the first call to
VG_(redir_notify_delete_SegInfo).  This causes crashes on amd64-linux
by throwing away the hardwired redirections

  0xFFFFFFFFFF600000 -> VG_(amd64_linux_REDIR_FOR_vgettimeofday)
  0xFFFFFFFFFF600400 -> VG_(amd64_linux_REDIR_FOR_vtime)

which I'm sure got mentioned at some point recently, but I cannot find
the email now.

Bug does not affect 3.1.X, since that line contains the old m_redir.c
implementation.

Bug does not affect any platform other than amd64-linux since no
others have hardwired Actives at the start.

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

coregrind/m_redir.c

index 6d42047f1e6b4a09194b82a892101675d742ac94..853ad6624543cc8d42c4d85b2529a137dd0acbf6 100644 (file)
@@ -573,11 +573,16 @@ void VG_(redir_notify_delete_SegInfo)( SegInfo* delsi )
               && (act->parent_spec->mark || act->parent_sym->mark);
 
       /* While we're at it, a bit of paranoia: delete any actives
-        which don't have both feet in valid client executable
-        areas. */
-      if (!delMe) {
-         if (!is_plausible_guest_addr(act->from_addr)) delMe = True;
-         if (!is_plausible_guest_addr(act->to_addr)) delMe = True;
+         which don't have both feet in valid client executable areas.
+         But don't delete hardwired-at-startup ones; these are denoted
+         by having parent_spec or parent_sym being NULL.  */
+      if ( (!delMe)
+           && act->parent_spec != NULL
+           && act->parent_sym  != NULL ) {
+         if (!is_plausible_guest_addr(act->from_addr))
+            delMe = True;
+         if (!is_plausible_guest_addr(act->to_addr))
+            delMe = True;
       }
 
       if (delMe) {