From: Julian Seward Date: Wed, 17 Sep 2003 07:39:28 +0000 (+0000) Subject: Add patch from Stephan Kulow to solve the following: X-Git-Tag: svn/VALGRIND_2_1_0~198 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76b167b551efd1cc74b498f64ed788833db5caac;p=thirdparty%2Fvalgrind.git Add patch from Stephan Kulow to solve the following: 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 --- diff --git a/coregrind/vg_procselfmaps.c b/coregrind/vg_procselfmaps.c index ee33a0efda..2c673e0f08 100644 --- a/coregrind/vg_procselfmaps.c +++ b/coregrind/vg_procselfmaps.c @@ -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--; } /*--------------------------------------------------------------------*/