
4/28/2021 · Matthias Käppler
What this post added
This post details the investigation and resolution of a production incident caused by Ruby 2.7's heap compaction feature when used with Puma's 'nakayoshi_fork'. It explains the concepts of tenuring objects and heap compaction, the challenges encountered with C-extensions like Hamlit due to improper object marking, and the specific fix implemented in Hamlit to resolve segfaults by statically resolving constants and using `rb_gc_register_mark_object`. It also highlights the need for more reliable detection of compaction-related issues in CI.