Issue #22562 has been updated by alanwu (Alan Wu). Subject changed from Type confusion SEGV: Using `super`, `instance_exec`, and `bind_call`, it is possible to run Array#first on an instance of Integer to Type confusion SEGV: Using `super` and `instance_exec` it is possible to run Array#first on an instance of Integer Renaming ticket because during development I found cases that don't involve `bind_call`. ---------------------------------------- Bug #22562: Type confusion SEGV: Using `super` and `instance_exec` it is possible to run Array#first on an instance of Integer https://bugs.ruby-lang.org/issues/22562#change-120172 * Author: alanwu (Alan Wu) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- The following crashes 3.3.0 through current trunk (commit:caf4f279d1): ```ruby module M # fixnum: (0x6f56<<1)+1 = 0xdead def first = 0x6f56.instance_exec { super } end M.instance_method(:first).bind_call([]) # <internal:array>:132: [BUG] Segmentation fault at 0x000000000000dead ``` Generally, the body of methods don't type-check `self`, relying on method dispatch to uphold the is-a relationship between `self` and the class/module defining the method. This funky use of `super` breaks that invariant. -- https://bugs.ruby-lang.org/