Project

General

Profile

Activity

From 02/26/2024 to 03/03/2024

03/03/2024

04:18 PM Bug #20307: `Hash#update` from compare_by_identity hash can have unfrozen string keys
ignore me, I misunderstood the reproduction script. `h` is not compared by identity. byroot (Jean Boussier)
04:15 PM Bug #20307: `Hash#update` from compare_by_identity hash can have unfrozen string keys
I don't understand the bug report nor the patch.
If you make a frozen copy of the provided key, you change the key. e.g.
```
cache = {}.compare_by_indentity
key = Random.bytes(5)
cache[key] = 1
p cache[key]
```
I'd e...
byroot (Jean Boussier)
03:17 PM Bug #20307: `Hash#update` from compare_by_identity hash can have unfrozen string keys
After the code above, we can do
```ruby
h.rehash
p h #=> {"A"=>1}
```
When a key is clobbered like that due to a rehash, maybe there should be a warning or an error? It seems to me a pretty clear symptom of a bug, either in the ruby...
Dan0042 (Daniel DeLorme)
12:57 PM Bug #20321: `require': cannot load such file
nobu (Nobuyoshi Nakada) wrote in #note-1:
> What did you try to do at that time?
> ...
The commands:
```shell
version=3.3
underVersion=3.3.0
wget https://cache.ruby-lang.org/pub/ruby/$version/ruby-$underVersion.tar.gz
gunzip ruby-...
Justman10000 (Justin Nogossek)
12:15 AM Bug #20321 (Feedback): `require': cannot load such file
What did you try to do at that time?
And could you show more error logs around the line?
nobu (Nobuyoshi Nakada)
10:43 AM Bug #20322 (Closed): rb_enc_interned_str_cstr doesn't accept null pointer for encoding
Applied in changeset commit:git|7e4b1f8e1935a10df3c41ee60ca0987d73281126.
----------
[Bug #20322] Fix rb_enc_interned_str_cstr null encoding
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be
a null pointer, but t...
thomasmarshall (Thomas Marshall)
05:16 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
A patch for @ko1 style.
~~Probably the code generation would be more efficient in compile.c.~~
https://github.com/nobu/ruby/tree/dispatch-case
https://github.com/ruby/ruby/pull/10170
nobu (Nobuyoshi Nakada)

03/02/2024

07:03 PM Bug #20322: rb_enc_interned_str_cstr doesn't accept null pointer for encoding
I opened a PR to fix this: https://github.com/ruby/ruby/pull/10169 thomasmarshall (Thomas Marshall)
06:30 PM Bug #20322: rb_enc_interned_str_cstr doesn't accept null pointer for encoding
That's a regression and should be fixed mostly for consistency with other functions that take a encoding pointer. byroot (Jean Boussier)
05:56 PM Bug #20322 (Closed): rb_enc_interned_str_cstr doesn't accept null pointer for encoding
The [header documentation](https://github.com/ruby/ruby/blob/93556d46203545bc2364b1c0dd1281ba098f3cc9/include/ruby/internal/encoding/string.h#L120) for `rb_enc_interned_str_cstr` notes:
> `enc` can be a null pointer.
When [adding ...
thomasmarshall (Thomas Marshall)

03/01/2024

11:30 PM Bug #20321 (Feedback): `require': cannot load such file
Hi, have this, when i would compile Ruby:
> internal:<RUBY_PATH>/lib/rubygems/core_ext/kernel_require.rb:9:in `require': cannot load such file -- monitor (LoadError)
Justman10000 (Justin Nogossek)
08:50 PM Feature #20317: Removing the `allocate` method should cause `new` to fail
jeremyevans0 (Jeremy Evans) wrote in #note-1:
> The current behavior may be what you want if you want to ensure that new instances of the class have `#initialize` called on them. I suppose you could switch to making `allocate` private,...
tenderlovemaking (Aaron Patterson)
12:35 AM Feature #20317: Removing the `allocate` method should cause `new` to fail
The current behavior may be what you want if you want to ensure that new instances of the class have `#initialize` called on them. I suppose you could switch to making `allocate` private, but that still would allow for `send(:allocate)`... jeremyevans0 (Jeremy Evans)
12:18 AM Feature #20317 (Open): Removing the `allocate` method should cause `new` to fail
When you remove the `allocate` method from a class the you can't allocate the class via the `allocate` method. However, you _can_ allocate the class via the `new` method:
```ruby
class Foo; end
Foo.singleton_class.undef_method(:al...
tenderlovemaking (Aaron Patterson)
04:26 PM Misc #20320 (Open): Using OSU Open Source Lab native ppc64le/s390x CI services trigged on pull-requests
We have been using Travis CI to run unit tests the native arm64/ppc64le/s390x in the ruby/ruby, ruby/zlib and ruby/prism repositories in the Ruby project.
One of the challenges is Travis CI's chronic unstable infra issues. To be fair,...
jaruga (Jun Aruga)
03:54 PM Misc #20013: Travis CI status
I found the following information on https://www.traviscistatus.com/ . Travis CI is undergoing a maintenance in a week of 27/Feb - 5/Mar.
> Back-end maintenance 27-Feb to 5-Mar
> ...
Feb 28, 2024 - 12:42 UTC
>
> ...
Feb 28, 2024 -...
jaruga (Jun Aruga)
12:33 PM Misc #20013: Travis CI status
We have observed unstable Travis ppc64le/s390x pipelines. So, I added the allow_failures to the pipelines by the PR <https://github.com/ruby/ruby/pull/10158>.
## ppc64le
We have seen the following errors around 10 or more times in ...
jaruga (Jun Aruga)
12:18 PM Misc #20013: Travis CI status
Eregon (Benoit Daloze) wrote in #note-22:
> FYI mspec has a `--timeout SECONDS` option, which should help identify which spec is hanging/very slow.
OK. Thanks for the tip!
jaruga (Jun Aruga)
12:43 PM Feature #15554: warn/error passing a block to a method which never use a block
One concern if it's verbose-only is it won't help for typical mistakes with blocks like:
```ruby
p foo do
body
end
```
It would need to warn by default to address that.
Eregon (Benoit Daloze)
01:16 AM Feature #15554: warn/error passing a block to a method which never use a block
This would be a verbose-only warning right? Dan0042 (Daniel DeLorme)
12:04 PM Bug #20319: Singleton class is being frozen lazily in some cases
Alternatively, I think we could simplify `Kernel#freeze` to always only freeze the direct object and no other object, i.e. no singleton class would be frozen when freezing a singleton object.
State and methods are separate things, so IM...
Eregon (Benoit Daloze)
11:52 AM Bug #20319 (Open): Singleton class is being frozen lazily in some cases
I've noticed suspicious behaviour (it doesn't affect anything in practice for me though) when an object becomes frozen only its own singleton class becomes frozen immediately.
A singleton class of the object immediate singleton class ...
andrykonchin (Andrew Konchin)
08:20 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
@ko1 A pretty similar effect can be achieved by combining several recent features:
```ruby
def foo(*, **) = case [*, **]
in name, {}
puts name
in first_name, last_name, {}
puts "Hi there #{first_name} #{last_name}"
in [{greeting:}] ...
zverok (Victor Shepelev)
07:46 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
ko1 (Koichi Sasada) wrote in #note-3:
> I prefer
> ...
Personally this is the syntax I would like to see, as I believe that the intention of this issue is method overloading, and it has been a fairly common request. I also agree that i...
baweaver (Brandon Weaver)
07:34 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
I prefer
```ruby
def foo(...)
in [name] # foo('ko1')
puts name
in [first_name, last_name] # foo('ko1', 'ssd')
puts "Hi there #{first_name} #{last_name}"
in {greeting:} ...
ko1 (Koichi Sasada)
05:40 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
Personally I find the double ... rather confusing. I understand the benefit of a more succint syntax - e. g. eliminating "(*args, **kwargs, &block)" - but even then I find the dual-triple-dot very strange. It seems rather "un-ruby" to me... rubyFeedback (robert heiler)
05:24 AM Feature #20318: Pattern matching `case ... in` support for triple-dot arguments
Add array example. bradgessler (Brad Gessler)
03:11 AM Feature #20318 (Open): Pattern matching `case ... in` support for triple-dot arguments

# Premise
Sometimes when I'm creating a method for an API, I'd like to do pattern matching against the arguments. Today I have to do something like this:
```ruby
def foo(*args, **kwargs, &block)
case { args:, kwargs:, block: ...
bradgessler (Brad Gessler)
07:23 AM Bug #20311 (Closed): Struct.new("A") memory leak?
Applied in changeset commit:git|e626da82eae3d437b84d4f9ead0164d436b08e1a.
----------
Don't pin named structs defined in Ruby
[Bug #20311]
`rb_define_class_under` assumes it's called from C and that the
reference might be held in a C g...
byroot (Jean Boussier)
07:23 AM Bug #20311: Struct.new("A") memory leak?
> Is there any chance for the same module to be added twice?
Yes, aliasing isn't uncommon.
> ...
Probably this is same for any Ruby-level defined classes/modules.
Yes, my reasoning is that it's not reasonable to expect classes c...
byroot (Jean Boussier)
07:01 AM Bug #20311: Struct.new("A") memory leak?
byroot (Jean Boussier) wrote in #note-7:
> So maybe a better short term solution that is easy to backport is to just not use these API for naming structs: https://github.com/ruby/ruby/pull/10144
Seems fine, but I'm afraid what can ha...
nobu (Nobuyoshi Nakada)
06:03 AM Bug #20311: Struct.new("A") memory leak?
byroot (Jean Boussier) wrote in #note-3:
> So if a module is added twice, you need to remove it from the set if it's removed twice... I'll see if I can do that.
Is there any chance for the same module to be added twice?
nobu (Nobuyoshi Nakada)
12:38 AM Bug #16297: calling undefined allocator by `Class.instance_method(:allocate)`
I'm not sure if there's a deeper problem this causes, but it is still possible after this patch to call the allocator on a Rational through defining an arbitrary `allocate` method.
``` ruby
>> def Rational.allocate; end
=> :allocate...
jhawthorn (John Hawthorn)

02/29/2024

09:42 PM Bug #20085: Fiber.new{ }.resume causes Segmentation fault for Ruby 3.3.0 on aarch64-linux
kjtsanaktsidis (KJ Tsanaktsidis) wrote in #note-30:
> That patch just modifies the `configure.ac` file, which is the autoconf macros which generate the `./configure` script. If you patch this file, you need to regenerate the configure s...
tianon (Tianon Gravi)
09:41 PM Bug #20085: Fiber.new{ }.resume causes Segmentation fault for Ruby 3.3.0 on aarch64-linux
That patch just modifies the `configure.ac` file, which is the autoconf macros which generate the `./configure` script. If you patch this file, you need to regenerate the configure script by calling `./autogen.sh`. (Apologies if you're a... kjtsanaktsidis (KJ Tsanaktsidis)
08:48 PM Bug #20085: Fiber.new{ }.resume causes Segmentation fault for Ruby 3.3.0 on aarch64-linux
We applied the patch from https://github.com/ruby/ruby/commit/7f97e3540ce448b501bcbee15afac5f94bb22dd9.patch?full_index=1 directly in our `Dockerfile` for the `ruby:3.3-*` images we maintain in https://github.com/docker-library/ruby/pull... tianon (Tianon Gravi)
05:21 PM Bug #20316 (Open): Regexp quantifier behavior changes in different syntactic context.
In the example below, adding a vertical bar to the end of a regular expression changes what is being matched by the preceding regular expression.
```
irb(main):001:0> /(|a){3}b/.match("aab")
=> #<MatchData "aab" 1:"">
irb(main):002...
jirkamarsik (Jirka Marsik)
04:59 PM Bug #20315 (Open): Quantifier expansion leads to different results in Regexp.
Consider the following series of regular expression matches:
```
irb(main):001:0> /(|a)(|a)(|a)(|a)(|a)b/.match("aaaab")
=> #<MatchData "aaaab" 1:"" 2:"a" 3:"a" 4:"a" 5:"a">
irb(main):002:0> /(|a)(|a)(|a)(|a)b/.match("aaab")
=> #<Ma...
jirkamarsik (Jirka Marsik)
03:25 PM Bug #20312: Memory leak with BigDecimal::EXCEPTION_OVERFLOW
Oh right! Sorry, done: https://github.com/ruby/bigdecimal/issues/290 MaxLap (Maxime Lapointe)
05:18 AM Bug #20312 (Third Party's Issue): Memory leak with BigDecimal::EXCEPTION_OVERFLOW
Hi, @MaxLap . Thank you for report this.
Can you file this to https://github.com/ruby/bigdecimal/? bigdecimal is already extracted from canonical ruby repository.
hsbt (Hiroshi SHIBATA)
02:59 PM Bug #20311: Struct.new("A") memory leak?
So https://github.com/ruby/ruby/pull/10143 is turning into a huge yak-shave and will be hard to backport. The reason is a lot of code end up relying on classes defined in C becoming immortal (in addition to being pinned).
So maybe a ...
byroot (Jean Boussier)
12:07 PM Bug #20311: Struct.new("A") memory leak?
I think https://github.com/ruby/ruby/pull/10143 will do. But a good followup would also be to not pin `Struct.new("A")`. byroot (Jean Boussier)
11:47 AM Bug #20311: Struct.new("A") memory leak?
> But I also wonder why we have this root in the first place, I'd think these get marked from being constants in ::Object.
Nevermind, if I understand correctly, it's not to mark them, it's to pin them.
byroot (Jean Boussier)
11:45 AM Bug #20311: Struct.new("A") memory leak?
> rb_const_remove needs to take care of it when the removed constant is a class or module?
The problem is that it's a set:
```c
st_insert(vm->defined_module_hash, (st_data_t)module, (st_data_t)module);
```
So if a module is ad...
byroot (Jean Boussier)
10:59 AM Feature #15554: warn/error passing a block to a method which never use a block
> Regarding the warning message:
+1, these messages are clearer.
Anonymous
09:15 AM Feature #15554: warn/error passing a block to a method which never use a block
These results look encouraging to me.
The number of "false positives" seems reasonable.
Also they are not really false positives, because they are cases where a block is given and ignored by a method, but with the same call site also pot...
Eregon (Benoit Daloze)
08:12 AM Feature #15554: warn/error passing a block to a method which never use a block
We found issues with this warning system, like: https://github.com/ruby/ruby/commit/8316cb213c ko1 (Koichi Sasada)
08:10 AM Feature #15554: warn/error passing a block to a method which never use a block
Duck typing case:
```
class C1
def foo = nil
end
class C2
def foo = yield
end
[C1.new, C2.new].each{ _1.foo{ ... } }
```
RDoc's `each_ancestor` method(s) is.
----
Mock cases:
```patch
diff --git a/spec...
ko1 (Koichi Sasada)
08:05 AM Feature #15554: warn/error passing a block to a method which never use a block
Retry it on current master 2024.
Summary:
* false positive on several cases:
* intentional cases for duck typing
* making mock cases they want to ignore arguments
* found a few issues by warnings
----
https://gist.gith...
ko1 (Koichi Sasada)
09:31 AM Bug #20314: Simultaneous Timeout expires may raise an exception after the block
I'm not sure how Solution 3 would work.
`Thread#raise` would block until what?
Until the exception started to be raised/thrown on that thread? I think that would not fix that snippet.
It does not seem reasonable to wait until the excepti...
Eregon (Benoit Daloze)
06:25 AM Bug #20314 (Open): Simultaneous Timeout expires may raise an exception after the block
Launchable reports `TestTimeout#test_nested_timeout` as a flaky test, and I reproduced it as follows.
```ruby
require "timeout"
class A < Exception
end
class B < Exception
end
begin
Timeout.timeout(0.1, A) do
Tim...
mame (Yusuke Endoh)
08:30 AM Feature #19979: Allow methods to declare that they don't accept a block via `&nil`
Actually, I prefer #15554, but my concern is that it causes compatibility issues with false positives.
Matz.
matz (Yukihiro Matsumoto)
07:40 AM Misc #20254 (Closed): Add Launchable into Ruby CI
@ono-max and @jaruga Thank you for your works. Launchable has been added our repository.
We discovered https://bugs.ruby-lang.org/issues/20314 with this integration.
We should close this and create new ticket each concerns.
hsbt (Hiroshi SHIBATA)
12:51 AM Misc #20254: Add Launchable into Ruby CI
Thank you for introducing the feature, @jaruga. Also, I'd like to introduce the page https://app.launchableinc.com/organizations/ruby/workspaces/ruby/insights/unhealthy-tests. This page displays Flaky Tests, Never Failing Tests, Longest ... ono-max (Naoto Ono)
01:18 AM Bug #20313: Backport RUBY_YJIT_ENABLE PR https://github.com/ruby/ruby/pull/7208
Merged to ruby_3_2 at https://github.com/ruby/ruby/commit/80112a9847b705b53e17e48540a6d00daa7e59a4. Thanks. nagachika (Tomoyuki Chikanaga)

02/28/2024

11:26 PM Misc #20254: Add Launchable into Ruby CI
FYI: I'm going to change the GitHub comment feature as follows today:
If a test is executed multiple times, we'll treat it as a single test, and the status of the test will reflect the latest result. By implementing this behavior, retrie...
ono-max (Naoto Ono)
03:15 PM Misc #20254: Add Launchable into Ruby CI
As a reference to see how the results of the Launchable CI look like, below is one example to see the flaky, the most failed, and longest tests.
https://github.com/ruby/ruby/pull/10118#issuecomment-1967550964
jaruga (Jun Aruga)
06:26 PM Bug #20313 (Closed): Backport RUBY_YJIT_ENABLE PR https://github.com/ruby/ruby/pull/7208
k0kubun (Takashi Kokubun)
04:53 PM Bug #20313 (Closed): Backport RUBY_YJIT_ENABLE PR https://github.com/ruby/ruby/pull/7208
Backporting "Make sure RUBY_YJIT_ENABLE only enables YJIT for truthy values" PR https://github.com/ruby/ruby/pull/7208 to Ruby 3.2
More details here: https://github.com/ruby/ruby/pull/10125
andclt (Andrea Culot)
05:23 PM Feature #20309: Bundled gems for Ruby 3.5
Also something I remembered now is YJIT [does not compile singleton methods](https://github.com/Shopify/ruby/issues/552), except singleton methods of modules and classes.
So then that replacement can also be significantly slower.
Eregon (Benoit Daloze)
05:21 PM Feature #20309: Bundled gems for Ruby 3.5
@jeremyevans0 One issue with that replacement is it does not name the class of the object, so it's quite unclear if there is an exception with it.
And also no easy way to define constants in that singleton class (and if one does `A = .....
Eregon (Benoit Daloze)
03:38 PM Feature #20309: Bundled gems for Ruby 3.5
Eregon (Benoit Daloze) wrote in #note-6:
> hsbt (Hiroshi SHIBATA) wrote:
> ...
On the other hand, it's almost always better to use a normal constant with a singleton object than the `singleton` library. `singleton`'s only advantage is...
jeremyevans0 (Jeremy Evans)
11:18 AM Feature #20309: Bundled gems for Ruby 3.5
Eregon (Benoit Daloze) wrote in #note-6:
> > * fcntl
> ...
I misremembered, I thought there was something like `Fcntl.fcntl`, but it's `IO#fcntl`.
So `fcntl` is literally just a bunch of constants:
https://github.com/oracle/truffleru...
Eregon (Benoit Daloze)
11:14 AM Feature #20309: Bundled gems for Ruby 3.5
hsbt (Hiroshi SHIBATA) wrote:
> * ostruct
> ...
+1 since ostruct is already kind of deprecated.
> * irb
> ...
Will that break `binding.irb` under `bundle exec`? If so that seems a major problem.
I would think it would break it if `bindi...
Eregon (Benoit Daloze)
08:46 AM Feature #20309: Bundled gems for Ruby 3.5
I'm big fan (and user) of `ruby -run -e httpd . -p 1234`, this is also part of "local HTTP server oneliners" like https://gist.github.com/willurd/5720255 and it will break various tutorials online if `un` is not installed with ruby by de... retro (Josef Šimánek)
04:36 PM Bug #20311: Struct.new("A") memory leak?
Seems referred from `defined_module_hash`.
`rb_const_remove` needs to take care of it when the removed constant is a class or module?
nobu (Nobuyoshi Nakada)
01:28 PM Bug #20311: Struct.new("A") memory leak?
I had a quick look at this using `ObjectSpace.dump_all`, and it appears that these classes are being retained in the VM root:
```ruby
require 'objspace'
3.times do
puts ObjectSpace.dump(Struct.new("A"))
Struct.send(:remove_c...
byroot (Jean Boussier)
12:03 PM Bug #20311 (Closed): Struct.new("A") memory leak?
The following code gives the impression of a memory leak.
```ruby
10.times do
5000.times do
Struct.new("A")
Struct.send(:remove_const, :A)
end
GC.start
puts `ps -o rss= -p #{$$}`.to_i
end
```
```
27868
...
MaxLap (Maxime Lapointe)
03:46 PM Bug #20312 (Third Party's Issue): Memory leak with BigDecimal::EXCEPTION_OVERFLOW
The following causes a memory leak.
I left a commented line, both trigger an memory leak. I assume it's the same bug
```
require 'bigdecimal'
BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true)
10.times do |j|
100000.ti...
MaxLap (Maxime Lapointe)
08:12 AM Bug #20310: ASAN fake stacks need to be marked during GC for non-current execution context
I opened https://github.com/ruby/ruby/pull/10122 as my first attempt at this. kjtsanaktsidis (KJ Tsanaktsidis)
04:01 AM Bug #20310 (Closed): ASAN fake stacks need to be marked during GC for non-current execution context
When ASAN (address sanitizer) is enabled, the compiler does not necessarily store all local variables on the real machine stack; instead, locals can be stored in per-frame heap allocated memory which ASAN uses to detect things like stack... kjtsanaktsidis (KJ Tsanaktsidis)
04:22 AM Feature #20275: Avoid extra backtrace entries for rescue and ensure
I am in favor of this change, but I do not plan to write a patch and estimate its impact. Someone who wants this, please do it.
I recommend doing this earlier. Since it is incompatible, it may be too late closer to the upcoming release.
mame (Yusuke Endoh)
03:41 AM Feature #20274 (Closed): Add RubyVM::ASAN.enabled?
Applied in changeset commit:git|fe0b704df5553bdd59e90650ffbbfac785a2e48a.
----------
Skip assert_no_memory_leak when ASAN is enabled
ASAN greatly increases the memory footprint of Ruby, so these static
thresholds are not appropriate. T...
Anonymous
01:43 AM Bug #20090: Anonymous arguments are now syntax errors in unambiguous cases
I confirmed.
@naruse https://github.com/ruby/ruby/commit/f8f0d342e48a38caac6d32b438c145bb581a51e6 seems wrong commit. Should we revert it and apply https://github.com/ruby/ruby/commit/596db9c1f486d6609a4e97d82c8c71b54609fb6f again?
hsbt (Hiroshi SHIBATA)

02/27/2024

10:39 PM Feature #20309: Bundled gems for Ruby 3.5
> ruby -run is one of cool feature of Ruby. Should we avoid uninstalling un gem?
I think -run is kind of neat; it's a bit like a mini-DSL for the commandline.
(Having said that, I actually do not use it myself; I instead use a cust...
rubyFeedback (robert heiler)
10:16 PM Feature #20309 (Closed): Bundled gems for Ruby 3.5
I propose migrate the following default gems to bundled gems at Ruby 3.5. So, It means users will get warnings if users try to load them.
(Update with 2024/03/14, 2024/06/05, 2024/09/06)
* rdoc(done)
* We need to change build t...
hsbt (Hiroshi SHIBATA)
10:17 PM Misc #20281: DevMeeting-2024-03-14
* [Feature #20309] Bundled gems for Ruby 3.5
* Let's discuss target gems to migrate bundled gems.
hsbt (Hiroshi SHIBATA)
01:36 PM Misc #20281: DevMeeting-2024-03-14
* [Feature #19744] Namespace on read
* The branch under development: https://github.com/tagomoris/ruby/pull/2
* I want to demonstrate the current features and behaviors
* I need feedback about what is missing for further discussions
tagomoris (Satoshi Tagomori)
12:36 PM Misc #20281: DevMeeting-2024-03-14
* [Feature #14066] Add CAA DNS RR on Resolv (dentarg)
* Proposed patch: https://github.com/ruby/ruby/pull/1732
* Is there anything blocking this from being upstreamed into ruby? CAA is a fairly standard and widely adopted DNS record ...
dentarg (Patrik Ragnarsson)
09:39 PM Feature #20300: Hash: set value and get pre-existing value in one call
`#get_and_transform` could be a name for the version with the block, if performance is impacted significantly. matheusrich (Matheus Richard)
09:30 PM Feature #20300: Hash: set value and get pre-existing value in one call
@matheusrich Thanks for putting together that list!
In general, I like the idea of having this method support an optional block, but we would need to benchmark it to ensure it doesn't have an undesired slow down in the `exchange_value(:...
AMomchilov (Alexander Momchilov)
05:34 PM Feature #20300: Hash: set value and get pre-existing value in one call
Some other examples from other languages:
- [Java](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#put-K-V-) and [Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/put.html) call this `...
matheusrich (Matheus Richard)
04:46 PM Feature #20300: Hash: set value and get pre-existing value in one call
@matheusrich I like that name in general, but it's really similar to the existing [`Hash#store`](https://ruby-doc.org/3.3.0/Hash.html#method-i-store) and the distinction is non-obvious.
Swift calls this [`updateValue(_:forKey:)`](http...
AMomchilov (Alexander Momchilov)
04:42 PM Feature #20300: Hash: set value and get pre-existing value in one call
Rust [calls this method `insert`](https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.insert):
> Inserts a key-value pair into the map.
> ...
> ```
matheusrich (Matheus Richard)
08:05 PM Feature #20298: Introduce `Time()` type-cast / constructor.
I would like to register a dissenting opinion about the protocol :)
I believe that `ClassName()` convention, while old, is one of the clumsy parts of the Ruby API: it is kinda the only place where two absolutely unrelated things (a me...
zverok (Victor Shepelev)
07:30 PM Feature #20275: Avoid extra backtrace entries for rescue and ensure
JRuby also does not have a separate frame for rescues and ensures and we support removing these entries from backtraces. headius (Charles Nutter)
03:57 AM Feature #20275: Avoid extra backtrace entries for rescue and ensure
I agree with removing `ensure in` and `rescue in` entries from backtraces.
Matz.
matz (Yukihiro Matsumoto)
04:51 PM Bug #20308 (Closed): `it` and numbered parameters do not work in `eval`
kddnewton (Kevin Newton)
04:51 PM Bug #20308: `it` and numbered parameters do not work in `eval`
Ahh! Thank you @jeremyevans0 and @alanwu I knew there must have been a reason. I'll close this. kddnewton (Kevin Newton)
04:48 PM Bug #20308: `it` and numbered parameters do not work in `eval`
Looks like it's a known limitation and discussed before in #18837. alanwu (Alan Wu)
04:45 PM Bug #20308: `it` and numbered parameters do not work in `eval`
My understanding is the parse.y behavior is expected, because use of `_1`/`it` inside the block changes the block's arity:
```ruby
lambda{it}.arity
# => 1
lambda{eval('it')}.arity
# => 0
```
So if we supported `eval('it')` in ...
jeremyevans0 (Jeremy Evans)
04:33 PM Bug #20308: `it` and numbered parameters do not work in `eval`
Interesting behavior. I'd expect that to work since other "kinds of arguments" work:
```rb
def foo(*)
eval "puts(*)"
end
def foo(**)
eval "puts(**)"
end
def foo(...)
eval "puts(...)"
end
```
matheusrich (Matheus Richard)
01:35 PM Bug #20308 (Closed): `it` and numbered parameters do not work in `eval`
I am not sure if this is a purposeful restriction or not, so I apologize if this is not a "bug" per se.
Currently if you use `it` or `_1` (numbered parameters) in `eval` they do not work with `compile.c`:
```
irb(main):001> 1.tap ...
kddnewton (Kevin Newton)
03:57 PM Bug #20090: Anonymous arguments are now syntax errors in unambiguous cases
@nobu I hate to bother you as well, but I just want to make sure someone sees this before Ruby 3.3.1 is cut. eliotp123 (Eliot Partridge)
05:51 AM Bug #20302 (Closed): Multiple refinements cannot be applied to the same module
Applied in changeset commit:git|d50f9ca2dd416d92152cd958b5f39496088481b0.
----------
[Bug #20302] Multiple refinements cannot be applied to the same module
In the following code, the iclass tree of refinements in cref should be <iclass...
shugo (Shugo Maeda)
05:51 AM Bug #20305 (Closed): commit 1d2d25dcadda0764f303183ac091d0c87b432566 breaks grapheme_clusters
Applied in changeset commit:git|3a04ea2d0379dd8c6623c2d5563e6b4e23986fae.
----------
[Bug #20305] Fix matching against an incomplete character
When matching against an incomplete character, some `enclen` calls are
expected not to excee...
nobu (Nobuyoshi Nakada)
04:46 AM Bug #20307: `Hash#update` from compare_by_identity hash can have unfrozen string keys
https://github.com/ruby/ruby/pull/10099 nobu (Nobuyoshi Nakada)
03:33 AM Bug #20307 (Closed): `Hash#update` from compare_by_identity hash can have unfrozen string keys
I don't think this behavior is expected.
```ruby
i = Hash.new.compare_by_identity
k = "a"
i[k] = 0
h = {}.update(i)
p h.compare_by_identity? # => false
p h["a"] # => 0
k.upcase!
# `k` is still in `h`.
p h....
nobu (Nobuyoshi Nakada)
03:17 AM Misc #20035 (Closed): Command-line settings move from parser to compiler
kddnewton (Kevin Newton)
01:25 AM Bug #5179 (Closed): Complex#rationalize and to_r with approximate zeros
Applied in changeset commit:git|54a5b829442eb7ed1f4a2794ebb26696cf784e64.
----------
Handle zero-like imaginary part as zero in to_r (#9581)
Fixes [Bug #5179]
Anonymous

02/26/2024

08:13 PM Feature #20290 (Closed): Add API for C extensions to free memory
I opened #20306 to succeed this ticket. peterzhu2118 (Peter Zhu)
03:51 PM Feature #20290: Add API for C extensions to free memory
> There already is ruby_vm_at_exit(). What's wrong with that?
I didn't know that ruby_vm_at_exit exists. I think ruby_vm_at_exit can do everything in this feature. I might close this ticket in that case.
peterzhu2118 (Peter Zhu)
08:12 PM Feature #20306 (Closed): Add rb_free_at_exit_p
GitHub PR: https://github.com/ruby/ruby/pull/10104
From ticket [#20290](https://bugs.ruby-lang.org/issues/20290#note-6), I found that C extensions could use ruby_vm_at_exit to register hooks to free memory at shutdown. However, they c...
peterzhu2118 (Peter Zhu)
07:28 PM Bug #20305: commit 1d2d25dcadda0764f303183ac091d0c87b432566 breaks grapheme_clusters
I added a failing test to reproduce this issue in this PR: https://github.com/ruby/ruby/pull/10103 fablestales (Fable Tales)
07:02 PM Bug #20305: commit 1d2d25dcadda0764f303183ac091d0c87b432566 breaks grapheme_clusters
fablestales (Fable Tales) wrote:
> given a script:
> ...
to clarify: grapheme_clusters used to ignore partial characters from a byteslice, now it does not.
fablestales (Fable Tales)
06:58 PM Bug #20305 (Closed): commit 1d2d25dcadda0764f303183ac091d0c87b432566 breaks grapheme_clusters
given a script:
```
#script.rb
p "안녕".byteslice(0, 4).grapheme_clusters
```
The commit 1d2d25dcadda0764f303183ac091d0c87b432566 (https://github.com/ruby/ruby/commit/1d2d25dcadda0764f303183ac091d0c87b432566) breaks the grapheme_clu...
fablestales (Fable Tales)
05:37 PM Bug #20301: `Set#add?` does two hash look-ups
I don't mind it @Dan0042, but that's a secondary issue IMO. The block call defeats the benefit of this optimization. It'll even slow down the case where you're looking up pre-existing objects (that's currently net-even perf after these c... AMomchilov (Alexander Momchilov)
03:42 PM Bug #20301: `Set#add?` does two hash look-ups
@Dan0042 That's related to #17342 then, and also known as `compute_if_absent` in [concurrent-ruby](https://ruby-concurrency.github.io/concurrent-ruby/1.1.5/Concurrent/Map.html#compute_if_absent-instance_method). Eregon (Benoit Daloze)
03:31 PM Bug #20301: `Set#add?` does two hash look-ups
Now I understand why you proposed #20300 Hash#update_value
However I'd like to suggest an alternative approach for your consideration:
```ruby
def add?(k)
added = false
@hash.add(k){ added = true } #call block only if k not in @has...
Dan0042 (Daniel DeLorme)
02:42 AM Bug #20301 (Open): `Set#add?` does two hash look-ups
A common usage of `Set`s is to keep track of seen objects, and do something different whenever an object is seen for the first time, e.g.:
```ruby
SEEN_VALUES = Set.new

def receive_value(value)
if SEEN_VALUES.add?(value)
put...
AMomchilov (Alexander Momchilov)
04:21 PM Feature #20300: Hash: set value and get pre-existing value in one call
In my mind, `get_and_set` is clear as it is in the order the operations are done.
But if you want clearer, `get_then_set` puts emphasis on the order.
Things like `exchange` and `swap` can sound like swapping the value between two k...
MaxLap (Maxime Lapointe)
10:38 AM Feature #20300: Hash: set value and get pre-existing value in one call
Not so sure about these names. Note that get_and_set() may have people wonder why it is not set_and_get(). :D
In regards to .update_value() people could ask why the old value is returned rather than the new one.
I guess **exchange_valu...
rubyFeedback (robert heiler)
10:16 AM Feature #20300: Hash: set value and get pre-existing value in one call
FWIW, concurrent-ruby calls this `get_and_set`: https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Map.html#get_and_set-instance_method
`Hash#exchange_value` sounds fine to me too.
Eregon (Benoit Daloze)
04:18 AM Feature #20300: Hash: set value and get pre-existing value in one call
The name `update_value` doesn't feel to return the previous value, to me.
What about `Hash#exchange_value`?
nobu (Nobuyoshi Nakada)
02:42 AM Feature #20300 (Open): Hash: set value and get pre-existing value in one call
When using a Hash, sometimes you want to set a new value, **and** see what was already there. Today, you **have** to do this in two steps:
```ruby
h = { k: "old value" }
# 1. Do a look-up for `:k`.
old_value = h[:k]
# 2. Do anot...
AMomchilov (Alexander Momchilov)
03:55 PM Feature #17342: Hash#fetch_set
It's confusing that this ticket, #17342, is striked out even though the status is "Feedback".
Another name for this could be `Hash#add`; at least that's the terminology used in memcached and I believe some other caching servers.
Dan0042 (Daniel DeLorme)
03:40 PM Bug #20206 (Closed): PTY.spawn seems to fail to capture the output of "echo foo" once in a while
jeremyevans0 (Jeremy Evans)
03:34 PM Bug #20206: PTY.spawn seems to fail to capture the output of "echo foo" once in a while
Changing the command to `"echo 'foo'"` or `"stdbuf -i0 -o0 -e0 echo foo"` doesn't reproduce the failure.
So this could very much be caused by buffering issues on the terminal side and not a bug in ruby. I think we can close this issue.
lacostej (Jerome Lacoste)
03:39 PM Bug #20304: Memory leak when setting Encoding.default_internal
Ah, thank you! I would have expected that to be in 3.3-head too. MaxLap (Maxime Lapointe)
02:55 PM Bug #20304 (Closed): Memory leak when setting Encoding.default_internal
This was fixed in: https://github.com/ruby/ruby/pull/9409 peterzhu2118 (Peter Zhu)
02:28 PM Bug #20304 (Closed): Memory leak when setting Encoding.default_internal
Problem is present in Ruby 3.2.2, 3.2.3, 3.3.0. Didn't check before.
Put this in a file:
```
10.times do
100000.times do
Encoding.default_internal = nil
end
puts `ps -o rss= -p #{$$}`.to_i
end
```
Result:
```...
MaxLap (Maxime Lapointe)
10:10 AM Bug #20302 (Closed): Multiple refinements cannot be applied to the same module
If we are using multiple refinements for the Kernel module, it seems that only the last refinement is enabled.
In the following example, we can call `f2` of M2, which is enabled later. but cannot call `f1` of M1.
```ruby
module M1
...
mame (Yusuke Endoh)
05:55 AM Feature #20108 (Closed): Introduction of Happy Eyeballs Version 2 (RFC8305) in Socket.tcp
This proposal has been merged at https://github.com/ruby/ruby/commit/9ec342e07df6aa5e2c2e9003517753a2f1b508fd hsbt (Hiroshi SHIBATA)
05:46 AM Feature #20108: Introduction of Happy Eyeballs Version 2 (RFC8305) in Socket.tcp

As previously posted, I was considering a way to avoid name resolution within a thread when the host is single-stack.
However, it's clear that it will take a significant cost to associate with determining whether the host is single-s...
shioimm (Misaki Shioi)
03:23 AM Bug #20299: Tracepoint staying enable after a disable
And here is a similar problem, using only the block form (no calls to disable):
```
def check_speed(msg = nil)
t1 = Time.now.to_f
a = 0
1000000.times { |i|
a += 10
}
t2 = Time.now.to_f
puts "#{t2-t1} - #{msg}"
...
MaxLap (Maxime Lapointe)
01:06 AM Bug #20299 (Open): Tracepoint staying enable after a disable
Problem is present in Ruby 3.2.2, 3.2.3, 3.3.0. Didn't check before.
It seems that TracePoint can sometime be "stuck" enabled after using disabled once on it.
Here is a reproduction step using a "check speed" method that just does ...
MaxLap (Maxime Lapointe)
02:56 AM Bug #20296 (Closed): Complex(:sym, exception: false) generate exception with weird timing
Applied in changeset commit:git|dc146babf47a84bbd1f176d766637d4a40327019.
----------
[Bug #20296] Clear errinfo when `exception: false`
nobu (Nobuyoshi Nakada)
12:34 AM Feature #20298 (Open): Introduce `Time()` type-cast / constructor.
Many Ruby primitive types have constructors, e.g. `Integer(...)`, `String(...)`, `Float(...)`, etc. These usually convert from some subset of types, e.g. `Float(1) -> 1.0` will convert an Integer to a Float, and `Float("1") -> 1.0` will ... ioquatix (Samuel Williams)
 

Also available in: Atom