From: Arnaud Giersch Date: Wed, 10 Apr 2013 15:27:30 +0000 (+0200) Subject: Disable stream buffer when reading /proc/self/maps. X-Git-Tag: v3_9_90~412^2~13 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a9b7c2dbec80a51f8615e24b6cb8f565f1273dd0?ds=sidebyside Disable stream buffer when reading /proc/self/maps. I don't fully understand why it is necessary but, without this change, the MC tests may terminate on a SIGSEGV. It is likely because some memory regions are unmapped on fclose, and then the real memory map is different from the informations that were read. --- diff --git a/src/mc/memory_map.c b/src/mc/memory_map.c index b4315233c4..b0e84a63cf 100644 --- a/src/mc/memory_map.c +++ b/src/mc/memory_map.c @@ -32,6 +32,8 @@ memory_map_t get_memory_map(void) xbt_assert(fp, "Cannot open /proc/self/maps to investigate the memory map of the process. Please report this bug."); + setbuf(fp, NULL); + ret = xbt_new0(s_memory_map_t, 1); /* Read one line at the time, parse it and add it to the memory map to be returned */