mmtk / mmtk-julia

Julia binding for MMTk
13 stars 9 forks source link

Julia GC assumes `jl_task_t` is always in the remembered set. #96

Open qinsoon opened 1 year ago

qinsoon commented 1 year ago

Julia treats jl_task_t as a special case and assumes it will always reference young objects. https://github.com/JuliaLang/julia/blob/f9792b4863230d638425b4f79ec5e109e12f77cc/src/gc.c#L2517-L2518

In this case, they may not have write barriers when updating references in jl_task_t. I encountered a case when I was debugging for https://github.com/mmtk/mmtk-julia/pull/71, and described it here: https://github.com/mmtk/mmtk-julia/pull/71#issuecomment-1698257398. The missing write barrier was upstreamed in https://github.com/JuliaLang/julia/pull/51096, and included in our fork in https://github.com/mmtk/julia/pull/21. However, there might be more cases like this that we haven't found. We may encounter similar issues like this in the future.

We could consider treating jl_task_t as a special case.