From 0b7e01a2fa6961d96baf08c7ae5d9a9e645b16b9 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Sun, 12 Mar 2006 00:39:19 +0000 Subject: [PATCH] Fix a redirection bug created by the overhaul of m_redir.c. Bug 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 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index 6d42047f1e..853ad66245 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -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) { -- 2.47.2