[ruby-core:80387] [Ruby trunk Bug#13238] string.c assertion fails after attempting to modify singleton class of a frozen string

From: nagachika00@...
Date: 2017-03-27 15:11:21 UTC
List: ruby-core #80387
Issue #13238 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.2: DONTNEED, 2.3: REQUIRED, 2.4: DONTNEED to 2.2: DONTNEED, 2.3: DONE, 2.4: DONTNEED

ruby_2_3 r58157 merged revision(s) 56747,56754,56777.


----------------------------------------
Bug #13238: string.c assertion fails after attempting to modify singleton class of a frozen string
https://bugs.ruby-lang.org/issues/13238#change-63875

* Author: owst (Owen Stephens)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin14]
* Backport: 2.2: DONTNEED, 2.3: DONE, 2.4: DONTNEED
----------------------------------------
Hi,

The following code causes an assertion failure in 2.3.3. Create two files, `bug.rb` and `not_frozen.rb`:

bug.`rb`:

~~~ ruby
s = 'abc'.freeze

def s.something; end rescue nil

require_relative 'not_frozen'
~~~

`not_frozen.rb`:

~~~ ruby
'abc'
~~~

And then run `ruby bug.rb`

The output is:

~~~
Assertion failed: (RBASIC_CLASS(ret) == rb_cString), function register_fstring, file string.c, line 327.
~~~

Searching for the error message I see that this exact issue (#12923) has been fixed for Ruby 2.4.0 - please can this fix be back-ported to Ruby 2.3?

Thanks,
Owen.



-- 
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