Issue #20471 has been reported by budiljak (Benjamin Udiljak).
----------------------------------------
Bug #20471: Problem creating a file on a windows share and copy it afterwards
https://bugs.ruby-lang.org/issues/20471
* Author: budiljak (Benjamin Udiljak)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Hi,
in my Rails application I have the requirement to create a file and copy it to another place on the same windows share. But if I write the file with `File` class and try to copy it with `FileUtils.cp` it hangs indefinitely without any error message. I can't even kill the ruby process.
You can easily reproduce the bug by entering this in IRB:
```
filename = "/mnt/windows_share/abc"; File.open(filename, 'wb') { |f| f.write("123" * 1000) }; FileUtils.cp(filename, filename + "d")
```
I tested this on a Ubuntu 22.04 server in the AWS cloud.
I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help.
Probably it's a problem in connection with the `cifs-utils` package.
Please come back to me if you need further information.
Regards!
Ben
--
https://bugs.ruby-lang.org/
Issue #20469 has been reported by shan (Shannon Skipper).
----------------------------------------
Feature #20469: Add a JSON addition for Enumerator::ArithmeticSequence
https://bugs.ruby-lang.org/issues/20469
* Author: shan (Shannon Skipper)
* Status: Open
----------------------------------------
There's a JSON addition for `Range` but one wasn't added for `Enumerator::ArithmeticSequence` when it was introduced. This little PR adds a JSON addition for ArithmeticSequence for parity with a normal Range. https://github.com/ruby/ruby/pull/10720/files
``` ruby
##
# Already supported
require 'json/add/range'
(0..42).to_json
##
# Proposed addition
require 'json/add/arithmetic_sequence'
((0..42) % 3).to_json
```
I was curious about adding it to `add/core.rb` but it seems like that could be considered separately, especially since there are classes like Set that could also be considered for inclusion now that it's a core class.
--
https://bugs.ruby-lang.org/
Issue #20464 has been reported by kddnewton (Kevin Newton).
----------------------------------------
Bug #20464: Redundant returns are unreachable in coverage
https://bugs.ruby-lang.org/issues/20464
* Author: kddnewton (Kevin Newton)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
With the following code:
```ruby
def meth_return(a)
return if a
return
end
```
If you run coverage on it, it's not possible for it to hit line 3, because there isn't a line event, because the return node was eliminated from the AST before it was compiled. There is a `putnil` instruction, so it's possible for us to attach a line event for it, but the compiler doesn't today.
--
https://bugs.ruby-lang.org/
Issue #20094 has been reported by sisyphus_cg (Sisyphus CG).
----------------------------------------
Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0
https://bugs.ruby-lang.org/issues/20094
* 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
----------------------------------------
The behavior of the inline while loop has changed in 3.3.0. This unexpectedly broke my code and I couldn't find anything in the changelog about it so reporting it as a bug.
In ruby <= 3.2:
``` ruby
(p 1) while false # nothing
(p 1; p 2) while false # nothing
```
In ruby 3.3:
``` ruby
(p 1) while false # 1
(p 1; p 2) while false # 1 2
```
Essentially, if the left hand side looks like a statement, now it is treated as a do-while loop. In ruby 3.2 and less this only happened with explicit use of `begin` and `end`.
--
https://bugs.ruby-lang.org/
Issue #20466 has been reported by tenderlovemaking (Aaron Patterson).
----------------------------------------
Bug #20466: Interpolated regular expressions have different encoding than interpolated strings
https://bugs.ruby-lang.org/issues/20466
* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
When the encoding is set to US-ASCII, interpolated strings can have different encoding than interpolated regular expressions. I think they should have the same encoding:
```ruby
# encoding: US-ASCII
t0 = '\\xc1'
t1 = "#{t0}"
re = /#{t0}/
p [t0.encoding, t1.encoding, re.encoding]
```
Output is:
```
$ ./miniruby -v test.rb
ruby 3.4.0dev (2024-05-02T15:27:18Z master 7c0cf71049) [arm64-darwin23]
[#<Encoding:US-ASCII>, #<Encoding:US-ASCII>, #<Encoding:BINARY (ASCII-8BIT)>]
```
--
https://bugs.ruby-lang.org/
Issue #20463 has been reported by tyatin (Serg Tyatin).
----------------------------------------
Bug #20463: Ruby fails to generate warning for require syslog
https://bugs.ruby-lang.org/issues/20463
* Author: tyatin (Serg Tyatin)
* Status: Open
* ruby -v: 3.3.1
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
```
docker run -it ruby:3.3.1 bash
touch Gemfile
bundle
bundle exec ruby -e "require '/usr/local/lib/ruby/3.3.0/x86_64-linux/syslog'"
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:130:in `<': comparison of String with nil failed (ArgumentError)
msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
^^^^^^^^^^
from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:130:in `build_message'
from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:126:in `warning?'
from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:71:in `block (2 levels) in replace_require'
from -e:1:in `<main>'
```
the same happens on M1 mac
--
https://bugs.ruby-lang.org/
Issue #20462 has been reported by tenderlovemaking (Aaron Patterson).
----------------------------------------
Bug #20462: Native threads are no longer reused
https://bugs.ruby-lang.org/issues/20462
* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Ruby used to reuse native threads in order to amortize the cost of making a pthread.
For example this program:
```ruby
ntids = 1000.times.map {
Thread.new {
Thread.current.native_thread_id
}.value
}
p ntids.uniq.length
```
With Ruby 3.2.0, this would return 1. With Ruby 3.3.x, it returns 1000. It means we cannot amortize the cost of a pthread for short lived threads.
I was able to bisect this to commit be1bbd5b7d40ad863ab35097765d3754726bbd54. But the change is big so I don't know how to fix it.
--
https://bugs.ruby-lang.org/
Issue #20451 has been reported by Bo98 (Bo Anderson).
----------------------------------------
Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build
https://bugs.ruby-lang.org/issues/20451
* Author: Bo98 (Bo Anderson)
* Status: Open
* ruby -v: 3.1.5p252
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07
However this backport directly breaks the build:
```
closure.c:279:60: error: use of undeclared identifier 'data'
result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self));
^
```
The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b….
The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue.
--
https://bugs.ruby-lang.org/
Issue #20457 has been reported by tenderlovemaking (Aaron Patterson).
----------------------------------------
Bug #20457: Final `return` is eliminated from the AST
https://bugs.ruby-lang.org/issues/20457
* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Given the following code:
```ruby
def foo
a = 1
return a
end
```
If you parse this with RubyVM::AbstractSyntaxTree, the AST will be missing the `return` node. Of course the `return` node isn't necessary for compilation, but would be required for building an LSP for example.
Here's a full program to demonstrate:
```ruby
ast = RubyVM::AbstractSyntaxTree.parse DATA.read
pp ast
# Output is like this:
#
# (SCOPE@1:0-4:3
# tbl: []
# args: nil
# body:
# (DEFN@1:0-4:3
# mid: :foo
# body:
# (SCOPE@1:0-4:3
# tbl: [:a]
# args: (ARGS@1:7-1:7 pre_num: 0 pre_init: nil opt: nil first_post: nil post_num: 0 post_init: nil rest: nil kw: nil kwrest: nil block: nil)
# body: (BLOCK@2:2-3:10 (LASGN@2:2-2:7 :a (INTEGER@2:6-2:7 1)) (LVAR@3:9-3:10 :a)))))
__END__
def foo
a = 1
return a
end
```
Btw, I'm happy to write failing tests for this type of stuff I'm just not sure where to put it! :)
--
https://bugs.ruby-lang.org/