MRI Magic Tricks
summary
Finds the hidden Ruby VM frozen core by scanning nearby object IDs, provides a gem exposing its instance, and uses it to call internal methods like core_set_variable_alias and core_hash_defined_method to alias globals, reorder hash literals, and backport Ruby 2.1’s method-definition-returning-symbol behavior. Shows how module_initialized_copy lets code rewrite a class’s ancestry and implements superclass= (worked on Ruby 1.9.3 in testing). Demonstrates putting objects in $LOADED_FEATURES whose to_s runs during the segfault handler so a raised segfault can be caught — fragile and unsafe.
AI-written summary · about
chapters (9)
- 0:00Start
- 1:02Mri Bugs
- 1:36Disclaimer
- 2:04The Frozen Four
- 2:51Instruction Sequence Dump
- 10:42The Hash from Array Method
- 11:22Corset Method Alias
- 12:40Duplicating a Class
- 18:35Rescue from Segmentation Faults








