diff --git a/runtime.c b/runtime.c index c1224180..6b94468b 100644 --- a/runtime.c +++ b/runtime.c @@ -2188,6 +2188,12 @@ object Cyc_set_car_cps(void *data, object cont, object l, object val) val = transport_stack_value(data, l, val, &do_gc); gc_mut_update((gc_thread_data *) data, car(l), val); +TODO: is there a race condition here between the collector (potentially with a stack value here) and the mutator (which is doing GC next?) +maybe we need to wait until after gc is finished before doing the actual mutation. that implies we need to create another continuation (that will do the mutation) and +return to there from GC. +NOTE set-cdr and vector-set are also affected. probably global_set too +once this change is made need to retest maze benchmark extensively in particular (as it was crashing previously) as well as entire suite. need to make sure this is +rock solid before it goes back to master car(l) = val; add_mutation(data, l, -1, val); // Ensure val is transported if (do_gc) {