From: ko1@... Date: 2014-12-24T02:53:57+00:00 Subject: [ruby-core:67087] [ruby-trunk - Bug #10623] [Closed] rb_hash_delete() can return Qundef in 2.2-rc1 Issue #10623 has been updated by Koichi Sasada. Status changed from Open to Closed % Done changed from 0 to 100 Applied in changeset r48958. ---------- * hash.c (rb_hash_delete): return Qnil if there are no corresponding entry. [Bug #10623] * hash.c (rb_hash_delete_entry): try delete and return Qundef if there are no corresponding entry. * internal.h: add rb_hash_delete_entry()'s declaration. * symbol.c: use rb_hash_delete_entry(). * thread.c: use rb_hash_delete_entry(). * ext/-test-/hash/delete.c: use rb_hash_delete_entry(). ---------------------------------------- Bug #10623: rb_hash_delete() can return Qundef in 2.2-rc1 https://bugs.ruby-lang.org/issues/10623#change-50600 * Author: Aman Gupta * Status: Closed * Priority: Normal * Assignee: * Category: * Target version: current: 2.2.0 * ruby -v: ruby 2.2.0dev [x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- The behavior of rb_hash_delete() has changed from 2.1. Before, it would always return Qnil or VALUE. Now it can also return Qundef, which is breaking the posix-spawn gem's usage: https://github.com/rtomayko/posix-spawn/blob/master/ext/posix-spawn.c#L242-L258 It also appears RTEST(Qundef) returns true, which causes a segfault in posix-spawn gem here: https://github.com/rtomayko/posix-spawn/blob/master/ext/posix-spawn.c#L425 I think we should revert back to original behavior before 2.2.0 is released. -- https://bugs.ruby-lang.org/