Project

General

Profile

Bug #13282

opt_str_freeze does not always dedupe

Added by normalperson (Eric Wong) 20 days ago. Updated 7 days ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:79914]

Description

Attached is the same test extracted from test/ruby/test_optimization.rb
but it fails in a standalone context. Not sure why...

It's not a new breakage in trunk, either.

Testing with some old installs I had around, 2.1.9p490 seems fine,
however even Ruby 2.2.1 seems broken

opt_str_freeze_not_always_effective.rb View (251 Bytes) normalperson (Eric Wong), 03/05/2017 01:57 AM

History

#1 [ruby-core:79915] Updated by normalperson (Eric Wong) 20 days ago

normalperson@yhbt.net wrote:

Testing with some old installs I had around, 2.1.9p490 seems fine,

Too Bad I'm Wrong.

It's seems to be only tickled by the gemification of test-unit
in 2.2. Using the test-unit gem with 2.1 still fails...

Now, I wonder what's causing this to interact badly with
test-unit...

#2 [ruby-core:79916] Updated by normalperson (Eric Wong) 20 days ago

Eric Wong normalperson@yhbt.net wrote:

Now, I wonder what's causing this to interact badly with
test-unit...

Same test with minitest (5.10.1) + ruby 2.5.0dev r57744 works fine:

require 'minitest/autorun'
class TestString < Minitest::Test
def test_string_freeze
assert_equal "foo".freeze.object_id, "foo".freeze.object_id
end
end

Strange...

#3 [ruby-core:79917] Updated by normalperson (Eric Wong) 20 days ago

Eric Wong normalperson@yhbt.net wrote:

Now, I wonder what's causing this to interact badly with
test-unit...

power_assert/enable_tracepoint_events - this disables all
sorts of MRI optimizations for testing.

For background, I was relying on opt_str_freeze to detect
the presence of the optimization so I could enable (or skip)
further tests for my own optimizations which were mainline
Ruby-specific.

#4 [ruby-core:80108] Updated by ko1 (Koichi Sasada) 12 days ago

  • Status changed from Open to Rejected

for this case, specialized_instruction compilation option disable this feature.

#5 Updated by naruse (Yui NARUSE) 7 days ago

  • Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: WONTFIX, 2.3: WONTFIX, 2.4: WONTFIX

Also available in: Atom PDF