Issue #20098 has been reported by tompng (tomoya ishida).
----------------------------------------
Bug #20098: Wrong regexp match in ruby 3.2 and 3.3
https://bugs.ruby-lang.org/issues/20098
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +MN [arm64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
These regexp all matches in ruby 3.1.4, but not in ruby 3.3.0.
~~~ruby
p /a((.|.)|bc){,4}z/.match? 'abcbcbcbcz'
p /a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz' # matches in ruby 3.2.2
p /a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz'
p /a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz'
~~~
Adding backref (to disable optimization) makes them match.
~~~ruby
p /()\1a((.|.)|bc){,4}z/.match? 'abcbcbcbcz'
p /()\1a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz'
p /()\1a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz'
p /()\1a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz'
~~~
Found in this script https://gist.github.com/tompng/aa0706a181e9187bd79e8cec5a5f3c97
--
https://bugs.ruby-lang.org/
Issue #19716 has been reported by alexdowad (Alex Dowad).
----------------------------------------
Bug #19716: SystemStackError occurs too easily on Alpine Linux (due to small stack size reported by pthread_attr_getstacksize on musl libc)
https://bugs.ruby-lang.org/issues/19716
* Author: alexdowad (Alex Dowad)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux-musl]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
This is the same problem previously reported against Ruby 2.5 in https://bugs.ruby-lang.org/issues/14387. I just ran into the same problem on Ruby 3.1.4, built on Alpine Linux 3.16.
@hsbt stated in the previous thread (https://bugs.ruby-lang.org/issues/14387#note-28):
> If you have this issue with Ruby 3.2, please file it with another issue.
I hacked `stack_check` in gc.c to print the values of `STACK_START` and `STACK_END` on stack overflow; on the Alpine 3.16 host where this problem just occurred, the values printed were:
> Start=0x7ffd0bf4f000, End=0x7ffd0bf32530
...which shows that Ruby thinks the stack size is only 131072 bytes. On the other hand, `ulimit -s` shows a stack size limit of 8192kb.
This Ruby 3.1.4 was built from unmodified source code downloaded from https://cache.ruby-lang.org; the build was configured using `CFLAGS='-march=native' ./configure --disable-install-doc`.
The invocation of Ruby which blew the stack was `bundle exec rake db:migrate`, on a mid-sized Rails project.
Regarding @ncopa's patch from #14387, @wanabe listed some things which should be done before it is merged into mainline Ruby:
> Okay, The patch needs one or more proofs of its behaviour, like that:
>
> Original issue [ruby-dev:50421] has gone away.
> Standard test codes run well.
> test-all
> ruby/spec
> getrlimit works on some situations like:
> on single thread
> with multiple threads
> with RLIMIT_STACK environment variable
> getrlimit code of musl is implemented correctly as expected.
> (But It's doubtful whether it can be. I guess that a proof of code soundness is very difficult.)
> Some "real world" applications can work.
> I think it is better example that that application(s) can't work without the patch.
I am happy to help cover some of these points if the Ruby development team is still interested in merging @ncopa's patch.
--
https://bugs.ruby-lang.org/
Issue #20028 has been reported by zenspider (Ryan Davis).
----------------------------------------
Misc #20028: I'd like my commit bit back
https://bugs.ruby-lang.org/issues/20028
* Author: zenspider (Ryan Davis)
* Status: Open
* Priority: Normal
----------------------------------------
It's been a while, in the svn -> git shuffle I lost commit privs. I'd like to help out more actively, triage issues, clean doco, etc.
Not sure who's doing admin work so I'm not sure who to assign to to expedite.
--
https://bugs.ruby-lang.org/
Issue #20168 has been reported by shia (Sangyong Sim).
----------------------------------------
Bug #20168: Process won't exit when Ractor.select waiting a Ractor
https://bugs.ruby-lang.org/issues/20168
* Author: shia (Sangyong Sim)
* Status: Open
* Priority: Normal
* ruby -v: 3.3.0
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
## Reproduction code
```ruby
trap(:INT) do
puts "SIGINT"
exit
end
trap(:TERM) do
puts "SIGTERM"
exit
end
r = Ractor.new do
loop do
sleep 1
end
end
Ractor.select(r) # stucked.
# SIGINT/SIGTERM sent to Ruby process(confirmed by trap),
# but process won't exit.
```
## Expected behavior
Process killed successfully with exit code 0.
## Affected Ruby version
3.3.0
3.2.x works as expected.
--
https://bugs.ruby-lang.org/
Issue #19236 has been reported by byroot (Jean Boussier).
----------------------------------------
Feature #19236: Allow to create hashes with a specific capacity from Ruby
https://bugs.ruby-lang.org/issues/19236
* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Target version: 3.3
----------------------------------------
Followup on [Feature #18683] which added a C-API for this purpose.
Various protocol parsers such as Redis `RESP3` or `msgpack`, have to create hashes, and they know the size in advance.
For efficiency, it would be preferable if they could directly allocate a Hash of the necessary size, so that large hashes wouldn't cause many re-alloccations and re-hash.
`String` and `Array` both already offer similar APIs:
```ruby
String.new(capacity: XXX)
Array.new(XX) / rb_ary_new_capa(long)
```
However there's no such public API for Hashes in Ruby land.
### Proposal
I think `Hash` should have a way to create a new hash with a `capacity` parameter.
The logical signature of `Hash.new(capacity: 1000)` was deemed too incompatible in [Feature #18683].
@Eregon proposed to add `Hash.create(capacity: 1000)`.
--
https://bugs.ruby-lang.org/
Issue #19161 has been reported by werebus (Matt Moretti).
----------------------------------------
Bug #19161: Cannot compile 3.0.5 or 3.1.3 on Red Hat 7
https://bugs.ruby-lang.org/issues/19161
* Author: werebus (Matt Moretti)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
When attempting to run `make` on either the 3.0.5 or 3.1.3 release, I get the following error (I included the whole output as it's pretty short):
```
BASERUBY = /opt/ruby/bin/ruby --disable=gems
CC = gcc -std=gnu11
LD = ld
LDSHARED = gcc -std=gnu11 -shared
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/13.0.0
CPPFLAGS =
DLDFLAGS = -Wl,--compress-debug-sections=zlib -fstack-protector-strong -pie
SOLIBS = -lz -lpthread -lrt -lrt -ldl -lcrypt -lm
LANG = en_US.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
In file included from vm_core.h:83:0,
from iseq.h:14,
from mini_builtin.c:3,
from miniinit.c:51:
thread_pthread.h:108:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
^
In file included from iseq.h:14:0,
from mini_builtin.c:3,
from miniinit.c:51:
vm_core.h: In function ‘rb_current_execution_context’:
vm_core.h:1870:34: error: ‘ruby_current_ec’ undeclared (first use in this function)
rb_execution_context_t *ec = ruby_current_ec;
^
vm_core.h:1870:34: note: each undeclared identifier is reported only once for each function it appears in
miniinit.c: At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
make: *** [miniinit.o] Error 1
```
Both Ruby 3.0.4 and 3.1.2 build without error and pass (all but one of) the `make check` tests.
I know RHEL 7 is getting to be pretty old; I suspect a factor here are the ancient build tools available to me. But... EOL for Ruby 2.7 comes before the one for RHEL 7, so I'm trying to prioritize.
--
https://bugs.ruby-lang.org/
Issue #20275 has been reported by Eregon (Benoit Daloze).
----------------------------------------
Feature #20275: Avoid extra backtrace entries for rescue and ensure
https://bugs.ruby-lang.org/issues/20275
* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
From https://bugs.ruby-lang.org/issues/19117#note-48:
```ruby
def raise_nested_exceptions
raise "First error"
rescue
begin
raise "Second error"
rescue
raise "Third error"
end
end
raise_nested_exceptions
```
Current:
```
-:7:in 'Object#raise_nested_exceptions': Third error (RuntimeError)
from -:4:in 'Object#raise_nested_exceptions'
from -:1:in 'Object#raise_nested_exceptions'
from -:11:in '<main>'
-:5:in 'Object#raise_nested_exceptions': Second error (RuntimeError)
from -:1:in 'Object#raise_nested_exceptions'
from -:11:in '<main>'
-:2:in 'Object#raise_nested_exceptions': First error (RuntimeError)
from -:11:in '<main>'
```
The above repeated backtrace entries for `Object#raise_nested_exceptions` are because of CRuby implementation details.
It seems best to hide them because they do not help understanding the program, and semantically there is no (method or proc) call on line 1 or 4.
Proposed:
```
-:7:in 'Object#raise_nested_exceptions': Third error (RuntimeError)
from -:11:in '<main>'
-:5:in 'Object#raise_nested_exceptions': Second error (RuntimeError)
from -:11:in '<main>'
-:2:in 'Object#raise_nested_exceptions': First error (RuntimeError)
from -:11:in '<main>'
```
We can see TruffleRuby already behave this way, most likely because they do not use an extra frame for `rescue`.
It is definitely useful to have the same backtrace on different Ruby implementations as lots of tests rely on this.
TruffleRuby 23.1.2:
```
-:7:in `raise_nested_exceptions': Third error (RuntimeError)
from -:11:in `<main>'
-:5:in `raise_nested_exceptions': Second error (RuntimeError)
from -:11:in `<main>'
-:2:in `raise_nested_exceptions': First error (RuntimeError)
from -:11:in `<main>'
```
JRuby 9.4.5.0:
```
RuntimeError: Third error
raise_nested_exceptions at -:7
<main> at -:11
RuntimeError: Second error
raise_nested_exceptions at -:5
<main> at -:11
RuntimeError: First error
raise_nested_exceptions at -:2
<main> at -:11
```
--
https://bugs.ruby-lang.org/
Issue #20013 has been reported by jaruga (Jun Aruga).
----------------------------------------
Misc #20013: Travis CI status
https://bugs.ruby-lang.org/issues/20013
* Author: jaruga (Jun Aruga)
* Status: Open
* Priority: Normal
----------------------------------------
I would like to use this ticket to manage our activities to report Travis CI status.
Because there is Travis CI status page provided by Travis CI. However, even when the page shows ok, I actually see infra issues.
https://www.traviscistatus.com/
I would share my activities and report the Travis CI status on the ticket.
The ticket's status is not closed until we stop using Travis CI.
The easiest option to fix the Travis infra issue is to email Travis CI support `support _AT_ travis-ci.com`.
You can check [this ruby/ruby Travis CI wiki page](https://github.com/ruby/ruby/wiki/CI-Servers#travis-ci) for details.
--
https://bugs.ruby-lang.org/
Issue #20183 has been reported by nobu (Nobuyoshi Nakada).
----------------------------------------
Bug #20183: `erb/escape.so` cannot be loaded when `--with-static-linked-ext`
https://bugs.ruby-lang.org/issues/20183
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
* Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED
----------------------------------------
Since `cgi/escape.c` and `erb/escape.c` are both initialized by `Init_escape()` functions, both call the same function in `extinit.c`.
--
https://bugs.ruby-lang.org/