From f92c11195105fdfdfcdd7ce6866d203e776e673b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 21 Apr 2017 00:22:10 +0300 Subject: [PATCH] Prevent multiple 'Caught ACCESS_VIOLATION in marker' per collection * mark.c [WRAP_MARK_SOME] (GC_mark_some): Do not call WARN() about ACCESS_VIOLATION more than once per garbage collection. --- mark.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mark.c b/mark.c index 4d7670c..52914a7 100644 --- a/mark.c +++ b/mark.c @@ -590,9 +590,16 @@ static void alloc_mark_stack(size_t); handle_ex: /* Exception handler starts here for all cases. */ - WARN("Caught ACCESS_VIOLATION in marker;" - " memory mapping disappeared\n", 0); - + { + static word warned_gc_no; + + /* Warn about it at most once per collection. */ + if (warned_gc_no != GC_gc_no) { + warned_gc_no = GC_gc_no; + WARN("Caught ACCESS_VIOLATION in marker;" + " memory mapping disappeared\n", 0); + } + } /* We have bad roots on the stack. Discard mark stack. */ /* Rescan from marked objects. Redetermine roots. */ GC_invalidate_mark_state(); -- 2.7.4