Issue #19849 has been reported by p8 (Petrik de Heus).
----------------------------------------
Bug #19849: Requiring file with autoload results in confusing error if file doesn't exist
https://bugs.ruby-lang.org/issues/19849
* Author: p8 (Petrik de Heus)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
Given the following file:
```ruby
# example.rb
require_relative 'autoload_example.rb'
Example.new
```
and the constant `Example` is defined using autoload, with an unknown path:
```ruby
# autoload_example.rb
autoload "Example", "path_unknown"
```
Running `ruby example.rb` results in the following error:
```
<internal:~/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- path_unknown (LoadError)
from <internal:~/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from example.rb:1:in `<main>'
```
The error is somewhat confusing as it doesn't show the location of the `autoload` which caused the error.
--
https://bugs.ruby-lang.org/
Issue #19850 has been reported by ngan (Ngan Pham).
----------------------------------------
Bug #19850: Get thread creation time
https://bugs.ruby-lang.org/issues/19850
* Author: ngan (Ngan Pham)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
I was debugging some threads hanging issue and thought it would be nice to know how long a thread has been around for. Would there be interest in a `Thread#creation_time` (or some other name) that returns the time when the thread was created?
--
https://bugs.ruby-lang.org/
Issue #19832 has been reported by sawa (Tsuyoshi Sawada).
----------------------------------------
Feature #19832: Method#destructive?, UnboundMethod#destructive?
https://bugs.ruby-lang.org/issues/19832
* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
----------------------------------------
I propose to add `destructive?` property to `Method` and `UnboundMethod` instances, which shall behave like:
```ruby
String.instance_method(:<<).destructive? # => true
String.instance_method(:+).destructive? # => false
```
One main purpose of using these classes is to inspect and make sure how a certain method behaves. Besides arity and owner, whether a method is destructive or not is one important piece of information, but currently, you cannot achieve that from `Method` or `UnboundMethod` instances.
--
https://bugs.ruby-lang.org/
Issue #19858 has been reported by mame (Yusuke Endoh).
----------------------------------------
Misc #19858: DevMeeting-2023-09-14
https://bugs.ruby-lang.org/issues/19858
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
----------------------------------------
# The next dev meeting
**Date: 2023/09/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 2023/09/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/
Issue #19737 has been reported by unasuke (Yusuke Nakamura).
----------------------------------------
Feature #19737: Add `IO::Buffer#cat` for concat `IO::Buffer` instances
https://bugs.ruby-lang.org/issues/19737
* Author: unasuke (Yusuke Nakamura)
* Status: Open
* Priority: Normal
----------------------------------------
## motivation
In my use case, I want to concat two IO::Buffer instances. But current implementation doesn't have that way.
Then I created a patch. Opend here: TBD
## concern
I have two concerns about it.
### 1. Should we provide `IO::Buffer#+` as an alias?
In String instance, `"a" + "b"` returns `"ab",`. It feels intuitive.
So, should we provide the same way as `IO::Buffer.for("a") + IO::Buffer.for("b")`?
If `+` is provided, I naturally assume that `*` is also provided as an operator.
Should we also provide an `IO::Buffer#*` method for symmetry with the String class?
I thought the behavior of the "*" method is not obvious to me... (Is it right to just return joined buffers?)
### 2. Should it accept multiple IO::Buffer instances?
In the `cat` command, it accepts multiple inputs like this.
```
$ cat a.txt b.txt c.txt
a
b
c
```
Should `IO::Buffer#cat` accept multiple inputs too?
--
https://bugs.ruby-lang.org/
Issue #19790 has been reported by byroot (Jean Boussier).
----------------------------------------
Feature #19790: Optionally write Ruby crash reports into a file rather than STDERR
https://bugs.ruby-lang.org/issues/19790
* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
### Use case
On our servers we set [`/proc/sys/kernel/core_pattern`](https://man7.org/linux/man-pages/man5/core.5.html) to point to a small utility that report all the crashes happening in production with the associated core dump into BugSnag.
This allowed us to find and fix many Ruby and native extensions bugs in the last few years.
However, these are hard to triage, so we'd like to augment these crash reports with the output of `rb_vm_bugreport()`.
### Problem
`rb_vm_bugreport()` is hard coded to print to STDERR, this makes it hard to extract and parse the report in a production environment, as very often STDERR is shared with other processes, so the crash report is intertwined with logs from other processes.
### Feature Request
It would be very useful if Ruby could write the crash report to an arbitrary path rather than STDERR, akin to `kernel/core_pattern`.
Especially it would be useful if it supported interpolating the crashing process PID with `%p` like `kernel/core_pattern`, as it would make it easier to map that report with the core file.
This could be controller by an environment variable such as `RUBY_BUGREPORT_PATH`. e.g.
```
RUBY_BUGREPORT_PATH=/var/log/ruby/ruby-crash-pid-%p.log
```
### Optional Features
`kernel/core_pattern` supports other interpolations, however not all of them would make sense for Ruby to support.
%% A single % character.
%c Core file size soft resource limit of crashing process
(since Linux 2.6.24).
%d Dump mode—same as value returned by prctl(2)
PR_GET_DUMPABLE (since Linux 3.7).
%e The process or thread's comm value, which typically is
the same as the executable filename (without path prefix,
and truncated to a maximum of 15 characters), but may
have been modified to be something different; see the
discussion of /proc/pid/comm and /proc/pid/task/tid/comm
in proc(5).
%E Pathname of executable, with slashes ('/') replaced by
exclamation marks ('!') (since Linux 3.0).
%g Numeric real GID of dumped process.
%h Hostname (same as nodename returned by uname(2)).
%i TID of thread that triggered core dump, as seen in the
PID namespace in which the thread resides (since Linux
3.18).
%I TID of thread that triggered core dump, as seen in the
initial PID namespace (since Linux 3.18).
%p PID of dumped process, as seen in the PID namespace in
which the process resides.
%P PID of dumped process, as seen in the initial PID
namespace (since Linux 3.12).
%s Number of signal causing dump.
%t Time of dump, expressed as seconds since the Epoch,
1970-01-01 00:00:00 +0000 (UTC).
%u Numeric real UID of dumped process.
Additionally, if `kernel/core_pattern` starts with a pipe (`|`), then it allows to pipe the core dump to another program, this may also make sense as a feature.
### Prior Art
Aside from `kernel/core_pattern`, some other virtual machine have a similar feature, for instance the JVM has a configurable crash report:
```
-XX:ErrorFile=/var/log/java/hs_err_pid%p.log
```
--
https://bugs.ruby-lang.org/
Issue #19844 has been reported by narine_moss(a)yahoo.com (Narine Mossikyan).
----------------------------------------
Bug #19844: Ruby 3.2 fails to build with openssl version 3
https://bugs.ruby-lang.org/issues/19844
* Author: narine_moss(a)yahoo.com (Narine Mossikyan)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
Ruby version 3.2 code base: https://github.com/ruby/ruby/tree/1c7624469880bcb964be09a49e4907873f45b026
openssl v3 is installed under /usr/local_ssl_3.0.0.
./configure --with-openssl-dir=/usr/local_ssl_3.0.0
I get the following error when running make:
openssl_missing.c:24:13: error: dereferencing pointer to incomplete type ‘X509_CRL {aka const struct X509_crl_st}’
*psig = crl->signature;
^~
openssl_missing.c: In function ‘ossl_X509_REQ_get0_signature’:
openssl_missing.c:36:13: error: dereferencing pointer to incomplete type ‘X509_REQ {aka const struct X509_req_st}’
*psig = req->signature;
^~
I am trying to build ruby 3.2 with openssl version 3 to install it on ubuntu 22 that only has openssl v3. Can you advise me how to configure ruby to bypass this error?
--
https://bugs.ruby-lang.org/
Issue #19765 has been reported by Ethan (Ethan -).
----------------------------------------
Bug #19765: Ractor.make_shareable ignores self of a proc created from a Method
https://bugs.ruby-lang.org/issues/19765
* Author: Ethan (Ethan -)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-07-12T00:26:03Z master dfe782be17) [x86_64-darwin21]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
An unshareable receiver of a Proc or a Method will cause make_shareable to error, but this does not happen with a proc from Method#to_proc:
```ruby
str = ""
a = str.instance_exec { proc { to_s } }
Ractor.make_shareable a
# => <internal:ractor>:820:in `make_shareable': Proc's self is not shareable: #<Proc:0x00000001064b62c8 (irb):1> (Ractor::IsolationError)
b = str.instance_exec { method(:to_s) }
Ractor.make_shareable b
# => <internal:ractor>:820:in `make_shareable': can not make shareable object for #<Method: String#to_s()> (Ractor::Error)
c = str.instance_exec { method(:to_s).to_proc }
Ractor.make_shareable c
c.call
# => ""
str[0] = "!"
c.call
# => "!"
```
Related, maybe:
#19372
#19374
Tangential: why does Proc cause Ractor::IsolationError but Method causes Ractor::Error?
--
https://bugs.ruby-lang.org/
Issue #19788 has been reported by thyresias (Thierry Lambert).
----------------------------------------
Bug #19788: Ripper returns a symbol instead of a token as operator for "::"
https://bugs.ruby-lang.org/issues/19788
* Author: thyresias (Thierry Lambert)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
```ruby
require 'ripper'
class BasicParser < Ripper
EVENTS.each do |event|
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
puts "#{event}(\#{args.inspect})"
args.unshift :#{event}
args
end
RUBY
end
end
require 'pp'
BasicParser.new('a&.b').parse
# in stdout:
# ident(["a"])
# op(["&."])
# vcall([[:ident, "a"]])
# ident(["b"])
# call([[:vcall, [:ident, "a"]], [:op, "&."], [:ident, "b"]])
BasicParser.new('a::b').parse
# in stdout:
# ident(["a"])
# op(["::"])
# vcall([[:ident, "a"]])
# ident(["b"])
# call([[:vcall, [:ident, "a"]], :"::", [:ident, "b"]])
```
On the last line, consistent with `&.`, I would have expected:
```ruby
# call([[:vcall, [:ident, "a"]], [:op, "::"], [:ident, "b"]])
```
This is true for the "operator" argument of `call`, `command_call` and `field`.
Is it intended?
--
https://bugs.ruby-lang.org/
Issue #19837 has been reported by kjtsanaktsidis (KJ Tsanaktsidis).
----------------------------------------
Bug #19837: Concurrent calls to Process.waitpid2 misbehave on Ruby 3.1 & 3.2
https://bugs.ruby-lang.org/issues/19837
* Author: kjtsanaktsidis (KJ Tsanaktsidis)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.4p236 (2023-07-26 revision a8670865c0) [arm64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
On Ruby 3.1 & 3.2, if you have one thread blocked into a directed call to `Process.waitpid2` with a pid specified, a concurrent call to `Process.waitpid2 -1` will not be able to find & reap any other terminated child process, even one with a different pid that is not individually being waited on.
I've attached a Ruby program which should terminate but doesn't as a result of this bug, as well as a C program which demonstrates that the underlying syscalls (at least on Linux) do behave how you would expect. My reproduction creates two processes; a long-running process that does not exit, and a short one which does. There is a background thread calling `Process.waitpid2` on the long process. Then, a concurrent call to `Process.waitpid2 -1` does not notice that the short-running process has exited.
My `wait_bug.rb` program _does_ work properly and terminate on the current master branch of Ruby; I assume this is because all of the MJIT-related process management stuff with the waiting_pids & stuff has been cleaned up as part of the MJIT -> RJIT refactoring. Because of this, I'm not sure exactly how to make a patch; should I open a pair of PRs targeting the `ruby_3_2` and `ruby_3_1` branch?
Thanks!
---Files--------------------------------
wait_bug.c (1.55 KB)
wait_bug.rb (735 Bytes)
--
https://bugs.ruby-lang.org/