ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
@ 2024-01-30 11:47 yahonda (Yasuo Honda) via ruby-core
  2024-01-30 12:19 ` [ruby-core:116504] " byroot (Jean Boussier) via ruby-core
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yahonda (Yasuo Honda) via ruby-core @ 2024-01-30 11:47 UTC (permalink / raw
  To: ruby-core; +Cc: yahonda (Yasuo Honda)

Issue #20227 has been reported by yahonda (Yasuo Honda).

----------------------------------------
Bug #20227: Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
https://bugs.ruby-lang.org/issues/20227

* Author: yahonda (Yasuo Honda)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2024-01-23T20:09:57Z master c84237f953) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81

Rails CI against Ruby master branch gets failed
https://buildkite.com/rails/rails-nightly/builds/85#018d3dec-4a38-41cb-9ebf-1cbc78a697ba/1147-1156

```
Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]
```

This diff is longer, the difference is that the "Source Location" shows `<internal:array>` while the path to the route file like `/rails/actionpack/test/dispatch/routing/inspector_test.rb` expected. FYI, "Source Location" feature has been added to Rails via https://github.com/rails/rails/commit/a00e548da7a

I can reproduce this failure locally as follows.

- Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actionpack
bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
```

- Actual result
```
$ bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
... snip ...
Run options: -n test_routes_when_expanded --seed 20764

# Running:

F

Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]



bin/test test/dispatch/routing/inspector_test.rb:319



Finished in 0.051798s, 19.3056 runs/s, 19.3056 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:116504] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
  2024-01-30 11:47 [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81 yahonda (Yasuo Honda) via ruby-core
@ 2024-01-30 12:19 ` byroot (Jean Boussier) via ruby-core
  2024-01-30 17:57 ` [ruby-core:116512] " k0kubun (Takashi Kokubun) via ruby-core
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-01-30 12:19 UTC (permalink / raw
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20227 has been updated by byroot (Jean Boussier).

Status changed from Open to Closed

@yahonda this isn't a regression, it happens when methods are migrated from pure to to the new Primitive system. It's Rails that should be fixed.

----------------------------------------
Bug #20227: Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
https://bugs.ruby-lang.org/issues/20227#change-106523

* Author: yahonda (Yasuo Honda)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2024-01-23T20:09:57Z master c84237f953) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81

Rails CI against Ruby master branch gets failed
https://buildkite.com/rails/rails-nightly/builds/85#018d3dec-4a38-41cb-9ebf-1cbc78a697ba/1147-1156

```
Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]
```

This diff is longer, the difference is that the "Source Location" shows `<internal:array>` while the path to the route file like `/rails/actionpack/test/dispatch/routing/inspector_test.rb` expected. FYI, "Source Location" feature has been added to Rails via https://github.com/rails/rails/commit/a00e548da7a

I can reproduce this failure locally as follows.

- Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actionpack
bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
```

- Actual result
```
$ bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
... snip ...
Run options: -n test_routes_when_expanded --seed 20764

# Running:

F

Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]



bin/test test/dispatch/routing/inspector_test.rb:319



Finished in 0.051798s, 19.3056 runs/s, 19.3056 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:116512] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
  2024-01-30 11:47 [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81 yahonda (Yasuo Honda) via ruby-core
  2024-01-30 12:19 ` [ruby-core:116504] " byroot (Jean Boussier) via ruby-core
@ 2024-01-30 17:57 ` k0kubun (Takashi Kokubun) via ruby-core
  2024-01-30 19:23 ` [ruby-core:116513] " byroot (Jean Boussier) via ruby-core
  2024-01-30 23:06 ` [ruby-core:116518] " Eregon (Benoit Daloze) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2024-01-30 17:57 UTC (permalink / raw
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #20227 has been updated by k0kubun (Takashi Kokubun).


As Jean said, this is intentional. It's not new in Ruby 3.4 that we're changing backtraces by Ruby rewrite (Ruby 3.0: `Kernel#tap` and `Kernel#then`, Ruby 3.3: `Kernel#loop` and `Integer#times`), but I guess `Array#each` is more commonly used than those precedents. I added a NEWS entry about [Feature #20182] at commit:1891b4b6c3d40bd7dca085915f5d28ba97ebd156 to make the change easier to discover.

----------------------------------------
Bug #20227: Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
https://bugs.ruby-lang.org/issues/20227#change-106531

* Author: yahonda (Yasuo Honda)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2024-01-23T20:09:57Z master c84237f953) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81

Rails CI against Ruby master branch gets failed
https://buildkite.com/rails/rails-nightly/builds/85#018d3dec-4a38-41cb-9ebf-1cbc78a697ba/1147-1156

```
Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]
```

This diff is longer, the difference is that the "Source Location" shows `<internal:array>` while the path to the route file like `/rails/actionpack/test/dispatch/routing/inspector_test.rb` expected. FYI, "Source Location" feature has been added to Rails via https://github.com/rails/rails/commit/a00e548da7a

I can reproduce this failure locally as follows.

- Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actionpack
bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
```

- Actual result
```
$ bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
... snip ...
Run options: -n test_routes_when_expanded --seed 20764

# Running:

F

Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]



bin/test test/dispatch/routing/inspector_test.rb:319



Finished in 0.051798s, 19.3056 runs/s, 19.3056 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:116513] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
  2024-01-30 11:47 [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81 yahonda (Yasuo Honda) via ruby-core
  2024-01-30 12:19 ` [ruby-core:116504] " byroot (Jean Boussier) via ruby-core
  2024-01-30 17:57 ` [ruby-core:116512] " k0kubun (Takashi Kokubun) via ruby-core
@ 2024-01-30 19:23 ` byroot (Jean Boussier) via ruby-core
  2024-01-30 23:06 ` [ruby-core:116518] " Eregon (Benoit Daloze) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-01-30 19:23 UTC (permalink / raw
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20227 has been updated by byroot (Jean Boussier).


For the record I fixed it in Rails with https://github.com/rails/rails/pull/50923.

----------------------------------------
Bug #20227: Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
https://bugs.ruby-lang.org/issues/20227#change-106532

* Author: yahonda (Yasuo Honda)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2024-01-23T20:09:57Z master c84237f953) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81

Rails CI against Ruby master branch gets failed
https://buildkite.com/rails/rails-nightly/builds/85#018d3dec-4a38-41cb-9ebf-1cbc78a697ba/1147-1156

```
Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]
```

This diff is longer, the difference is that the "Source Location" shows `<internal:array>` while the path to the route file like `/rails/actionpack/test/dispatch/routing/inspector_test.rb` expected. FYI, "Source Location" feature has been added to Rails via https://github.com/rails/rails/commit/a00e548da7a

I can reproduce this failure locally as follows.

- Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actionpack
bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
```

- Actual result
```
$ bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
... snip ...
Run options: -n test_routes_when_expanded --seed 20764

# Running:

F

Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]



bin/test test/dispatch/routing/inspector_test.rb:319



Finished in 0.051798s, 19.3056 runs/s, 19.3056 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:116518] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
  2024-01-30 11:47 [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81 yahonda (Yasuo Honda) via ruby-core
                   ` (2 preceding siblings ...)
  2024-01-30 19:23 ` [ruby-core:116513] " byroot (Jean Boussier) via ruby-core
@ 2024-01-30 23:06 ` Eregon (Benoit Daloze) via ruby-core
  3 siblings, 0 replies; 5+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2024-01-30 23:06 UTC (permalink / raw
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #20227 has been updated by Eregon (Benoit Daloze).


FWIW I'm keeping https://gist.github.com/eregon/912e6359e83781c5fa1c638d3768c526 to show that more methods are being implemented in Ruby (it's great).
And indeed that means gems sometimes need to handle backtrace entries starting with `<internal:` more explicitly as before it would just be the caller's location being repeated (when the method is defined in C).

----------------------------------------
Bug #20227: Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81
https://bugs.ruby-lang.org/issues/20227#change-106537

* Author: yahonda (Yasuo Honda)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2024-01-23T20:09:57Z master c84237f953) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81

Rails CI against Ruby master branch gets failed
https://buildkite.com/rails/rails-nightly/builds/85#018d3dec-4a38-41cb-9ebf-1cbc78a697ba/1147-1156

```
Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]
```

This diff is longer, the difference is that the "Source Location" shows `<internal:array>` while the path to the route file like `/rails/actionpack/test/dispatch/routing/inspector_test.rb` expected. FYI, "Source Location" feature has been added to Rails via https://github.com/rails/rails/commit/a00e548da7a

I can reproduce this failure locally as follows.

- Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actionpack
bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
```

- Actual result
```
$ bin/test test/dispatch/routing/inspector_test.rb -n test_routes_when_expanded
... snip ...
Run options: -n test_routes_when_expanded --seed 20764

# Running:

F

Failure:
ActionDispatch::Routing::RoutesInspectorTest#test_routes_when_expanded [test/dispatch/routing/inspector_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:333", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:334", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:335", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI
                | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/routing/inspector_test.rb:329"]
+["--[ Route 1 ]----------", "Prefix            | custom_assets", "Verb              | GET", "URI               | /custom/assets(.:format)", "Controller#Action | custom_assets#show", "Source Location   | <internal:array>:52", "--[ Route 2 ]----------", "Prefix            | custom_furnitures", "Verb              | GET", "URI               | /custom/furnitures(.:format)", "Controller#Action | custom_furnitures#show", "Source Location   | <internal:array>:52", "--[ Route 3 ]----------", "Prefix            | blog", "Verb              | ", "URI               | /blog", "Controller#Action | Blog::Engine", "Source Location   | <internal:array>:52", "", "[ Routes for Blog::Engine ]", "--[ Route 1 ]----------", "Prefix            | cart", "Verb              | GET", "URI               | /cart(.:format)", "Controller#Action | cart#show", "Source Location   | <internal:array>:52"]



bin/test test/dispatch/routing/inspector_test.rb:319



Finished in 0.051798s, 19.3056 runs/s, 19.3056 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-30 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 11:47 [ruby-core:116503] [Ruby master Bug#20227] Unexpected "<internal:array>" appears since c84237f9531aed3b204d3fdacc2dd9d2bd4c7d81 yahonda (Yasuo Honda) via ruby-core
2024-01-30 12:19 ` [ruby-core:116504] " byroot (Jean Boussier) via ruby-core
2024-01-30 17:57 ` [ruby-core:116512] " k0kubun (Takashi Kokubun) via ruby-core
2024-01-30 19:23 ` [ruby-core:116513] " byroot (Jean Boussier) via ruby-core
2024-01-30 23:06 ` [ruby-core:116518] " Eregon (Benoit Daloze) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).