Issue #20261 has been reported by burdettelamar (Burdette Lamar).
----------------------------------------
Feature #20261: Add symbol alternatives to '' and nil for IO line separators
https://bugs.ruby-lang.org/issues/20261
* Author: burdettelamar (Burdette Lamar)
* Status: Open
* Priority: Normal
----------------------------------------
For IO's line-oriented read methods, there are two special values for the line-separator argument `sep`; I'm proposing to add (user-friendlier) symbol synonyms for those values:
- `:paragraph` as synonym for `''` (read paragraphs).
- `:slurp` as synonym for `nil` (read all).
Details (code, documentation, tests) may be seen at https://github.com/ruby/ruby/pull/9921.
--
https://bugs.ruby-lang.org/
Issue #20310 has been reported by kjtsanaktsidis (KJ Tsanaktsidis).
----------------------------------------
Bug #20310: ASAN fake stacks need to be marked during GC for non-current execution context
https://bugs.ruby-lang.org/issues/20310
* Author: kjtsanaktsidis (KJ Tsanaktsidis)
* Status: Assigned
* Assignee: kjtsanaktsidis (KJ Tsanaktsidis)
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
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-use-after-return ("fake stacks"). A pointer to the fake stack is left on the real machine stack, so it's possible to discover these fake stacks during GC and mark locals stored there as well.
At the moment, Ruby is currently marking these fake stacks for the current execution context which triggered GC, as part of `mark_current_machine_context`: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/…. However, there are other machine stacks which also need to be marked like this:
* Machine stacks for other threads which did not trigger GC are marked in `rb_execution_context_mark` here: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/…
* Machine stacks for fibers are marked in `cont_mark` here: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/…
We need to make these two kinds of stacks perform the same ASAN fake stack marking as `mark_current_machine_context` does.
(P.S. - `callcc` continuations are another kind of machine stack which get marked, but ASAN is not compatible with callcc, so this doesn't really matter).
(P.S. - it appears to me that the currently-switched-to fiber will have its stack marked _twice_; once in `rb_execution_context_mark` or `mark_current_machine_context, and once in `cont_mark`; if this is true, I will fix this too)
--
https://bugs.ruby-lang.org/
Issue #20306 has been reported by peterzhu2118 (Peter Zhu).
----------------------------------------
Feature #20306: Add rb_free_at_exit_p
https://bugs.ruby-lang.org/issues/20306
* Author: peterzhu2118 (Peter Zhu)
* Status: Open
----------------------------------------
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 cannot determine whether they should free all memory during shutdown to mirror the behavior of Ruby when RUBY_FREE_AT_EXIT is set.
This ticket proposes a new API called rb_free_at_exit_p that returns true when RUBY_FREE_AT_EXIT is set, and false otherwise.
--
https://bugs.ruby-lang.org/
Issue #20265 has been reported by peterzhu2118 (Peter Zhu).
----------------------------------------
Feature #20265: Deprecate and remove rb_newobj and rb_newobj_of
https://bugs.ruby-lang.org/issues/20265
* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
----------------------------------------
GitHub PR: https://github.com/ruby/ruby/pull/9964
I’m proposing deprecating and removing the rb_newobj and rb_newobj_of APIs because they are difficult to use, fragile to use, and requires knowledge of the internal implementation of data types in Ruby.
The rb_newobj function creates a T_NONE object. T_NONE objects are tricky to deal with since T_NONE objects cannot be marked, T_NONE objects are not reclaimed by the GC, and changing the object to other types require internal knowledge about the data type.
T_NONE objects are not allowed to be marked, so it cannot be GC managed. Since T_NONE objects are skipped during sweeping, it will leak Ruby heap memory if the developer never changes the object to another type.
Changing a T_NONE object to another type is tricky. For example, T_STRING objects have many flags for embedded, shared, shared root, encoding, coderange, etc. Many of these flags are not public, preventing direct use by developers. Developers must understand these flags to convert a T_NONE object into a T_STRING object.
While the rb_newobj_of function is easier to use than the rb_newobj function, it still requires developers to understand flags, meaning some issues of rb_newobj also apply to rb_newobj_of.
Below is the usage of RB_NEWOBJ, rb_newobj, rb_newobj_of, RB_NEWOBJ_OF with vendored Ruby and comments removed. You can see that there are very few gems using these APIs and all are from over a decade ago (the most recent one is from 2011).
```
2009-11-18 /srv/gems/bleak_house-7.2/ruby/ruby-1.8.7.patch:@@ -438,10 +438,8 @@ rb_newobj()
2023-07-01 /srv/gems/daqing_rucaptcha-3.2.2/ext/rucaptcha/target/release/build/rb-sys-6bdd5b2895b9570a/out/bindings-0.9.78-arm64-darwin22-3.2.2.rs: pub fn rb_newobj() -> VALUE;
2023-07-01 /srv/gems/daqing_rucaptcha-3.2.2/ext/rucaptcha/target/release/build/rb-sys-6bdd5b2895b9570a/out/bindings-0.9.78-arm64-darwin22-3.2.2.rs: pub fn rb_newobj_of(klass: VALUE, flags: VALUE) -> VALUE;
2010-08-06 /srv/gems/langscan-1.2/ext/langscan/ruby/compat/ripper/ripper.c: NODE *n = (NODE*)rb_newobj();
2011-02-03 /srv/gems/memprof-0.3.10/ext/memprof.c: VALUE ret = rb_newobj();
2011-02-03 /srv/gems/memprof-0.3.10/ext/tracers/objects.c: last_obj = orig_rb_newobj();
2006-02-28 /srv/gems/refe-0.8.0.3/data/refe/function_source/rb/newobj:rb_newobj()
2006-02-28 /srv/gems/refe-0.8.0.3/data/refe/function_source/rb/node/newnode: NODE *n = (NODE*)rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/dependency.c: prov = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/dependency.c: req = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/dependency.c: conf = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/dependency.c: obso = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/file.c: file = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/source.c: src = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/source.c: src = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/source.c: src = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/version.c: ver = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/version.c: ver = rb_newobj();
2011-08-31 /srv/gems/ruby-rpm-1.3.1/ext/rpm/version.c: ver = rb_newobj();
2006-11-30 /srv/gems/sydparse-1.2.0/sydparse.c: syd_scope = (struct SCOPE*)rb_newobj();
2006-11-30 /srv/gems/sydparse-1.2.0/sydparse.y: syd_scope = (struct SCOPE*)rb_newobj();
```
--
https://bugs.ruby-lang.org/
Issue #20202 has been reported by matheusrich (Matheus Richard).
----------------------------------------
Feature #20202: Memoized endless method definitions
https://bugs.ruby-lang.org/issues/20202
* Author: matheusrich (Matheus Richard)
* Status: Open
* Priority: Normal
----------------------------------------
I propose introducing a shorthand for memoized endless method definitions:
```rb
class Foo
def bar ||= :memoized_value
# It should behave like
def bar = (@bar ||= :memoized_value)
end
```
Not only is this shorter and (IMO) a natural follow-up for endless method definitions, but it's also a common pattern on Ruby codebases. It's very useful to decompose responsibilities into several objects:
```rb
class User
def notifications_enabled? = settings.notifications?
def enable_notifications = (settings.notifications = true)
def disable_notifications = (settings.notifications = false)
private
def settings = @settings ||= Settings.new(self)
end
class User::Settings
attr_writer :notifications
def initialize(user)
@user = user
@notifications = false
end
def notifications? = @notifications
end
u = User.new
u.notifications_enabled? # => false
u.enable_notifications
u.notifications_enabled? # => true
```
In the example, the `settings` method could be rewritten as
```rb
def settings ||= Settings.new(self)
```
--
https://bugs.ruby-lang.org/
Issue #20293 has been reported by nobu (Nobuyoshi Nakada).
----------------------------------------
Feature #20293: Add `Warning.categories` method that returns the warning category names
https://bugs.ruby-lang.org/issues/20293
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
----------------------------------------
I propose a new method `Warning.categories`.
This would be useful (or necessary) for tests mainly.
Currently, `EnvUtil.capture_global_values` saves the original warning settings as followings:
```ruby
@original_warning = defined?(Warning.[]) ? %i[deprecated experimental].to_h {|i| [i, Warning[i]]} : nil
```
But this is wrong now; `performance` is missing.
So we need:
```ruby
@original_warning = if defined?(Warning.[]) # 2.7+
%i[deprecated experimental performance].to_h do |i|
[i, begin Warning[i]; rescue ArgumentError; end]
end.compact
end
```
That means this list is version dependent and we will need to maintain this list in future.
We need another surefire way.
--
https://bugs.ruby-lang.org/
Issue #20224 has been reported by yui-knk (Kaneko Yuichiro).
----------------------------------------
Bug #20224: Backport https://github.com/ruby/ruby/pull/9634 to Ruby 3.3
https://bugs.ruby-lang.org/issues/20224
* Author: yui-knk (Kaneko Yuichiro)
* Status: Closed
* Priority: Normal
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
It's nice if we can backport https://github.com/ruby/ruby/pull/9634 (3d19409637de1462b6790d2a92344bf0a10d8c52) to Ruby 3.3 branch.
Even so previous codes work as expected but it depends on how parse.c works and misleading.
--
https://bugs.ruby-lang.org/
Issue #19231 has been reported by andrykonchin (Andrew Konchin).
----------------------------------------
Bug #19231: Integer#step and Float::INFINITY - inconsistent behaviour when called with and without a block
https://bugs.ruby-lang.org/issues/19231
* Author: andrykonchin (Andrew Konchin)
* Status: Open
* Priority: Normal
* ruby -v: 3.1.2
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The initial issue was reported here https://github.com/oracle/truffleruby/issues/2797.
`0.step(Float::INFINITY, 10)` returns:
- `Integers` when called with a block
- `Floats` when called without a block
I would expect `Floats` to be returned in both cases.
Examples:
```ruby
0.step(100.0, 10).take(1).map(&:class)
# => [Float]
```
```ruby
0.step(Float::INFINITY, 10) { |offset| p offset.class; break }
# Integer
```
When `to` argument is a finite `Float` value then calling with a block returns `Floats` as well:
```ruby
0.step(100.0, 10) { |offset| p offset.class; break }
# Float
```
Wondering whether it's intentional behaviour.
I've found a related issue https://bugs.ruby-lang.org/issues/15518.
--
https://bugs.ruby-lang.org/
Issue #20281 has been reported by mame (Yusuke Endoh).
----------------------------------------
Misc #20281: DevMeeting-2024-03-14
https://bugs.ruby-lang.org/issues/20281
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
----------------------------------------
# The next dev meeting
**Date: 2024/03/14 13:00-17:00** (JST)
Log: *TBD*
- Dev meeting *IS NOT* a decision-making place. All decisions should be done at the bug tracker.
- Dev meeting is a place we can ask Matz, nobu, nurse and other developers directly.
- Matz is a very busy person. Take this opportunity to ask him. If you can not attend, other attendees can ask instead of you (if attendees can understand your issue).
- We will write a record of the discussion in the file or to each ticket in English.
- All activities are best-effort (keep in mind that most of us are volunteer developers).
- The date, time and place of the meeting are scheduled according to when/where we can reserve Matz's time.
- *DO NOT* discuss then on this ticket, please.
# Call for agenda items
If you have a ticket that you want matz and committers to discuss, please post it into this ticket in the following format:
```
* [Ticket ref] Ticket title (your name)
* Comment (A summary of the ticket, why you put this ticket here, what point should be discussed, etc.)
```
Example:
```
* [Feature #14609] `Kernel#p` without args shows the receiver (ko1)
* I feel this feature is very useful and some people say :+1: so let discuss this feature.
```
- It is recommended to add a comment by 2024/03/11. We hold a preparatory meeting to create an agenda a few days before the dev-meeting.
- The format is strict. We'll use [this script to automatically create an markdown-style agenda](https://gist.github.com/mame/b0390509ce1491b43610b9ebb665eb86). We may ignore a comment that does not follow the format.
- Your comment is mandatory. We cannot read all discussion of the ticket in a limited time. We appreciate it if you could write a short summary and update from a previous discussion.
--
https://bugs.ruby-lang.org/