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 #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/
Issue #19907 has been reported by peterzhu2118 (Peter Zhu).
----------------------------------------
Bug #19907: Method calls with keyword arguments in eval leaks callcache and callinfo objects
https://bugs.ruby-lang.org/issues/19907
* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
The following script leaks callcache and callinfo objects:
```ruby
def foo(a:); end
10.times do
10_000.times do
eval(<<~RUBY)
foo(a: 1)
RUBY
end
puts "Number of live objects: #{GC.stat(:heap_live_slots)}"
puts "Memory usage: #{`ps -o rss= -p #{$$}`}"
puts
end
```
Output is:
```
Number of live objects: 46248
Memory usage: 16160
Number of live objects: 65902
Memory usage: 19888
Number of live objects: 92656
Memory usage: 24032
Number of live objects: 126791
Memory usage: 28048
Number of live objects: 132919
Memory usage: 28816
Number of live objects: 180687
Memory usage: 32384
Number of live objects: 181957
Memory usage: 32464
Number of live objects: 227485
Memory usage: 34224
Number of live objects: 256101
Memory usage: 37200
Number of live objects: 274151
Memory usage: 38752
```
After performing a `ObjectSpace.dump_all`, I found that it is leaking callcache and callinfo objects that is being held on by the `Object` class.
```json
{"address":"0x102ecef70", "type":"CLASS", "shape_id":2, "slot_size":160, "class":"0x102ecf8d0", "variation_count":0, "superclass":"0x102ecfd30", "real_class_name":"Object", "singleton":true, "references":[ ... ]}
{"address":"0x1030c90a0", "type":"IMEMO", "shape_id":0, "slot_size":40, "imemo_type":"callinfo", "mid":"foo", "memsize":40, "flags":{"wb_protected":true}}
{"address":"0x102fad568", "type":"IMEMO", "shape_id":0, "slot_size":40, "imemo_type":"callcache", "memsize":40, "flags":{"wb_protected":true, "old":true, "uncollectible":true, "marked":true}}
```
--
https://bugs.ruby-lang.org/
Issue #20184 has been reported by aalin (Andreas Alin).
----------------------------------------
Bug #20184: Ruby segfaults on Fly.io with 256 MB RAM
https://bugs.ruby-lang.org/issues/20184
* Author: aalin (Andreas Alin)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
I've been running a Ruby 3.2 app on Fly.io with 256 MB RAM and it has been working fine.
When I upgraded to Ruby 3.3.0, any Ruby script would crash immediately with a segfault.
I haven't been able to reproduce it outside of fly.io.
I created a repository with a basic rack app which crashes on fly.io.
The readme includes the full output and a GDB backtrace.
https://github.com/aalin/ruby-3-3-0-fly-crash
--
https://bugs.ruby-lang.org/
Issue #20095 has been reported by sisyphus_cg (Sisyphus CG).
----------------------------------------
Bug #20095: Regex lookahead behaving strangely in 3.3.0
https://bugs.ruby-lang.org/issues/20095
* Author: sisyphus_cg (Sisyphus CG)
* Status: Open
* Priority: Normal
* ruby -v: 3.3.0
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Multiple regex lookaheads seem to behave strangely in 3.3.0:
```ruby
p "xxx" =~ /(?=.*x)x(?=banana)/ # 2
```
Clearly, the string `xxx` does not contain `banana`, so this regex should never match, but it does.
--
https://bugs.ruby-lang.org/
Issue #20207 has been reported by Sundeep (Sundeep Agarwal).
----------------------------------------
Bug #20207: Segmentation fault for a regexp containing positive and negative lookaheads
https://bugs.ruby-lang.org/issues/20207
* Author: Sundeep (Sundeep Agarwal)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
I'm getting segmentation fault for the following regexp with Ruby 3.3.0:
``` ruby
puts 'clan'.match?(/(?=.*a)(?!.*n)/)
```
This is the minimal example for which I was able to produce the issue. `a` and `n` in the above example
are just a sample, can be other character combinations too. There has to be at least two characters
before them in the input string (`cl` in the above example).
The error is seen when the above code is run from a file, but only occasionally from irb.
When run from a file, most of the time I get segmentation fault (see attached log file),
but sometimes I get the following error:
``` ruby
lookaround.rb:1:in `match?': undefined bytecode (bug): /(?=.*a)(?!.*n)/ (RegexpError)
from lookaround.rb:1:in `<main>'
```
When asked in the r/ruby forum, somebody else was able to reproduce this issue.
They also mentioned that the issue wasn't seen in the Ruby 3.2.2 version.
---Files--------------------------------
lookaround_segfault.log (15.9 KB)
--
https://bugs.ruby-lang.org/
Issue #20203 has been reported by vo.x (Vit Ondruch).
----------------------------------------
Bug #20203: `TestEnumerable` test failures with GCC 14
https://bugs.ruby-lang.org/issues/20203
* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
There is ongoing mass rebuild in Fedora and that is first time GCC 14 is used and we observe test failures in `TestEnumerable`. Here are a few examples:
~~~
[ 3000/26419] TestEnumerable#test_transient_heap_sort_bymalloc_consolidate(): unaligned fastbin chunk detected
~~~
~~~
[ 2455/26535] TestEnumerable#test_transient_heap_sort_bycorrupted size vs. prev_size in fastbins
~~~
~~~
[ 9716/26532] TestEnumerable#test_any_with_unused_blockdouble free or corruption (fasttop)
~~~
The full logs are accessible [here](https://koji.fedoraproject.org/koji/taskinfo?taskID=112176941). Please drill through `Descendants` and `build.log`
--
https://bugs.ruby-lang.org/