ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-core

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-core@ml.ruby-lang.org

September 2024

  • 5 participants
  • 194 discussions
[ruby-core:113052] [Ruby master Bug#19562] Setting default_(in|ex)ternal encoding after running an Ractor freezes ruby
by larskanis (Lars Kanis) 20 Sep '24

20 Sep '24
Issue #19562 has been reported by larskanis (Lars Kanis). ---------------------------------------- Bug #19562: Setting default_(in|ex)ternal encoding after running an Ractor freezes ruby https://bugs.ruby-lang.org/issues/19562 * Author: larskanis (Lars Kanis) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- The following command blocks infinitely and must be killed with "kill -9" ``` ruby -e "Ractor.new{}.take; Encoding.default_external = Encoding::ISO8859_2" ``` Backtrace is: ``` #0 futex_wait (private=0, expected=2, futex_word=0x55555555abd0) at ../sysdeps/nptl/futex-internal.h:146 #1 __GI___lll_lock_wait (futex=futex@entry=0x55555555abd0, private=0) at ./nptl/lowlevellock.c:49 #2 0x00007ffff760a082 in lll_mutex_lock_optimized (mutex=0x55555555abd0) at ./nptl/pthread_mutex_lock.c:48 #3 ___pthread_mutex_lock (mutex=mutex@entry=0x55555555abd0) at ./nptl/pthread_mutex_lock.c:93 #4 0x00007ffff7c5a40d in rb_native_mutex_lock (lock=lock@entry=0x55555555abd0) at ruby-3.2.1/thread_pthread.c:556 #5 0x00007ffff7cc5376 in vm_lock_enter (cr=0x55555555deb0, vm=0x55555555aba0, locked=locked@entry=false, no_barrier=no_barrier@entry=false, lev=0x55555555ac00) at vm_sync.c:56 #6 0x00007ffff7cc5747 in rb_vm_lock_body () at vm_sync.c:175 #7 0x00007ffff7bc02c2 in rb_vm_lock (line=1829, file=0x7ffff7e209cb "ractor.c") at ruby-3.2.1/vm_sync.h:57 #8 ractor_check_blocking (remained_thread_cnt=<optimized out>, file=0x7ffff7e209cb "ractor.c", line=1865, cr=0x55555555deb0) at ractor.c:1829 #9 ractor_check_blocking (line=1865, file=0x7ffff7e209cb "ractor.c", remained_thread_cnt=<optimized out>, cr=0x55555555deb0) at ractor.c:1811 #10 rb_ractor_blocking_threads_inc (cr=0x55555555deb0, file=file@entry=0x7ffff7e29b04 "thread.c", line=line@entry=1488) at ractor.c:1865 #11 0x00007ffff7c60977 in blocking_region_begin (th=0x55555555d070, region=0x7fffffffd220, ubf=0x7ffff7c5b300 <ubf_select>, arg=0x55555555d070, fail_if_interrupted=<optimized out>) at thread.c:1488 #12 0x00007ffff7c61edf in rb_nogvl (func=0x7ffff7ac66e0 <no_gvl_stat>, data1=0x7fffffffd2a0, ubf=<optimized out>, data2=0x55555555d070, flags=<optimized out>) at thread.c:1548 #13 0x00007ffff7acdfbc in stat_without_gvl (st=0x7fffffffd2b0, path=0x7ffff27dfe88 "ruby-3.2.1/lib/ruby/3.2.0/x86_64-linux/enc/iso_8859_2.so") at file.c:1171 #14 rb_check_realpath_internal (basedir=basedir@entry=4, path=path@entry=140737261984200, origenc=0x555555565030, mode=mode@entry=RB_REALPATH_STRICT) at file.c:4491 #15 0x00007ffff7acebaa in rb_realpath_internal (basedir=basedir@entry=4, path=path@entry=140737261984200, strict=strict@entry=1) at file.c:4536 #16 0x00007ffff7b2cdd4 in require_internal (ec=0x55555555e1f0, fname=<optimized out>, exception=1, warn=<optimized out>) at load.c:1195 #17 0x00007ffff7aa0a17 in load_encoding (name=0x5555556049b0 "ISO-8859-2") at encoding.c:779 #18 0x00007ffff7aa2ef8 in check_encoding (enc=0x5555556049d0) at encoding.c:191 #19 enc_check_encoding (obj=140737335533800) at encoding.c:202 #20 rb_to_encoding (enc=enc@entry=140737335533800) at encoding.c:307 #21 0x00007ffff7aa4049 in enc_set_default_encoding (name=0x7ffff7de6287 "external", encoding=140737335533800, def=0x7ffff7fb00c0 <default_external>) at encoding.c:1563 #22 rb_enc_set_default_external (encoding=140737335533800) at encoding.c:1637 #23 0x00007ffff7aa411f in set_default_external (klass=<optimized out>, encoding=140737335533800) at encoding.c:1658 #24 0x00007ffff7c99037 in vm_call_cfunc_with_frame (ec=0x55555555e1f0, reg_cfp=0x7ffff6f7df90, calling=<optimized out>) at ruby-3.2.1/vm_insnhelper.c:3268 #25 0x00007ffff7ca9564 in vm_sendish (method_explorer=<optimized out>, block_handler=<optimized out>, cd=<optimized out>, reg_cfp=<optimized out>, ec=<optimized out>) at ruby-3.2.1/vm_callinfo.h:367 #26 vm_exec_core (ec=0x55555555e1f0, initial=128) at ruby-3.2.1/insns.def:820 #27 0x00007ffff7caee93 in rb_vm_exec (ec=0x55555555e1f0, jit_enable_p=true) at vm.c:2374 #28 0x00007ffff7abfbf1 in rb_ec_exec_node (ec=ec@entry=0x55555555e1f0, n=n@entry=0x7ffff796c2c0) at eval.c:289 #29 0x00007ffff7ac60b3 in ruby_run_node (n=0x7ffff796c2c0) at eval.c:330 #30 0x0000555555555187 in rb_main (argv=0x7fffffffdb98, argc=3) at ./main.c:38 #31 main (argc=<optimized out>, argv=<optimized out>) at ./main.c:57 ``` When the encoding was already loaded before running `Ractor.new`, then it works and doesn't block: ``` ruby -e "''.encode(Encoding::ISO8859_2); Ractor.new{}.take; Encoding.default_internal = Encoding::ISO8859_2" ``` When the encoding is not assigned as default encoding, but used otherwise, it works too: ``` ruby -e "Ractor.new{}.take; ''.encode(Encoding::ISO8859_2)" ``` -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:119267] [Ruby master Feature#18814] Ractor: add method to query incoming message queue size
by hsbt (Hiroshi SHIBATA) 20 Sep '24

20 Sep '24
Issue #18814 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Assigned Assignee set to ko1 (Koichi Sasada) ---------------------------------------- Feature #18814: Ractor: add method to query incoming message queue size https://bugs.ruby-lang.org/issues/18814#change-109874 * Author: phigrofi (Philipp Großelfinger) * Status: Assigned * Assignee: ko1 (Koichi Sasada) ---------------------------------------- ## Abstract A simple method to query the current size of a Ractor's incoming queue from outside. Can be used to decide on the sender's side if a message is sent or postponed. ## Background Ractors have an infinite incoming message queue. When messages are sent to a Ractor it is not possible to check the current count of elements in the queue. A workaround would be: The receiving Ractor could immediately accept each message and put them into a separate queue and keep track of their count. Then the sending Ractor could query the count from the receiving Ractor as a message. While this message exchange would be short and simple, it still requires the receiving Ractor to process the "queue-count" message and respond to it. ## Proposal The Ractor implementation already keeps track of the current incoming message fill level in the field `sync.incoming_queue.cnt`. A simple method in the ruby code of Ractor could expose this number so that it is simple to query the queue size from outside. This works without any interaction of the queried Ractor. The code would work as follows: ``` ruby ractor = Ractor.new do loop { sleep(1) } end ractor.queue_size #=> 0 ractor << "message" ractor.queue_size #=> 1 ractor << "message" ractor.queue_size #=> 2 ``` ## Use cases 1. Avoid queue overflow by checking queue size from outside before sending further messages. 2. Incoming queue sizes can be monitored. ## Discussion The proposal makes it much easier to prevent overflow of a message queue than managing a separate queue inside of a Ractor and keeping track of its element count. I think also having a separate queue where the count needs to communicated, ignores the concept of a Ractor's incoming message queue and makes it quite complicated. ## See also In this [issue](https://bugs.ruby-lang.org/issues/17679) a middleman solution was proposed which keeps track of a separate queue count. -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:111144] [Ruby master Feature#19171] Update Unicode data to Unicode Version 15.1
by duerst 20 Sep '24

20 Sep '24
Issue #19171 has been reported by duerst (Martin Dürst). ---------------------------------------- Feature #19171: Update Unicode data to Unicode Version 15.1 https://bugs.ruby-lang.org/issues/19171 * Author: duerst (Martin Dürst) * Status: Open * Priority: Normal * Assignee: duerst (Martin Dürst) ---------------------------------------- According to http://blog.unicode.org/2022/11/the-unicode-standard-2023-release.html, Unicode plans to release Version 15.1 in September 2023. According to https://www.unicode.org/versions/beta.html, public alpha review starts Feb. 7, 2023, and ends April 4, 2023. Because alpha review may not include all the files we use, it may be difficult for us to participate. Public beta review is planned to start May 23, 2023, ending July 4, 2023. At this point, we should be able to test things. -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:119160] [Ruby master Bug#20734] Build failure at FreeBSD 14.1
by hsbt (Hiroshi SHIBATA) 20 Sep '24

20 Sep '24
Issue #20734 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Bug #20734: Build failure at FreeBSD 14.1 https://bugs.ruby-lang.org/issues/20734 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- FreeBSD 14.1 build is also failure with ruby master. This is different error from #20733 ``` [hsbt@freebsd ~/ruby]$ make BASERUBY = /usr/local/bin/ruby --disable=gems CC = clang LD = ld LDSHARED = clang -shared CFLAGS = -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -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-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef XCFLAGS = -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -I. -I.ext/include/amd64-freebsd14.1 -I./include -I. -I./prism -I./enc/unicode/15.0.0 CPPFLAGS = DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,showflags -fstack-protector-strong -pie SOLIBS = -lexecinfo -lprocstat -lz -lrt -lrt -ldl -lcrypt -lm -lthr LANG = C.UTF-8 LC_ALL = LC_CTYPE = MFLAGS = RUSTC = rustc YJIT_RUSTC_ARGS = --crate-name=yjit --crate-type=staticlib --edition=2021 -g -C lto=thin -C opt-level=3 -C overflow-checks=on '--out-dir=/home/hsbt/ruby/yjit/target/release/' ./yjit/src/lib.rs FreeBSD clang version 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9) Target: x86_64-unknown-freebsd14.1 Thread model: posix InstalledDir: /usr/bin compiling version.c In file included from version.c:14: ./version.h:29:5: error: invalid suffix 'RUBY_RELEASE_MONTH' on integer constant 29 | #if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH) | ^ ./version.h:25:27: note: expanded from macro 'ONLY_ONE_DIGIT' 25 | #define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000 | ^ ./include/ruby/internal/config.h:37:26: note: expanded from macro 'TOKEN_PASTE' 37 | #define TOKEN_PASTE(x,y) x##y | ^ <scratch space>:156:3: note: expanded from here 156 | 10RUBY_RELEASE_MONTH | ^ In file included from version.c:14: ./version.h:34:5: error: invalid suffix 'RUBY_RELEASE_DAY' on integer constant 34 | #if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY) | ^ ./version.h:25:27: note: expanded from macro 'ONLY_ONE_DIGIT' 25 | #define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000 | ^ ./include/ruby/internal/config.h:37:26: note: expanded from macro 'TOKEN_PASTE' 37 | #define TOKEN_PASTE(x,y) x##y | ^ <scratch space>:157:3: note: expanded from here 157 | 10RUBY_RELEASE_DAY | ^ 2 errors generated. *** Error code 1 Stop. make: stopped in /home/hsbt/ruby ``` -- https://bugs.ruby-lang.org/
1 3
0 0
[ruby-core:119262] [Ruby master Feature#20756] Introduce Boolean class
by kbrock (Keenan Brock) 19 Sep '24

19 Sep '24
Issue #20756 has been reported by kbrock (Keenan Brock). ---------------------------------------- Feature #20756: Introduce Boolean class https://bugs.ruby-lang.org/issues/20756 * Author: kbrock (Keenan Brock) * Status: Open ---------------------------------------- Hello All, Is is possible to add a parent class for `TrueClass` and `FalseClass`? I always found it strange that there was not a concept to group `true` and `false` together. e.g.: ```ruby class TrueClass < Boolean ; end class FalseClass < Boolean ; end # replaces the hack: module Boolean ; end TrueClass.include(Boolean); FalseClass.include(Boolean); ``` In our code, we often want to validate that a value is of a certain type. ```ruby case(value) when String ... when Integer ... when true, false ... # Boolean # alt: when TrueClass, FalseClass end # or def valid_args? value.kind_of?(String) end def valid_args? value.kind_of?(Integer) end def valid_args? [true, false].include?(value) [TrueClass, FalseClass].detect { |klass| value.kind_of?(klass) } end ``` Does it make sense to others to have a way to group `true` and `false` together? Thank you for your thoughts, Keenan -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:119251] [Ruby master Bug#20754] [doc] `Hash::new` is missing from rdoc for 3.4
by Earlopain (A S) 18 Sep '24

18 Sep '24
Issue #20754 has been reported by Earlopain (A S). ---------------------------------------- Bug #20754: [doc] `Hash::new` is missing from rdoc for 3.4 https://bugs.ruby-lang.org/issues/20754 * Author: Earlopain (A S) * Status: Open * ruby -v: 3.4-dev * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I was interested in the `capacity` argument added in https://github.com/ruby/ruby/pull/10357 but found any reference to it missing from https://docs.ruby-lang.org/en/master/Hash.html `::new` just links to docs from `BasicObject`. Docs for 3.3 contain the proper `new` method: https://docs.ruby-lang.org/en/3.3/Hash.html#method-c-new Maybe it has something to do with it moving into ruby code? Not sure. I haven't checked other classes that moved into ruby. -- https://bugs.ruby-lang.org/
1 1
0 0
[ruby-core:119242] [Ruby master Bug#20751] Regression in Prism related to use of super in default argument values
by jeremyevans0 (Jeremy Evans) 18 Sep '24

18 Sep '24
Issue #20751 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #20751: Regression in Prism related to use of super in default argument values https://bugs.ruby-lang.org/issues/20751 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- All versions of parse.y dating at least back to Ruby 1.8.7, and Prism in both Ruby 3.3.5 and 3.4.0preview1, correctly parses this code: ```ruby class A def foo(b = nil || (return)) end end ``` The master branch, unless `--parser=parse.y` is used, now considers this a SyntaxError: ``` -: -:2: syntax error found (SyntaxError) 1 | class A > 2 | def foo(b = nil || (return)) | ^~~~~~ Invalid return in class/module body 3 | end 4 | end ``` -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:119199] [Ruby master Bug#20742] Trying to assign to a variable in statement modifier should emit a warning
by esad (Esad Hajdarevic) 17 Sep '24

17 Sep '24
Issue #20742 has been reported by esad (Esad Hajdarevic). ---------------------------------------- Bug #20742: Trying to assign to a variable in statement modifier should emit a warning https://bugs.ruby-lang.org/issues/20742 * Author: esad (Esad Hajdarevic) * Status: Open * ruby -v: 3.3.4 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- There is an example in Control Expressions documentation: ``` p a if a = 0.zero? # raises NameError “undefined local variable or method ‘a’”. ``` However, if we had already defined `a` there would be no exception raised. If one uses something like `p` for scratch variable, due to Kernel#p, also no exception is raised. Statement modifier is generally somewhat inverting the code flow (the right part is evaluated first then the left part), so it is not really obvious why binding variables shouldn't follow the same flow. A warning would be very beneficial. -- https://bugs.ruby-lang.org/
4 6
0 0
[ruby-core:119220] [Ruby master Bug#20749] Error message not shown in output with prism
by luke-gru (Luke Gruber) 17 Sep '24

17 Sep '24
Issue #20749 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Bug #20749: Error message not shown in output with prism https://bugs.ruby-lang.org/issues/20749 * Author: luke-gru (Luke Gruber) * Status: Open * ruby -v: 3.4.0dev * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- test.rb: ```ruby p = Proc.new ``` ``` ./ruby --parser=parse.y -I../ruby/lib -I. -I.ext/x86_64-linux -I.ext/common -r./x86_64-linux-fake ../ruby/test.rb ../ruby/test.rb:1:in 'Proc.new': tried to create Proc object without a block (ArgumentError) from ../ruby/test.rb:1:in '<main>' ``` ``` ./ruby --parser=prism -I../ruby/lib -I. -I.ext/x86_64-linux -I.ext/common -r./x86_64-linux-fake ../ruby/test.rb ../ruby/test.rb:1:in 'Proc.new': ArgumentError from ../ruby/test.rb:1:in '<main>' ``` -- https://bugs.ruby-lang.org/
1 1
0 0
[ruby-core:119214] [Ruby master Bug#20747] [prism] regression in retry precedence
by byroot (Jean Boussier) 16 Sep '24

16 Sep '24
Issue #20747 has been reported by byroot (Jean Boussier). ---------------------------------------- Bug #20747: [prism] regression in retry precedence https://bugs.ruby-lang.org/issues/20747 * Author: byroot (Jean Boussier) * Status: Open * Assignee: kddnewton (Kevin Newton) * ruby -v: ruby 3.4.0dev (2024-09-15T01:06:11Z master 532af89e3b) +PRISM [arm64-darwin23] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Since prism has been made the default, our test suite now fail to boot with the following error: ```ruby syntax error found (SyntaxError) 298 | raise e 299 | else > 300 | retry | ^~~~~ Invalid retry after else 301 | end 302 | end ``` Here's the code in question, that reproduce the error: ```ruby def retry_thing(times: 1) retries ||= 0 begin yield rescue RuntimeError => e raise if (retries += 1) > times begin refresh! rescue raise e else retry end end end ``` -- https://bugs.ruby-lang.org/
3 2
0 0
  • ← Newer
  • 1
  • ...
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • ...
  • 20
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.