[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    valgrind
From:       Tom Hughes <thh () cyberscience ! com>
Date:       2005-07-18 14:13:55
Message-ID: 1121696035.817637.14718.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 435880 by thughes:

Backport fixes for bugs #103509, #106293, #104797, #101881 from
the valgrind 3.0 tree.


 M  +1 -0      coregrind/core.h  
 M  +1 -1      coregrind/vg_memory.c  
 M  +2 -2      coregrind/vg_mylibc.c  
 M  +17 -10    coregrind/vg_syscalls.c  
 M  +1 -0      include/linux/vki.h  


--- trunk/valgrind/coregrind/core.h #435879:435880
@@ -887,6 +887,7 @@
                                   const Char *val );
 extern void   VG_(env_unsetenv) ( Char **env, const Char *varname );
 extern void   VG_(env_remove_valgrind_env_stuff) ( Char** env ); 
+extern Char **VG_(env_clone)    ( Vhar **envp );
 
 extern void   VG_(nanosleep)(struct vki_timespec *);
 /* ---------------------------------------------------------------------
--- trunk/valgrind/coregrind/vg_memory.c #435879:435880
@@ -1014,7 +1014,7 @@
 
    for(s = VG_(first_segment)(); s != NULL; s = VG_(next_segment)(s)) {
       UInt flags = s->flags & (SF_SHARED|SF_MMAP|SF_VALGRIND|SF_CORE|SF_STACK|SF_DEVICE);
-      if (flags != SF_MMAP && flags != SF_STACK)
+      if (flags != SF_MMAP && flags != SF_STACK && flags != (SF_MMAP|SF_STACK))
 	 continue;
       if ((s->prot & (VKI_PROT_READ|VKI_PROT_WRITE)) != (VKI_PROT_READ|VKI_PROT_WRITE))
 	 continue;
--- trunk/valgrind/coregrind/vg_mylibc.c #435879:435880
@@ -1356,7 +1356,7 @@
    ------------------------------------------------------------------ */
 
 /* clone the environment */
-static Char **env_clone ( Char **oldenv )
+Char **VG_(env_clone) ( Char **oldenv )
 {
    Char **oldenvp;
    Char **newenvp;
@@ -1640,7 +1640,7 @@
       /* restore the DATA rlimit for the child */
       VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
 
-      envp = env_clone(VG_(client_envp));
+      envp = VG_(env_clone)(VG_(client_envp));
       VG_(env_remove_valgrind_env_stuff)( envp ); 
 
       argv[0] = "/bin/sh";
--- trunk/valgrind/coregrind/vg_syscalls.c #435879:435880
@@ -1697,6 +1697,7 @@
 PRE(sys_execve, Special)
 {
    Char *path;		/* path to executable */
+   Char **envp;         /* environment */
 
    PRINT("sys_execve ( %p(%s), %p, %p )", arg1, arg1, arg2, arg3);
    PRE_REG_READ3(vki_off_t, "execve",
@@ -1746,16 +1747,14 @@
       VG_(shutdown_actions)(tid);
    }
 
-   {
-      // Remove the valgrind-specific stuff from the environment so the
-      // child doesn't get vg_inject.so, vgpreload.so, etc.  This is
-      // done unconditionally, since if we are tracing the child,
-      // stage1/2 will set up the appropriate client environment.
-      Char** envp = (Char**)arg3;
+   // Remove the valgrind-specific stuff from the environment so the
+   // child doesn't get vg_inject.so, vgpreload.so, etc.  This is
+   // done unconditionally, since if we are tracing the child,
+   // stage1/2 will set up the appropriate client environment.
+   envp = VG_(env_clone)( (Char**)arg3 );
 
-      if (envp != NULL) {
-         VG_(env_remove_valgrind_env_stuff)( envp ); 
-      }
+   if (envp != NULL) {
+      VG_(env_remove_valgrind_env_stuff)( envp ); 
    }
 
    if (VG_(clo_trace_children)) {
@@ -3269,6 +3268,9 @@
    case VKI_BLKGETSIZE:
       SYS_PRE_MEM_WRITE( "ioctl(BLKGETSIZE)", arg3, sizeof(unsigned long));
       break;
+   case VKI_BLKGETSIZE64:
+      SYS_PRE_MEM_WRITE( "ioctl(BLKGETSIZE64)", arg3, sizeof(unsigned long long));
+      break;
 
       /* Hard disks */
    case VKI_HDIO_GET_IDENTITY: /* 0x030d */
@@ -3934,6 +3936,9 @@
    case VKI_BLKGETSIZE:
       VG_TRACK( post_mem_write,arg3, sizeof(unsigned long));
       break;
+   case VKI_BLKGETSIZE64:
+      VG_TRACK( post_mem_write,arg3, sizeof(unsigned long long));
+      break;
 
       /* Hard disks */
    case VKI_HDIO_GET_IDENTITY: /* 0x030d */
@@ -5423,7 +5428,9 @@
 {
    PRINT("sys_times ( %p )", arg1);
    PRE_REG_READ1(long, "times", struct tms *, buf);
-   SYS_PRE_MEM_WRITE( "times(buf)", arg1, sizeof(struct vki_tms) );
+   if (arg1 != 0) {
+      SYS_PRE_MEM_WRITE( "times(buf)", arg1, sizeof(struct vki_tms) );
+   }
 }
 
 POST(sys_times)
--- trunk/valgrind/include/linux/vki.h #435879:435880
@@ -1390,6 +1390,7 @@
 //----------------------------------------------------------------------
 
 #define VKI_BLKGETSIZE _VKI_IO(0x12,96) /* return device size /512 (long *arg) */
+#define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114, vki_size_t) /* return device size in bytes (u64 *arg) */
 
 #define VKI_FIBMAP	_VKI_IO(0x00,1)	/* bmap access */
 #define VKI_FIGETBSZ    _VKI_IO(0x00,2)	/* get the block size used for bmap */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic