]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add patch from Stephan Kulow to solve the following:
authorJulian Seward <jseward@acm.org>
Wed, 17 Sep 2003 07:39:28 +0000 (07:39 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 17 Sep 2003 07:39:28 +0000 (07:39 +0000)
   read_procselfmaps calls *record_mapping which
   is startup_segment_callback for init_memory. But this
   again calls through read_symbols read_procselfmaps
   again with read_from_file == True. But this overwrites
   the internal buffer and causes parsing errors.
   (What makes the error a bit funny is that valgrind
    wouldn't have catched that error afaik :)
   Anyway: our solution is to forbid read_from_file from
   with callbacks

MERGE TO STABLE

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

coregrind/vg_procselfmaps.c

index ee33a0efdac06642b8c31650a68267fb20719229..2c673e0f0864347235d6e175d311fd70debbe0fd 100644 (file)
@@ -133,9 +133,12 @@ void VG_(read_procselfmaps) (
    UInt   foffset;
    UChar  rr, ww, xx, pp, ch, tmp;
 
-   if (read_from_file) {
+   static Int depth = 0;
+
+   if (read_from_file && depth == 0) {
       VG_(read_procselfmaps_contents)();
    }
+   depth++;
 
    if (0)
       VG_(message)(Vg_DebugMsg, "raw:\n%s", procmap_buf );
@@ -215,6 +218,7 @@ void VG_(read_procselfmaps) (
 
       i = i_eol + 1;
    }
+   depth--;
 }
 
 /*--------------------------------------------------------------------*/