Project

General

Profile

Actions

Bug #13282

closed

opt_str_freeze does not always dedupe

Added by normalperson (Eric Wong) about 7 years ago. Updated about 7 years ago.

Status:
Rejected
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


Files

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

Updated by normalperson (Eric Wong) about 7 years ago

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

Updated by normalperson (Eric Wong) about 7 years ago

Eric Wong 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...

Updated by normalperson (Eric Wong) about 7 years ago

Eric Wong 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.

Updated by ko1 (Koichi Sasada) about 7 years ago

  • Status changed from Open to Rejected

for this case, specialized_instruction compilation option disable this feature.

Actions #5

Updated by naruse (Yui NARUSE) about 7 years ago

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0