From 8ff037ffff6bb9bdb6cb5cc2e3adfd0c5dca1246 Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Tue, 12 Dec 2006 09:02:42 +0000 Subject: [PATCH] Mps gcgenmsg: (comment only) TraceStart may overwrite fields of in-use message. TraceStart may silently drop the TraceStartMessage. Copied from Perforce Change: 161203 ServerID: perforce.ravenbrook.com --- mps/code/trace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mps/code/trace.c b/mps/code/trace.c index aa853501569..593f4babdcf 100644 --- a/mps/code/trace.c +++ b/mps/code/trace.c @@ -1544,8 +1544,15 @@ void TraceStart(Trace trace, double mortality, double finishingTime) arena = trace->arena; message = TraceStartMessageMessage(&trace->startMessage); - /* Check message is not on queue. If it _is_ then client - must have not read it yet. */ + /* Attempt to re-use message. + * @@@@ This is not done safely, because we fail to record + * whether the client has discarded the message yet. See + * design/message/#lifecycle. We might over-write message + * fields the client is still looking at. + * @@@@ Half-way measure: check message is not on queue. + * If it _is_ then client has not read the last Post yet, so + * we just silently drop the message for this TraceStart. + */ if(!MessageOnQueue(message)) { MessagePost(arena, message); }