Project

General

Profile

Actions

Bug #15087

closed

Segmentation fault with splat and block

Added by jacobevelyn (Jacob Evelyn) about 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.5.0, 2.5.1, 2.6.0dev (2018-09-07 trunk 64656)
[ruby-core:88890]

Description

The following code produces segmentation faults in Ruby 2.5.0, 2.5.1, and 2.6.0dev (2018-09-07 trunk 64656). This code worked in Ruby 2.4.1.

test_proc = Proc.new { "test" }
def foo(bar: 1, &block)
  yield
end
foo(**{}, &test_proc)

I've attached the crash reports for both Ruby 2.6.0dev (2018-09-07 trunk 64656) and 2.5.1. Let me know if there's anything else I can provide.


Files


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #15052: must not optimize `foo(**{})` outClosedActions
Actions #1

Updated by mame (Yusuke Endoh) about 6 years ago

  • Related to Bug #15052: must not optimize `foo(**{})` out added

Updated by mame (Yusuke Endoh) about 6 years ago

Good catch. My patch for #15052 will fix this issue.

Updated by mame (Yusuke Endoh) about 6 years ago

mame (Yusuke Endoh) wrote:

Good catch. My patch for #15052 will fix this issue.

We have never agreed with how to fix #15052 yet. Nobu is working on this issue without behavior change.

Actions #4

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r64786.


parse.y: fix block passing with empty kwargs

  • parse.y (arg_blk_pass): preceeding arguments node may be NULL when
    an empty keyword argument hash splat is optimized away.
    [ruby-core:88890] [Bug #15087]

Updated by RubyBugs (A Nonymous) about 6 years ago

This is still crashing in Ruby 2.5.3. Is this going to ever be fixed in Ruby 2.5 series?

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED

Sorry, I've missed filling the Backport.

Updated by nagachika (Tomoyuki Chikanaga) about 6 years ago

  • Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r65579 merged revision(s) 64786.

Updated by RubyBugs (A Nonymous) over 5 years ago

Hurray! Confirmed that this no longer crashes and works as expected on 2.5.4 and 2.6.2

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0