ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:68499] [Ruby trunk - Bug #10966] [Open] Seg fault when param with default is followed by named param
       [not found] <redmine.issue-10966.20150311125937@ruby-lang.org>
@ 2015-03-11 12:59 ` greg
  2015-03-11 13:33 ` [ruby-core:68500] [Ruby trunk - Bug #10966] [Closed] " usa
  1 sibling, 0 replies; 2+ messages in thread
From: greg @ 2015-03-11 12:59 UTC (permalink / raw
  To: ruby-core

Issue #10966 has been reported by Greg Beech.

----------------------------------------
Bug #10966: Seg fault when param with default is followed by named param
https://bugs.ruby-lang.org/issues/10966

* Author: Greg Beech
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: 2.2.0-p0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The last line of the following code sample causes a seg fault. This seems to be the case for any method where a hash is passed to a parameter with a default value, when the method also has a named parameter.

~~~
class Foo
  def self.seg_fault(a = {}, b: 0); end
end

Foo.seg_fault('x' => 'y')
~~~

The output of running this is below, and the crash report is attached.

~~~
bug.rb:5: [BUG] Segmentation fault at 0x00000000000010
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0002 p:0027 s:0006 E:0009c0 EVAL   bug.rb:5 [FINISH]
c:0001 p:0000 s:0002 E:001390 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
bug.rb:5:in `<main>'

-- Machine register context ------------------------------------------------
 rax: 0x0000000000000000 rbx: 0x0000000101ac7028 rcx: 0x0000000000000000
 rdx: 0x0000000101ac7030 rdi: 0x0000000000000000 rsi: 0x0000000000000000
 rbp: 0x00007fff5e455620 rsp: 0x00007fff5e455560  r8: 0x0000000101ac7030
  r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
 r12: 0x00007f8622f4d9f0 r13: 0x00007f8622f4d920 r14: 0x00007f8622c08f80
 r15: 0x0000000000000000 rip: 0x0000000101945506 rfl: 0x0000000000010293

-- C level backtrace information -------------------------------------------
0   libruby.2.2.0.dylib                 0x000000010194cceb rb_vm_bugreport + 155
1   libruby.2.2.0.dylib                 0x00000001017f1100 rb_bug_context + 480
2   libruby.2.2.0.dylib                 0x00000001018c92c3 sigsegv + 83
3   libsystem_platform.dylib            0x00007fff8d956f1a _sigtramp + 26
4   libruby.2.2.0.dylib                 0x0000000101945506 setup_parameters_complex + 4758
5   ???                                 0x00007f862408af78 0x0 + 140214106894200

-- Other runtime information -----------------------------------------------

* Loaded script: bug.rb

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/enc/encdb.bundle
    4 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/enc/trans/transdb.bundle
    5 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/unicode_normalize.rb
    6 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/rbconfig.rb
    7 thread.rb
    8 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/thread.bundle
    9 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/compatibility.rb
   10 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/defaults.rb
   11 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/deprecate.rb
   12 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/errors.rb
   13 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/version.rb
   14 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/requirement.rb
   15 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/platform.rb
   16 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb
   17 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb
   18 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/util/stringio.rb
   19 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb
   20 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/exceptions.rb
   21 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
   22 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb
   23 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb
   24 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html
~~~

---Files--------------------------------
ruby_2015-03-11-125053_r1.crash (11.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:68500] [Ruby trunk - Bug #10966] [Closed] Seg fault when param with default is followed by named param
       [not found] <redmine.issue-10966.20150311125937@ruby-lang.org>
  2015-03-11 12:59 ` [ruby-core:68499] [Ruby trunk - Bug #10966] [Open] Seg fault when param with default is followed by named param greg
@ 2015-03-11 13:33 ` usa
  1 sibling, 0 replies; 2+ messages in thread
From: usa @ 2015-03-11 13:33 UTC (permalink / raw
  To: ruby-core

Issue #10966 has been updated by Usaku NAKAMURA.

Status changed from Open to Closed

It's already fixed.
Check 2.2.1.

----------------------------------------
Bug #10966: Seg fault when param with default is followed by named param
https://bugs.ruby-lang.org/issues/10966#change-51833

* Author: Greg Beech
* Status: Closed
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: 2.2.0-p0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The last line of the following code sample causes a seg fault. This seems to be the case for any method where a hash is passed to a parameter with a default value, when the method also has a named parameter.

~~~
class Foo
  def self.seg_fault(a = {}, b: 0); end
end

Foo.seg_fault('x' => 'y')
~~~

The output of running this is below, and the crash report is attached.

~~~
bug.rb:5: [BUG] Segmentation fault at 0x00000000000010
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0002 p:0027 s:0006 E:0009c0 EVAL   bug.rb:5 [FINISH]
c:0001 p:0000 s:0002 E:001390 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
bug.rb:5:in `<main>'

-- Machine register context ------------------------------------------------
 rax: 0x0000000000000000 rbx: 0x0000000101ac7028 rcx: 0x0000000000000000
 rdx: 0x0000000101ac7030 rdi: 0x0000000000000000 rsi: 0x0000000000000000
 rbp: 0x00007fff5e455620 rsp: 0x00007fff5e455560  r8: 0x0000000101ac7030
  r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
 r12: 0x00007f8622f4d9f0 r13: 0x00007f8622f4d920 r14: 0x00007f8622c08f80
 r15: 0x0000000000000000 rip: 0x0000000101945506 rfl: 0x0000000000010293

-- C level backtrace information -------------------------------------------
0   libruby.2.2.0.dylib                 0x000000010194cceb rb_vm_bugreport + 155
1   libruby.2.2.0.dylib                 0x00000001017f1100 rb_bug_context + 480
2   libruby.2.2.0.dylib                 0x00000001018c92c3 sigsegv + 83
3   libsystem_platform.dylib            0x00007fff8d956f1a _sigtramp + 26
4   libruby.2.2.0.dylib                 0x0000000101945506 setup_parameters_complex + 4758
5   ???                                 0x00007f862408af78 0x0 + 140214106894200

-- Other runtime information -----------------------------------------------

* Loaded script: bug.rb

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/enc/encdb.bundle
    4 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/enc/trans/transdb.bundle
    5 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/unicode_normalize.rb
    6 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/rbconfig.rb
    7 thread.rb
    8 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/x86_64-darwin14/thread.bundle
    9 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/compatibility.rb
   10 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/defaults.rb
   11 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/deprecate.rb
   12 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/errors.rb
   13 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/version.rb
   14 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/requirement.rb
   15 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/platform.rb
   16 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb
   17 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb
   18 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/util/stringio.rb
   19 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb
   20 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/exceptions.rb
   21 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
   22 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb
   23 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb
   24 /Users/greg/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html
~~~

---Files--------------------------------
ruby_2015-03-11-125053_r1.crash (11.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-11 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10966.20150311125937@ruby-lang.org>
2015-03-11 12:59 ` [ruby-core:68499] [Ruby trunk - Bug #10966] [Open] Seg fault when param with default is followed by named param greg
2015-03-11 13:33 ` [ruby-core:68500] [Ruby trunk - Bug #10966] [Closed] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).