From a9b7c2dbec80a51f8615e24b6cb8f565f1273dd0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 10 Apr 2013 17:27:30 +0200 Subject: [PATCH] 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. --- src/mc/memory_map.c | 2 ++ 1 file changed, 2 insertions(+) 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 */ -- 2.20.1