From 5c21cd2532a67cff2d952c0de7c89a81375beb13 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 4 Jan 2010 21:49:25 +0000 Subject: [PATCH] Disable pid caching for print output: it's wrong in a child after a fork() and is very confusing. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11017 --- coregrind/m_libcprint.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 1782417d94..8cde39a36c 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -470,6 +470,8 @@ UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs ) /* Cache the results of getpid just once, so we don't have to call getpid once for each line of text output. */ + b->my_pid = -1; /* LATER: cacheing is confusing in presence of fork(), + disable for now. */ if (UNLIKELY(b->my_pid == -1)) { b->my_pid = VG_(getpid)(); vg_assert(b->my_pid >= 0); -- 2.47.3