From: Ivan Maidanski Date: Wed, 29 Nov 2017 22:10:20 +0000 (+0300) Subject: Fix assertion violation about disabled cancel in try_to_collect_inner X-Git-Tag: v8.0.0~470 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=218bfbfa;p=gc Fix assertion violation about disabled cancel in try_to_collect_inner * misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS] (GC_enable_incremental): Wrap GC_gcollect_inner and GC_read_dirty calls into DISABLE/RESTORE_CANCEL. --- diff --git a/misc.c b/misc.c index 231d7d18..e28fbfff 100644 --- a/misc.c +++ b/misc.c @@ -1319,6 +1319,9 @@ GC_API void GC_CALL GC_enable_incremental(void) } if (GC_incremental && !GC_dont_gc) { /* Can't easily do it if GC_dont_gc. */ + IF_CANCEL(int cancel_state;) + + DISABLE_CANCEL(cancel_state); if (GC_bytes_allocd > 0) { /* There may be unmarked reachable objects. */ GC_gcollect_inner(); @@ -1327,6 +1330,7 @@ GC_API void GC_CALL GC_enable_incremental(void) /* clean since nothing can point to an */ /* unmarked object. */ GC_read_dirty(FALSE); + RESTORE_CANCEL(cancel_state); } } UNLOCK();