From: 0x0dea+redmine@... Date: 2015-10-05T01:57:27+00:00 Subject: [ruby-core:70980] [Ruby trunk - Bug #11566] [Open] Segfault when enumerating from a bad constructor. Issue #11566 has been reported by D.E. Akers. ---------------------------------------- Bug #11566: Segfault when enumerating from a bad constructor. https://bugs.ruby-lang.org/issues/11566 * Author: D.E. Akers * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0dev (2015-10-04 trunk 52020) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- ```ruby Enumerator.new(&:foo).to_a ``` This should raise a `NoMethodError` as it does for older Rubies, but the recent modifications to the internals of `Symbol#to_proc` seem to have elided the CFP information necessary to realize the `NME`. I've attached a core dump which ultimately blames the `VM_EP_LEP_P()` macro for dereferencing a null pointer. ``` c #define VM_EP_LEP_P(ep) VM_ENVVAL_BLOCK_PTR_P((ep)[0]) ``` Aside from observing that the block must not have an "environment" where it expected to find one, I am regrettably unable to provide any further information as to the nature or mitigation of this issue. ---Files-------------------------------- core (3.96 KB) -- https://bugs.ruby-lang.org/