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: v7.6.2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34b1cba8a5abf7473b6c7cca7d2113ab6e4c5b8c;p=gc Fix assertion violation about disabled cancel in try_to_collect_inner (Cherry-pick commit 218bfbfa from 'master' branch.) * 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 9cbe7506..ccde006e 100644 --- a/misc.c +++ b/misc.c @@ -1345,6 +1345,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(); @@ -1353,6 +1356,7 @@ GC_API void GC_CALL GC_enable_incremental(void) /* clean since nothing can point to an */ /* unmarked object. */ GC_read_dirty(); + RESTORE_CANCEL(cancel_state); } } UNLOCK();