|
From: <sv...@va...> - 2005-10-07 04:48:42
|
Author: njn
Date: 2005-10-07 05:48:37 +0100 (Fri, 07 Oct 2005)
New Revision: 4886
Log:
Add a comment about Memcheck not doing anything for mprotect.
Modified:
trunk/memcheck/mc_main.c
Modified: trunk/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_main.c 2005-10-07 02:53:51 UTC (rev 4885)
+++ trunk/memcheck/mc_main.c 2005-10-07 04:48:37 UTC (rev 4886)
@@ -2611,6 +2611,17 @@
VG_(track_new_mem_mmap) ( & mc_new_mem_mmap );
=20
VG_(track_copy_mem_remap) ( & mc_copy_address_range_state );
+
+ // Nb: we don't do anything with mprotect. This means that V bits ar=
e
+ // preserved if a program, for example, marks some memory as inaccess=
ible
+ // and then later marks it as accessible again.
+ //=20
+ // If an access violation occurs (eg. writing to read-only memory) we=
let
+ // it fault and print an informative termination message. This doesn=
't
+ // happen if the program catches the signal, though, which is bad. I=
f we
+ // had two A bits (for readability and writability) that were complet=
ely
+ // distinct from V bits, then we could handle all this properly.
+ VG_(track_change_mem_mprotect) ( NULL );
=20
VG_(track_die_mem_stack_signal)( & mc_make_noaccess );=20
VG_(track_die_mem_brk) ( & mc_make_noaccess );
|