| Age | Commit message (Collapse) | Author |
|
https://bugs.ruby-lang.org/issues/21831
|
|
|
|
[PATCH] Fix sleep spurious wakeup from sigchld (#15802)
When sleeping with `sleep`, currently the main thread can get woken up from sigchld
from any thread (subprocess exited). The timer thread wakes up the main thread when this
happens, as it checks for signals. The main thread then executes the ruby sigchld handler
if one is registered and is supposed to go back to sleep immediately. This is not ideal but
it's the way it's worked for a while. In commit 8d8159e7d8 I added writes to `th->status`
before and after `wait_running_turn` in `thread_sched_to_waiting_until_wakeup`, which is
called from `sleep`. This is usually the right way to set the thread's status, but `sleep`
is an exception because the writes to `th->status` are done in `sleep_forever`. There's a
loop that checks `th->status` in `sleep_forever`. When the main thread got woken up from
sigchld it saw the changed `th->status` and continued to run the main thread instead of
going back to sleep.
The following script shows the error. It was returning instead of sleeping forever.
```ruby
t = Thread.new do
sleep 0.3
`echo hello` # Spawns subprocess
puts "Subprocess exited"
end
puts "Main thread sleeping..."
result = sleep # Should block forever
puts "sleep returned: #{result.inspect}"
```
Fixes [Bug #21812]
|
|
[PATCH] [Bug #21819] Data objects without members should also be frozen
|
|
[PATCH] [Bug #21814] Fix negative bignum modulo
If modulo is zero, do not apply bias even if the divisor is zero.
`BIGNUM_POSITIVE_P` is true even on bignum zero.
|
|
When requiring a file like "benchmark/ips", the warning system would
incorrectly warn about the "benchmark" gem not being a default gem,
even when the user has "benchmark-ips" (a separate third-party gem)
in their Gemfile.
The fix checks if a hyphenated version of the require path exists in
the bundle specs before issuing a warning. For example, requiring
"benchmark/ips" now checks for both "benchmark" and "benchmark-ips"
in the Gemfile.
[Bug #21828]
|
|
Without this change, classes (including iclass) are allocated
as un-boxable classes after initializing user boxes (after starting
script evaluation). Under this situation, iclasses are created as
un-boxabled class when core modules are included by a class in the
root box, then it causes problems because it's in the root box but
it can't have multiple classexts.
This change makes it possible to allocate boxable classes even after
initializing user boxes. Classes create in the root box will be
boxable, and those can have 2 or more classexts.
|
|
This reverts commit 31ff07ed1eb05d01f7da3c017d542137a3db1e94.
* Don't add a test which only runs on production release
* https://github.com/ruby/actions/actions/runs/20486784889/job/58870959976
* Don't add a new line to `ruby --help`
* https://github.com/ruby/ruby/pull/14142#issuecomment-3689829564
|
|
This reverts commit 9b576cd6255aba97e5e2f55f4b09f00c7dd0e839.
|
|
`Dir.mktmpdir` concatenates a random base-36 number separated by "-",
so may generate pathnames containing "-j2".
|
|
|
|
|
|
|
|
The return value of Module#set_temporary_name was changed
to return `self`, but the existing tests
did not verify this.
|
|
|
|
|
|
|
|
`Dir.mktmpdir` concatenates a random base-36 number separated by "-",
so may generate pathnames containing "-j4".
|
|
|
|
Shape tree pollution could cause this test to flake.
|
|
Defining ivars in initialize method guarantees the object to be embedded.
|
|
|
|
`Dir.mktmpdir` concatenates a random base-36 number separated by "-",
so may generate pathnames containing "-j4".
|
|
https://bugs.ruby-lang.org/issues/21785#note-10
> It is too late to introduce it in Ruby 4.0, let's aim for 4.1.
This reverts commits:
* d0b72429a93e54f1f956b4aedfc25c57dc7001aa
Add support for signed and unsigned LEB128 to pack/unpack.
* 68a900e30b4ca1537d7975c3a619fd94fca7b084
add news for pack / unpack directives
|
|
|
|
fragile
|
|
Previously, calling IO#flush or closing an IO with unflushed buffered
writes would just invoke `#blocking_operation_wait` and flush the write
buffer using a `write` syscall. This change adds flushing through the
fiber scheduler by invoking the `#io_write` hook.
* Prefer IO::Buffer#write in IOScheduler
* Use Dir.tmpdir for test file
* Correctly handle errors in io_flush_buffer_fiber_scheduler
|
|
This change fixes a bug in which specifying 0 for timeout-related options (such as the `timeout` option of `Addrinfo.getaddrinfo`) incorrectly results in an infinite wait.
(This change overwrites https://github.com/ruby/ruby/pull/15626 .)
|
|
Redo of https://github.com/ruby/prism/pull/3669 with more tests
https://github.com/ruby/prism/commit/48b403ea79
|
|
https://github.com/ruby/prism/commit/138db9ccc4
|
|
* assert_raise's 2nd argument is the failure message,
shown when the expected exception is not raised.
It's not the expected message.
See https://github.com/test-unit/test-unit/issues/347
https://github.com/ruby/prism/commit/e3df994d47
|
|
This commit adds a new pack format command `R` and `r` for unsigned and
signed LEB128 encoding. The "r" mnemonic is because this is a
"vaRiable" length encoding scheme.
LEB128 is used in various formats including DWARF, WebAssembly, MQTT,
and Protobuf.
[Feature #21785]
|
|
Since singleton classes are created lazily, we need to make sure that
we lock around their creation. Unfortunately, that means we need to
lock around every shareable object's call to `singleton_class`,
including classes and modules.
|
|
This reverts commit https://github.com/ruby/delegate/commit/fc2bd0498af0.
https://github.com/ruby/delegate/commit/7d5c1e0842
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
|
|
Tempfile uses DelegateClass and Tempfile should be able to be used
by different ractors.
https://github.com/ruby/delegate/commit/cad194260b
|
|
This allows these methods to be called from ractors.
Add new exported function `rb_vm_lock_with_barrier()` that requires
users to include "vm_sync.h"
|
|
snippets
Even with Ruby 4.0, snippets is not always available, such as in irb by
default. It would be better to just say nothing than to show a confusing
message.
https://github.com/ruby/error_highlight/commit/ef80ce73a1
|
|
[Bug #21780]
|
|
[Bug #21780]
|
|
Freeze Net::HTTP::SSL_ATTRIBUTES and IDEMPOTENT_METHODS_. Both constants
have been marked as :nodoc:.
Together with https://github.com/ruby/openssl/issues/521, this enables
HTTPS clients in non-main Ractors on Ruby 4.0.
https://github.com/ruby/net-http/commit/f24b3b358b
|
|
specified timeout (#15602)
* `Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user specified timeout
In https://github.com/ruby/ruby/pull/11880, `rsock_connect()` was changed to raise `IO::TimeoutError` when a user-specified timeout occurs.
However, when `TCPSocket.new` attempts to connect to multiple destinations, it does not use `rsock_connect()`, and instead raises `Errno::ETIMEDOUT` on timeout.
As a result, the exception class raised on timeout could differ depending on whether there were multiple destinations or not.
To align this behavior with the implementation of `rsock_connect()`, this change makes `TCPSocket.new` raise `IO::TimeoutError` when a user-specified timeout occurs.
Similarly, `Socket.tcp` is updated to raise `IO::TimeoutError` when a timeout occurs within the method.
(Note that the existing behavior of `Addrinfo#connect_internal`, which Socket.tcp depends on internally and which raises `Errno::ETIMEDOUT` on timeout, is not changed.)
* [ruby/net-http] Raise `Net::OpenTimeout` when `TCPSocket.open` raises `IO::TimeoutError`.
With the changes in https://github.com/ruby/ruby/pull/15602, `TCPSocket.open` now raises `IO::TimeoutError` when a user-specified timeout occurs.
This change updates #connect to handle this case accordingly.
https://github.com/ruby/net-http/commit/f64109e1cf
|
|
https://hackerone.com/reports/3437743
|
|
|
|
|
|
Before this change, GC'ing any Ractor object caused you to lose all
enabled tracepoints across all ractors (even main). Now tracepoints are
ractor-local and this doesn't happen. Internal events are still global.
Fixes [Bug #19112]
|
|
|
|
|
|
|
|
and columns"
This reverts commit 073c4e1cc712064e626914fa4a5a8061f903a637.
https://bugs.ruby-lang.org/issues/6012#note-31
> we will cancel this feature in 4.0 because of design ambiguities
> such as whether to return column positions in bytes or characters as
> in [#21783].
[#21783]: https://bugs.ruby-lang.org/issues/21783
|
|
https://github.com/ruby/rubygems/commit/be5c4e27d9
|