From: Ivan Maidanski Date: Tue, 11 Jul 2017 23:04:30 +0000 (+0300) Subject: Fix push_complex_descriptor to avoid unlimited global mark stack growth X-Git-Tag: v7.4.6~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c18ff9a94eecdab467bf08b2934a51fa353ca1d0;p=gc Fix push_complex_descriptor to avoid unlimited global mark stack growth Global mark stack should not grow in parallel marker mode (as fixed-size local_mark_stack is used instead). * typd_mlc.c [PARALLEL_MARK] (GC_array_mark_proc): Do not set GC_mark_stack_too_small if GC_parallel (and new_mark_stack_ptr is null); add comment. --- diff --git a/typd_mlc.c b/typd_mlc.c index 12bdd8ac..2e1da820 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -520,7 +520,13 @@ STATIC mse * GC_array_mark_proc(word * addr, mse * mark_stack_ptr, /* and request a mark stack expansion. */ /* This cannot cause a mark stack overflow, since it replaces */ /* the original array entry. */ - GC_mark_stack_too_small = TRUE; +# ifdef PARALLEL_MARK + /* We are using a local_mark_stack in parallel mode. */ + if (!GC_parallel) +# endif + { + GC_mark_stack_too_small = TRUE; + } new_mark_stack_ptr = orig_mark_stack_ptr + 1; new_mark_stack_ptr -> mse_start = (ptr_t)addr; new_mark_stack_ptr -> mse_descr.w = sz | GC_DS_LENGTH;