summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorMatt Valentine-House <[email protected]>2024-04-17 22:05:52 +0100
committerMatt Valentine-House <[email protected]>2024-04-17 23:29:23 +0100
commit0727d32b565d9365537ae9f14cbd9a2428addfa9 (patch)
tree32b738ad1b4305dd116085bf2997b1115064891e /gc.c
parent8b8130153625d551dddc1e1ff28de67ba3830dac (diff)
Don't verify during gc_enter when gc is disabled.
RGENGC_CHECK_MODE >=3 fails with an incinsistency in the old object count during ec_finalization. This is due to inconsistency introduced to the object graph using T_DATA finalizers. This is explained in commit 79df14c04b452411b9d17e26a398e491bca1a811, which disabled gc during finalization to work around this. ``` /* prohibit GC because force T_DATA finalizers can break an object graph consistency */ dont_gc_on() ``` This object graph inconsistency also seems to break RGENGC_CHECK_MODE >= 3, when it attempt to verify the object age relationships during finalization at VM shutdown (gc_enter is called during finalization). This commit stops the internal consistency check during gc_enter only when RGENGC_CHECK_MODE >= 3 and when gc is disabled. This fixes `make btest` with `-DRGENGC_CHECK_MODE=3`
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 29c1febd3f..f95072838a 100644
--- a/gc.c
+++ b/gc.c
@@ -9297,7 +9297,7 @@ gc_enter(rb_objspace_t *objspace, enum gc_enter_event event, unsigned int *lock_
gc_enter_count(event);
if (UNLIKELY(during_gc != 0)) rb_bug("during_gc != 0");
- if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(objspace);
+ if (RGENGC_CHECK_MODE >= 3 && (dont_gc_val() == 0)) gc_verify_internal_consistency(objspace);
during_gc = TRUE;
RUBY_DEBUG_LOG("%s (%s)",gc_enter_event_cstr(event), gc_current_status(objspace));