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
  • ----- 2026 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • 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

March 2024

  • 5 participants
  • 266 discussions
[ruby-core:117186] [Ruby master Bug#20339] Parser segfault with ractor comment in the middle of a statement
by kddnewton (Kevin Newton) 14 Mar '24

14 Mar '24
Issue #20339 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Bug #20339: Parser segfault with ractor comment in the middle of a statement https://bugs.ruby-lang.org/issues/20339 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ```ruby foo( # shareable_constant_value: literal (C = { bar => baz }) ) ``` -- https://bugs.ruby-lang.org/
1 1
0 0
[ruby-core:116016] [Ruby master Bug#20150] Memory leak in grapheme clusters
by peterzhu2118 (Peter Zhu) 14 Mar '24

14 Mar '24
Issue #20150 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #20150: Memory leak in grapheme clusters https://bugs.ruby-lang.org/issues/20150 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED ---------------------------------------- GitHub PR: https://github.com/ruby/ruby/pull/9414 String#grapheme_cluters and String#each_grapheme_cluster leaks memory because if the string is not UTF-8, then the created regex will not be freed. For example: ```ruby str = "hello world".encode(Encoding::UTF_32LE) 10.times do 1_000.times do str.grapheme_clusters end puts `ps -o rss= -p #{$$}` end ``` Before: ``` 26000 42256 59008 75792 92528 109232 125936 142672 159392 176160 ``` After: ``` 9264 9504 9808 10000 10128 10224 10352 10544 10704 10896 ``` -- https://bugs.ruby-lang.org/
5 6
0 0
[ruby-core:117132] [Ruby master Bug#20334] Time.to_i truncates a fractional timestamp instead of rounding up
by werelnon (Malcolm Patterson) 14 Mar '24

14 Mar '24
Issue #20334 has been reported by werelnon (Malcolm Patterson). ---------------------------------------- Bug #20334: Time.to_i truncates a fractional timestamp instead of rounding up https://bugs.ruby-lang.org/issues/20334 * Author: werelnon (Malcolm Patterson) * Status: Open * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Simple steps that can be executed in a ruby interactive shell ``` irb(main):007> t = Time.now => 2024-03-14 00:23:55.983885525 +0000 irb(main):008> t.to_f => 1710375835.9838855 irb(main):009> t.to_i => 1710375835 ``` Based on the example the result of `t.to_f.round` is the better result? -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:115912] [Ruby master Bug#20090] Anonymous arguments are now syntax errors in unambiguous cases
by willcosgrove (Will Cosgrove) 14 Mar '24

14 Mar '24
Issue #20090 has been reported by willcosgrove (Will Cosgrove). ---------------------------------------- Bug #20090: Anonymous arguments are now syntax errors in unambiguous cases https://bugs.ruby-lang.org/issues/20090 * Author: willcosgrove (Will Cosgrove) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- It looks like the changes that were made in #19370 may have gone further than intended. It's also possible I'm misunderstanding what decision was made. But it was my understanding that the goal was to make ambiguous cases a syntax error. The test cases added are all testing the ambiguous cases: ```rb assert_syntax_error("def b(&) ->(&) {c(&)} end", /anonymous block parameter is also used/) # ... assert_syntax_error("def b(*) ->(*) {c(*)} end", /anonymous rest parameter is also used/) assert_syntax_error("def b(a, *) ->(*) {c(1, *)} end", /anonymous rest parameter is also used/) assert_syntax_error("def b(*) ->(a, *) {c(*)} end", /anonymous rest parameter is also used/) # ... assert_syntax_error("def b(**) ->(**) {c(**)} end", /anonymous keyword rest parameter is also used/) assert_syntax_error("def b(k:, **) ->(**) {c(k: 1, **)} end", /anonymous keyword rest parameter is also used/) assert_syntax_error("def b(**) ->(k:, **) {c(**)} end", /anonymous keyword rest parameter is also used/) ``` However it is now also producing syntax errors in all of these cases: ```rb def b(&) -> { c(&) } end def b(*) -> { c(*) } end def b(a, *) -> { c(1, *) } end def b(*) ->(a) { c(a, *) } end def b(**) -> { c(**) } end def b(k:, **) -> { c(k: 1, **) } end def b(**) ->(k:) { c(k:, **) } end ``` Again, it's possible I misunderstood the scope of the previous change. But it would be sad to lose the unambiguous case, as I've used that pattern quite a bit in my own projects. This is my first time opening an issue here, so I apologize in advance if I've done anything non-standard. -- https://bugs.ruby-lang.org/
6 7
0 0
[ruby-core:116356] [Ruby master Bug#20198] Threaded DNS resolver does not propagate errno to the calling thread
by kjtsanaktsidis (KJ Tsanaktsidis) 14 Mar '24

14 Mar '24
Issue #20198 has been reported by kjtsanaktsidis (KJ Tsanaktsidis). ---------------------------------------- Bug #20198: Threaded DNS resolver does not propagate errno to the calling thread https://bugs.ruby-lang.org/issues/20198 * Author: kjtsanaktsidis (KJ Tsanaktsidis) * Status: Open * Priority: Normal * Assignee: kjtsanaktsidis (KJ Tsanaktsidis) * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- If we get a return value of `EAI_SYSTEM` from `getaddrinfo`, we transform that into an appropriate `Errno::` exception on the Ruby side. However, because we now run the actual call to `getaddrinfo` in a thread, we lose that `errno` value (because `errno` is thread-local). So, what we actually raise in case of `EAI_SYSTEM` is just the last error which happened on the calling thread - e.g. this `ECHILD` which presumably got set in the bowels of pthreads somewhere: ``` 1) Socket::IPSocket#getaddress raises an error on unknown hostnames ERROR Expected SocketError but got: Errno::ECHILD (No child processes - getaddrinfo) /home/runner/work/ruby/ruby/src/spec/ruby/library/socket/ipsocket/getaddress_spec.rb:22:in `getaddress' /home/runner/work/ruby/ruby/src/spec/ruby/library/socket/ipsocket/getaddress_spec.rb:22:in `block (3 levels) in <top (required)>' /home/runner/work/ruby/ruby/src/spec/ruby/library/socket/ipsocket/getaddress_spec.rb:21:in `block (2 levels) in <top (required)>' /home/runner/work/ruby/ruby/src/spec/ruby/library/socket/ipsocket/getaddress_spec.rb:4:in `<top (required)>' ``` -- https://bugs.ruby-lang.org/
2 3
0 0
[ruby-core:116073] [Ruby master Bug#20161] Memory leak in regexp grapheme clusters
by peterzhu2118 (Peter Zhu) 14 Mar '24

14 Mar '24
Issue #20161 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #20161: Memory leak in regexp grapheme clusters https://bugs.ruby-lang.org/issues/20161 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED ---------------------------------------- GitHub PR: https://github.com/ruby/ruby/pull/9447 The cc->mbuf gets overwritten, so we need to free it to not leak memory. For example: ```ruby str = "hello world".encode(Encoding::UTF_32LE) 10.times do 1_000.times do str.grapheme_clusters end puts `ps -o rss= -p #{$$}` end ``` Before: ``` 15536 15760 15920 16144 16304 16480 16640 16784 17008 17280 ``` After: ``` 15584 15584 15760 15824 15888 15888 15888 15888 16048 16112 ``` -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:117129] [Ruby master Bug#20333] segfault while running my tests
by dorianmariefr 14 Mar '24

14 Mar '24
Issue #20333 has been reported by dorianmariefr (Dorian Marié). ---------------------------------------- Bug #20333: segfault while running my tests https://bugs.ruby-lang.org/issues/20333 * Author: dorianmariefr (Dorian Marié) * Status: Open * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- No sure how to debug it, I had a segfault while running the tests, maybe you will find it useful. ---Files-------------------------------- segfault.log (731 KB) crash.log (100 KB) -- https://bugs.ruby-lang.org/
2 3
0 0
[ruby-core:117155] [Ruby master Feature#4247] New features for Array#sample, Array#choice
by mame (Yusuke Endoh) 14 Mar '24

14 Mar '24
Issue #4247 has been updated by mame (Yusuke Endoh). Status changed from Assigned to Rejected Assignee deleted (mame (Yusuke Endoh)) We discussed this at the dev meeting. No one remembered the discussion from over 10 years ago, so we discussed it anew and concluded that this was a no-go. A naive API design could be `ary.sample(k, weights: [Float])`, but this would be an O(ary.size * k) time-consuming algorithm. There are many more efficient algorithms for weighted sampling. (We read Julia's [StatsBase.jl](https://juliastats.org/StatsBase.jl/stable/sampling/) and Python's [random](https://docs.python.org/3.13/library/random.html).) However, these require additional information, such as the sum of the weights, cumulative weight table, the need to build the table in advance, etc. We want to avoid an API design that only allows slow algorithm, but it seems overkill to introduce an API that allows advanced algorithms as a built-in feature. We concluded that it would be better to make a gem, instead of a built-in feature, for such things. ---------------------------------------- Feature #4247: New features for Array#sample, Array#choice https://bugs.ruby-lang.org/issues/4247#change-107242 * Author: oj (Yoji Ojima) * Status: Rejected ---------------------------------------- =begin We are planning to add the following features of the random sampling to Array. 1. Weighted random sampling. 2. Sampling with replacement. 3. Iteration. It is discussed in ruby-dev (Feature #3647 and #4147). API will be: Array#sample([size, [opt]]) - Random selection without replacement. - Returns a new array when size is specified. - opt: weight: proc or array random: Random instance Array#choice([size, [opt]]) - Random selection with replacement. - Returns a new array when size is specified. - opt: same as above. Array#each_sample([opt]) - Random selection iterator without replacement. - Choose a random element and yield it. - Returns an Enumerator if a block is not given. - opt: same as above. Array#each_choice([opt]) - Random selection iterator with replacement. - Choose a random element and yield it. - Returns an Enumerator if a block is not given. - opt: same as above. Comments? =end -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:116684] [Ruby master Feature#20261] Add symbol alternatives to '' and nil for IO line separators
by burdettelamar (Burdette Lamar) 14 Mar '24

14 Mar '24
Issue #20261 has been reported by burdettelamar (Burdette Lamar). ---------------------------------------- Feature #20261: Add symbol alternatives to '' and nil for IO line separators https://bugs.ruby-lang.org/issues/20261 * Author: burdettelamar (Burdette Lamar) * Status: Open * Priority: Normal ---------------------------------------- For IO's line-oriented read methods, there are two special values for the line-separator argument `sep`; I'm proposing to add (user-friendlier) symbol synonyms for those values: - `:paragraph` as synonym for `''` (read paragraphs). - `:slurp` as synonym for `nil` (read all). Details (code, documentation, tests) may be seen at https://github.com/ruby/ruby/pull/9921. -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:116987] [Ruby master Bug#20310] ASAN fake stacks need to be marked during GC for non-current execution context
by kjtsanaktsidis (KJ Tsanaktsidis) 14 Mar '24

14 Mar '24
Issue #20310 has been reported by kjtsanaktsidis (KJ Tsanaktsidis). ---------------------------------------- Bug #20310: ASAN fake stacks need to be marked during GC for non-current execution context https://bugs.ruby-lang.org/issues/20310 * Author: kjtsanaktsidis (KJ Tsanaktsidis) * Status: Assigned * Assignee: kjtsanaktsidis (KJ Tsanaktsidis) * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- When ASAN (address sanitizer) is enabled, the compiler does not necessarily store all local variables on the real machine stack; instead, locals can be stored in per-frame heap allocated memory which ASAN uses to detect things like stack-use-after-return ("fake stacks"). A pointer to the fake stack is left on the real machine stack, so it's possible to discover these fake stacks during GC and mark locals stored there as well. At the moment, Ruby is currently marking these fake stacks for the current execution context which triggered GC, as part of `mark_current_machine_context`: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/…. However, there are other machine stacks which also need to be marked like this: * Machine stacks for other threads which did not trigger GC are marked in `rb_execution_context_mark` here: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/… * Machine stacks for fibers are marked in `cont_mark` here: https://github.com/ruby/ruby/blob/fe0b704df5553bdd59e90650ffbbfac785a2e48a/… We need to make these two kinds of stacks perform the same ASAN fake stack marking as `mark_current_machine_context` does. (P.S. - `callcc` continuations are another kind of machine stack which get marked, but ASAN is not compatible with callcc, so this doesn't really matter). (P.S. - it appears to me that the currently-switched-to fiber will have its stack marked _twice_; once in `rb_execution_context_mark` or `mark_current_machine_context, and once in `cont_mark`; if this is true, I will fix this too) -- https://bugs.ruby-lang.org/
2 2
0 0
  • ← Newer
  • 1
  • ...
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.