Project

General

Profile

Bug #15087

Segmentation fault with splat and block

Added by jacobevelyn (Jacob Evelyn) 12 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
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

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

Associated revisions

Revision d325d741
Added by nobu (Nobuyoshi Nakada) 11 months ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 64786
Added by nobu (Nobuyoshi Nakada) 11 months ago

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]

Revision 64786
Added by nobu (Nobuyoshi Nakada) 11 months ago

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]

Revision a2d9317d
Added by nagachika (Tomoyuki Chikanaga) 10 months ago

merge revision(s) 64786: [Backport #15087]

    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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@65579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 65579
Added by nagachika (Tomoyuki Chikanaga) 10 months ago

merge revision(s) 64786: [Backport #15087]

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]

History

#1

Updated by mame (Yusuke Endoh) 12 months ago

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

Updated by mame (Yusuke Endoh) 12 months ago

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

Updated by mame (Yusuke Endoh) 11 months 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.

#4

Updated by nobu (Nobuyoshi Nakada) 11 months 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) 10 months 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) 10 months 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) 10 months 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) 5 months ago

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

Also available in: Atom PDF