Project

General

Profile

Bug #15087

Segmentation fault with splat and block

Added by jacobevelyn (Jacob Evelyn) 2 months ago. Updated 6 days 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.


Related issues

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

Associated revisions

Revision d325d741
Added by nobu (Nobuyoshi Nakada) about 2 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. [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) about 2 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. [Bug #15087]

Revision a2d9317d
Added by nagachika (Tomoyuki Chikanaga) 6 days 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.
       [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) 6 days 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.
   [Bug #15087]

History

#1 Updated by mame (Yusuke Endoh) 2 months ago

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

#2 [ruby-core:88891] Updated by mame (Yusuke Endoh) 2 months ago

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

#3 [ruby-core:89087] Updated by mame (Yusuke Endoh) about 2 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) about 2 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. [Bug #15087]

#5 [ruby-core:89681] Updated by RubyBugs (A Nonymous) 10 days ago

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

#6 [ruby-core:89691] Updated by nobu (Nobuyoshi Nakada) 10 days 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.

#7 [ruby-core:89725] Updated by nagachika (Tomoyuki Chikanaga) 6 days 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.

Also available in: Atom PDF