ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange
@ 2024-11-09  0:34 jhawthorn (John Hawthorn) via ruby-core
  2024-11-09  1:41 ` [ruby-core:119857] " jhawthorn (John Hawthorn) via ruby-core
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jhawthorn (John Hawthorn) via ruby-core @ 2024-11-09  0:34 UTC (permalink / raw)
  To: ruby-core; +Cc: jhawthorn (John Hawthorn)

Issue #20883 has been reported by jhawthorn (John Hawthorn).

----------------------------------------
Bug #20883: sprintf with binary strings has incorrect coderange
https://bugs.ruby-lang.org/issues/20883

* Author: jhawthorn (John Hawthorn)
* Status: Open
* ruby -v: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
* Backport: 3.1: DONTNEED, 3.2: REQUIRED, 3.3: REQUIRED
----------------------------------------
In [9dc6065](https://github.com/ruby/ruby/commit/9dc60653db186b1ae9400ed75b413a07728ce6ff) we stopped updating the coderange when the encoding became ENCINDEX_ASCII_8BIT. Though ASCII-8BIT (binary) can't ever have a broken coderange, it does need to distinguish between 7bit and valid.

``` ruby
puts ("%s" % "\xe2".b).ascii_only?
# => false from Ruby 2.1 to 3.1
# => true (incorrect) on Ruby 3.2 and 3.3
# => false again on HEAD
```

This was fixed in master as part of #20189, which clears the coderange in more cases of `rb_str_resize` which happens to fix this, but we shouldn't rely on it.

https://github.com/ruby/ruby/pull/12029



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:119857] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange
  2024-11-09  0:34 [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange jhawthorn (John Hawthorn) via ruby-core
@ 2024-11-09  1:41 ` jhawthorn (John Hawthorn) via ruby-core
  2024-11-10  6:13 ` [ruby-core:119871] " nagachika (Tomoyuki Chikanaga) via ruby-core
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jhawthorn (John Hawthorn) via ruby-core @ 2024-11-09  1:41 UTC (permalink / raw)
  To: ruby-core; +Cc: jhawthorn (John Hawthorn)

Issue #20883 has been updated by jhawthorn (John Hawthorn).


I opened two backport PRs. I marked 3.2 and 3.3 as REQUIRED for backport, but the bug is fairly mild if the branch maintainers would rather skip it.

3.2: https://github.com/ruby/ruby/pull/12041
3.3: https://github.com/ruby/ruby/pull/12040

----------------------------------------
Bug #20883: sprintf with binary strings has incorrect coderange
https://bugs.ruby-lang.org/issues/20883#change-110547

* Author: jhawthorn (John Hawthorn)
* Status: Closed
* ruby -v: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
* Backport: 3.1: DONTNEED, 3.2: REQUIRED, 3.3: REQUIRED
----------------------------------------
In [9dc6065](https://github.com/ruby/ruby/commit/9dc60653db186b1ae9400ed75b413a07728ce6ff) we stopped updating the coderange when the encoding became ENCINDEX_ASCII_8BIT. Though ASCII-8BIT (binary) can't ever have a broken coderange, it does need to distinguish between 7bit and valid.

``` ruby
puts ("%s" % "\xe2".b).ascii_only?
# => false from Ruby 2.1 to 3.1
# => true (incorrect) on Ruby 3.2 and 3.3
# => false again on HEAD
```

This was fixed in master as part of #20189, which clears the coderange in more cases of `rb_str_resize` which happens to fix this, but we shouldn't rely on it.

https://github.com/ruby/ruby/pull/12029



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:119871] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange
  2024-11-09  0:34 [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange jhawthorn (John Hawthorn) via ruby-core
  2024-11-09  1:41 ` [ruby-core:119857] " jhawthorn (John Hawthorn) via ruby-core
@ 2024-11-10  6:13 ` nagachika (Tomoyuki Chikanaga) via ruby-core
  2024-11-10  6:15 ` [ruby-core:119872] " nagachika (Tomoyuki Chikanaga) via ruby-core
  2025-01-15  1:42 ` [ruby-core:120677] " k0kubun (Takashi Kokubun) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: nagachika (Tomoyuki Chikanaga) via ruby-core @ 2024-11-10  6:13 UTC (permalink / raw)
  To: ruby-core; +Cc: nagachika (Tomoyuki Chikanaga)

Issue #20883 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 3.1: DONTNEED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: DONTNEED, 3.2: DONE, 3.3: REQUIRED

ruby_3_2 commit:9bcc5c5fd9e8e4d15040eec6850b49d860eba621.

----------------------------------------
Bug #20883: sprintf with binary strings has incorrect coderange
https://bugs.ruby-lang.org/issues/20883#change-110562

* Author: jhawthorn (John Hawthorn)
* Status: Closed
* ruby -v: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
* Backport: 3.1: DONTNEED, 3.2: DONE, 3.3: REQUIRED
----------------------------------------
In [9dc6065](https://github.com/ruby/ruby/commit/9dc60653db186b1ae9400ed75b413a07728ce6ff) we stopped updating the coderange when the encoding became ENCINDEX_ASCII_8BIT. Though ASCII-8BIT (binary) can't ever have a broken coderange, it does need to distinguish between 7bit and valid.

``` ruby
puts ("%s" % "\xe2".b).ascii_only?
# => false from Ruby 2.1 to 3.1
# => true (incorrect) on Ruby 3.2 and 3.3
# => false again on HEAD
```

This was fixed in master as part of #20189, which clears the coderange in more cases of `rb_str_resize` which happens to fix this, but we shouldn't rely on it.

https://github.com/ruby/ruby/pull/12029



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:119872] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange
  2024-11-09  0:34 [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange jhawthorn (John Hawthorn) via ruby-core
  2024-11-09  1:41 ` [ruby-core:119857] " jhawthorn (John Hawthorn) via ruby-core
  2024-11-10  6:13 ` [ruby-core:119871] " nagachika (Tomoyuki Chikanaga) via ruby-core
@ 2024-11-10  6:15 ` nagachika (Tomoyuki Chikanaga) via ruby-core
  2025-01-15  1:42 ` [ruby-core:120677] " k0kubun (Takashi Kokubun) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: nagachika (Tomoyuki Chikanaga) via ruby-core @ 2024-11-10  6:15 UTC (permalink / raw)
  To: ruby-core; +Cc: nagachika (Tomoyuki Chikanaga)

Issue #20883 has been updated by nagachika (Tomoyuki Chikanaga).


Merged the PR for ruby_3_2 at 9bcc5c5fd9e8e4d15040eec6850b49d860eba621. Thank you for the PRs.

----------------------------------------
Bug #20883: sprintf with binary strings has incorrect coderange
https://bugs.ruby-lang.org/issues/20883#change-110563

* Author: jhawthorn (John Hawthorn)
* Status: Closed
* ruby -v: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
* Backport: 3.1: DONTNEED, 3.2: DONE, 3.3: REQUIRED
----------------------------------------
In [9dc6065](https://github.com/ruby/ruby/commit/9dc60653db186b1ae9400ed75b413a07728ce6ff) we stopped updating the coderange when the encoding became ENCINDEX_ASCII_8BIT. Though ASCII-8BIT (binary) can't ever have a broken coderange, it does need to distinguish between 7bit and valid.

``` ruby
puts ("%s" % "\xe2".b).ascii_only?
# => false from Ruby 2.1 to 3.1
# => true (incorrect) on Ruby 3.2 and 3.3
# => false again on HEAD
```

This was fixed in master as part of #20189, which clears the coderange in more cases of `rb_str_resize` which happens to fix this, but we shouldn't rely on it.

https://github.com/ruby/ruby/pull/12029



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:120677] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange
  2024-11-09  0:34 [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange jhawthorn (John Hawthorn) via ruby-core
                   ` (2 preceding siblings ...)
  2024-11-10  6:15 ` [ruby-core:119872] " nagachika (Tomoyuki Chikanaga) via ruby-core
@ 2025-01-15  1:42 ` k0kubun (Takashi Kokubun) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2025-01-15  1:42 UTC (permalink / raw)
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #20883 has been updated by k0kubun (Takashi Kokubun).

Backport changed from 3.1: DONTNEED, 3.2: DONE, 3.3: REQUIRED to 3.1: DONTNEED, 3.2: DONE, 3.3: DONE

`ruby_3_3` merged https://github.com/ruby/ruby/pull/12040. Thank you!

----------------------------------------
Bug #20883: sprintf with binary strings has incorrect coderange
https://bugs.ruby-lang.org/issues/20883#change-111500

* Author: jhawthorn (John Hawthorn)
* Status: Closed
* ruby -v: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
* Backport: 3.1: DONTNEED, 3.2: DONE, 3.3: DONE
----------------------------------------
In [9dc6065](https://github.com/ruby/ruby/commit/9dc60653db186b1ae9400ed75b413a07728ce6ff) we stopped updating the coderange when the encoding became ENCINDEX_ASCII_8BIT. Though ASCII-8BIT (binary) can't ever have a broken coderange, it does need to distinguish between 7bit and valid.

``` ruby
puts ("%s" % "\xe2".b).ascii_only?
# => false from Ruby 2.1 to 3.1
# => true (incorrect) on Ruby 3.2 and 3.3
# => false again on HEAD
```

This was fixed in master as part of #20189, which clears the coderange in more cases of `rb_str_resize` which happens to fix this, but we shouldn't rely on it.

https://github.com/ruby/ruby/pull/12029



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-15  1:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-09  0:34 [ruby-core:119855] [Ruby master Bug#20883] sprintf with binary strings has incorrect coderange jhawthorn (John Hawthorn) via ruby-core
2024-11-09  1:41 ` [ruby-core:119857] " jhawthorn (John Hawthorn) via ruby-core
2024-11-10  6:13 ` [ruby-core:119871] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-11-10  6:15 ` [ruby-core:119872] " nagachika (Tomoyuki Chikanaga) via ruby-core
2025-01-15  1:42 ` [ruby-core:120677] " k0kubun (Takashi Kokubun) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).