[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:84654] [Ruby trunk Bug#14314] Marshalling broken in Ruby 2.5.0 for Structs with keyword_init: true

From: shannonskipper@...
Date: 2018-01-05 19:14:16 UTC
List: ruby-core #84654
Issue #14314 has been updated by shan (Shannon Skipper).


k0kubun (Takashi Kokubun) wrote:
> Thank you to catch this. I fixed this in r61616.

Will this also fix YAML deserialization or is that a separate issue entirely?

----------------------------------------
Bug #14314: Marshalling broken in Ruby 2.5.0 for Structs with keyword_init: true
https://bugs.ruby-lang.org/issues/14314#change-69235

* Author: jurriaan (Jurriaan Pruis)
* Status: Closed
* Priority: Normal
* Assignee: k0kubun (Takashi Kokubun)
* Target version: 
* ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED
----------------------------------------
Steps to reproduce:

~~~ 
irb(main):001:0> Foo = Struct.new(:foo)
=> Foo
irb(main):002:0> Marshal.load(Marshal.dump(Foo.new('a')))
=> #<struct Foo foo="a">
irb(main):003:0> Bar = Struct.new(:bar, keyword_init: true)
=> Bar(keyword_init: true)
irb(main):004:0> Marshal.load(Marshal.dump(Bar.new(bar: 'a')))
Traceback (most recent call last):
        3: from /home/jurriaan/.rubies/ruby-2.5.0/bin/irb:11:in `<main>'
        2: from (irb):4
        1: from (irb):4:in `load'
ArgumentError (wrong number of arguments (given 1, expected 0))
~~~

I expected the keyword_init: true struct to unmarshal correctly.

This issue is caused by marshal.c calling the struct initializer with regular arguments instead of keyword arguments.



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next