A Write Barrier Validating GC for Ruby
summary
Built a write‑barrier validating GC called WB check that runs as a separate modular GC for CRuby, captures an initial snapshot of object references, records write‑barrier calls, and later verifies every object’s children were either in the snapshot or recorded. Implementation evolved from an epsilon allocator to a simple mark‑sweep collector with ASAN-friendly malloc, finds missed and too‑early barriers, produces concrete parent/child error reports, helped reproduce bugs with GDB/RR, and uncovered and fixed 30 bugs while finishing test runs in about 90 seconds.
AI-written summary · about
chapters (11)
- 0:00Introduction and background
- 1:30Challenges of GC bugs
- 4:20How garbage collection works
- 6:29Write barriers explained
- 8:58Write barrier pitfalls
- 12:11Introducing WB check
- 15:49Implementation details
- 20:48Testing and false positives
- 22:33Turning WB check into GC
- 24:04Results and findings
- 25:30Future plans and conclusion
related talks
41mIncremental GC for Ruby interpreter
34mUnder the Hood of Ruby's Generational Garbage Collector
54mKeynote: Exploring Memory in Ruby - Building a Compacting GC
17mCollecting Cyclic Garbage across Foreign Function Interfaces: Who Takes the Last Piece(…)
32mOnce Upon a Time, Ruby
51mCompacting GC in MRI
39mMatz Q&A
42mTo Know A Garbage Collector
