Project

General

Profile

Bug #11910

resolv.rb - can't modify frozen String in #scan

Added by henry.helper (Henry Helper) almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:72559]

Description

lib/resolv.rb contains "frozen_string_literal: true". This causes an error in a travis build from https://github.com/middleman/middleman/pull/1713.

/home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `block in create': can't modify frozen String (RuntimeError)
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `scan'
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `create'
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:462:in `each_name'

The code in line lib/resolv.rb#L2462 (https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2462) causes the error. It modifies a string.

prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}

Related issues

Has duplicate Ruby master - Bug #12061: DNS resolv error RuntimeError: can't modify frozen String when using IPv6 AddressesClosedActions

Associated revisions

Revision a3b53cd9
Added by normal almost 4 years ago

Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 53363
Added by normalperson (Eric Wong) almost 4 years ago

Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

Revision 53363
Added by normal almost 4 years ago

Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

Revision 53363
Added by normal almost 4 years ago

Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

Revision 53363
Added by normal almost 4 years ago

Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

Revision 6b2f77a8
Added by naruse (Yui NARUSE) over 3 years ago

merge revision(s) 53363: [Backport #11910] [Backport #12061]

    * lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen

    * test/resolv/test_dns.rb (test_ipv6_create): test for above
      [Bug #11910] [ruby-core:72559]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54404
Added by naruse (Yui NARUSE) over 3 years ago

merge revision(s) 53363: [Backport #11910] [Backport #12061]

* lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen

* test/resolv/test_dns.rb (test_ipv6_create): test for above
  [Bug #11910] [ruby-core:72559]

History

Updated by normalperson (Eric Wong) almost 4 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED
#2

Updated by Anonymous almost 4 years ago

  • Status changed from Open to Closed

Applied in changeset r53363.


Resolv::IPv6.create: avoid modifying frozen string literal

  • lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
  • test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559]

Updated by usa (Usaku NAKAMURA) almost 4 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED
#4

Updated by usa (Usaku NAKAMURA) almost 4 years ago

  • Has duplicate Bug #12061: DNS resolv error RuntimeError: can't modify frozen String when using IPv6 Addresses added

Updated by naruse (Yui NARUSE) over 3 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE

ruby_2_3 r54404 merged revision(s) 53363.

Also available in: Atom PDF