Open etan-status opened 6 months ago
metrics
is indeed full of threading landmines that need to be cleared - none of the gcsafe here are actually gcsafe but rather work by accident more than anything else - afair it's linked due to how label values are moved across threads but there could be more to it as well.
With
--mm:orc
in Nim 2.0.2, the{.gcsafe.}
override ininc
seems to corruptlabelValues
memory.Observed on libp2p in
lpchannel.nim
where this is called from an{.async.}
proc:Passed are
["/ipfs/id/1.0.0", "out"]
values, by the time it hits themetrics
internalnewCounterMetrics
helper, it becomes["/ipipipipipipi", "out"]
, and on the way there goes through["[\"[\\\"[\\\\\\\"[\\\\\\", "out"]
before eventually SIGSEGV-ing.With
--mm:refc
, all's good.But maybe, accessing globals from procs that are marked as
{.gcsafe.}
is no longer practical with--mm:orc
.