Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 2009 22:00:31 GMT
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 168130 for review
Message-ID:  <200909032200.n83M0VUh040800@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=168130

Change 168130 by stas@stas_orion on 2009/09/03 21:59:37

	- Track changes in the address space by implementing mprotect(2) handler.
	  This fixes excessive FP in memchek on HEAD.

Affected files ...

.. //depot/projects/valgrind/memcheck/mc_main.c#4 edit

Differences ...

==== //depot/projects/valgrind/memcheck/mc_main.c#4 (text+ko) ====

@@ -1606,7 +1606,6 @@
    make_mem_undefined_w_tid_and_okind ( a, len, tid, MC_OKIND_UNKNOWN );
 }
 
-
 void MC_(make_mem_defined) ( Addr a, SizeT len )
 {
    PROF_EVENT(42, "MC_(make_mem_defined)");
@@ -1636,6 +1635,15 @@
    }
 }
 
+/* Track changes in the virtual memory space. */
+static void track_perms_change( Addr a, SizeT len,
+                      Bool rr, Bool ww, Bool xx )
+{
+   if (!(rr || ww))
+      MC_(make_mem_noaccess) ( a, len );
+   MC_(make_mem_defined) ( a, len );
+}
+
 
 /* --- Block-copy permissions (needed for implementing realloc() and
        sys_mremap). --- */
@@ -5806,7 +5814,7 @@
    // happen if the program catches the signal, though, which is bad.  If we
    // had two A bits (for readability and writability) that were completely
    // distinct from V bits, then we could handle all this properly.
-   VG_(track_change_mem_mprotect) ( NULL );
+   VG_(track_change_mem_mprotect) ( track_perms_change );
       
    VG_(track_die_mem_stack_signal)( MC_(make_mem_noaccess) ); 
    VG_(track_die_mem_brk)         ( MC_(make_mem_noaccess) );



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909032200.n83M0VUh040800>