|
From: <sv...@va...> - 2009-12-10 19:26:45
|
Author: weidendo
Date: 2009-12-10 19:26:32 +0000 (Thu, 10 Dec 2009)
New Revision: 10966
Log:
Callgrind: fix bug 217849: Switch to running thread in CLG_(post_signal)
If instrumentation is switched off on multithreaded code,
multiple signals in a row handled by different threads could
confuse callgrind.
Callgrind assumed that in post_signal, it has the correct understanding
of the currently running thread. This is not always correct.
Really switch to running thread.
Modified:
trunk/callgrind/threads.c
Modified: trunk/callgrind/threads.c
===================================================================
--- trunk/callgrind/threads.c 2009-12-10 17:58:46 UTC (rev 10965)
+++ trunk/callgrind/threads.c 2009-12-10 19:26:32 UTC (rev 10966)
@@ -203,7 +203,7 @@
tid, sigNum, alt_stack ? "yes":"no");
/* switch to the thread the handler runs in */
- CLG_(run_thread)(tid);
+ CLG_(switch_thread)(tid);
/* save current execution state */
exec_state_save();
@@ -243,7 +243,8 @@
CLG_DEBUG(0, ">> post_signal(TID %d, sig %d)\n",
tid, sigNum);
- CLG_ASSERT(tid == CLG_(current_tid));
+ /* thread switching potentially needed, eg. with instrumentation off */
+ CLG_(switch_thread)(tid);
CLG_ASSERT(sigNum == CLG_(current_state).sig);
/* Unwind call stack of this signal handler.
|