Project

General

Profile

Actions

Bug #20588

closed

RangeError: integer 132186463059104 too big to convert to 'int' since cdf33ed5f37f9649c482c3ba1d245f0d80ac01ce with YJIT enabled

Added by yahonda (Yasuo Honda) 5 months ago. Updated 4 months ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-06-18T16:28:25Z master cdf33ed5f3) [x86_64-linux]
[ruby-core:118360]

Description

Managed to reproduce Rails CI failure https://buildkite.com/rails/rails-nightly/builds/679#0190324d-b73c-4602-b026-9c40cf9ca4a8

Steps to reproduce

git clone https://github.com/rails/rails
cd rails/activerecord
bundle install
RUBY_YJIT_ENABLE=1 bin/test test/cases/scoping/relation_scoping_test.rb test/cases/associations/eager_test.rb --seed 1670

Expected behavior

It should pass.

Actual behavior

It always raises the RangeError.

$ RUBY_YJIT_ENABLE=1 bin/test test/cases/scoping/relation_scoping_test.rb test/cases/associations/eager_test.rb --seed 1670
Using sqlite3
Run options: --seed 1670

# Running:

........E

Error:
EagerAssociationTest#test_including_association_based_on_sql_condition_and_no_database_column:
RangeError: integer 124299148641408 too big to convert to 'int'
    lib/active_record/relation.rb:548:in 'block in ActiveRecord::Relation#_exec_scope'
    lib/active_record/relation.rb:1359:in 'ActiveRecord::Relation#_scoping'
    lib/active_record/relation.rb:548:in 'ActiveRecord::Relation#_exec_scope'
    lib/active_record/scoping/named.rb:175:in 'block in Owner.scope'
    test/cases/associations/eager_test.rb:1524:in 'block in <class:EagerAssociationTest>'


bin/test test/cases/associations/eager_test.rb:1523

............................................................................................................................................................................................................................................................

Finished in 6.256788s, 41.7147 runs/s, 138.4097 assertions/s.
261 runs, 866 assertions, 0 failures, 1 errors, 0 skips
$

Additional information

It does not reproduce when YJIT is disabled like bin/test test/cases/scoping/relation_scoping_test.rb test/cases/associations/eager_test.rb --seed 1670
According to git bisect, this exception raised since https://github.com/ruby/ruby/commit/cdf33ed5f37f9649c482c3ba1d245f0d80ac01ce

Updated by yahonda (Yasuo Honda) 5 months ago

It also reproduces with the latest master branch.

$ ruby -v
ruby 3.4.0dev (2024-06-20T03:52:09Z master fbe56b1c17) [x86_64-linux]
$ RUBY_YJIT_ENABLE=1 bin/test test/cases/scoping/relation_scoping_test.rb test/cases/associations/eager_test.rb --seed 1670
Using sqlite3
Run options: --seed 1670

# Running:

........E

Error:
EagerAssociationTest#test_including_association_based_on_sql_condition_and_no_database_column:
RangeError: integer 137816943299296 too big to convert to 'int'
    lib/active_record/relation.rb:548:in 'block in ActiveRecord::Relation#_exec_scope'
    lib/active_record/relation.rb:1359:in 'ActiveRecord::Relation#_scoping'
    lib/active_record/relation.rb:548:in 'ActiveRecord::Relation#_exec_scope'
    lib/active_record/scoping/named.rb:175:in 'block in Owner.scope'
    test/cases/associations/eager_test.rb:1524:in 'block in <class:EagerAssociationTest>'


bin/test test/cases/associations/eager_test.rb:1523

............................................................................................................................................................................................................................................................

Finished in 6.238378s, 41.8378 runs/s, 138.8181 assertions/s.
261 runs, 866 assertions, 0 failures, 1 errors, 0 skips
$

Updated by byroot (Jean Boussier) 5 months ago

  • Assignee set to tenderlovemaking (Aaron Patterson)
  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED

Updated by yahonda (Yasuo Honda) 4 months ago

There is another Rails CI failure https://buildkite.com/rails/rails-nightly/builds/683#01903773-e527-4777-8dd1-7656c1ab9cbc/1214-1277 since cdf33ed5f3

$ ruby -v
ruby 3.4.0dev (2024-06-18T16:28:25Z master cdf33ed5f3) [x86_64-linux]
$ git clone https://github.com/rails/rails
$ cd rails/activestorage
$ bundle
$ bin/test "test/analyzer/audio_analyzer_test.rb" "test/analyzer/image_analyzer/image_magick_test.rb" "test/analyzer/image_analyzer/vips_test.rb" "test/analyzer/video_analyzer_test.rb" "test/controllers/blobs/proxy_controller_test.rb" "test/controllers/blobs/redirect_controller_test.rb" "test/controllers/direct_uploads_controller_test.rb" "test/controllers/disk_controller_test.rb" "test/controllers/representations/proxy_controller_test.rb" "test/controllers/representations/redirect_controller_test.rb" "test/engine_test.rb" "test/fixture_set_test.rb" "test/javascript_package_test.rb" "test/jobs/analyze_job_test.rb" "test/jobs/preview_image_job_test.rb" "test/jobs/purge_job_test.rb" "test/jobs/transform_job_test.rb" "test/migrations_test.rb" "test/models/attached/many_test.rb" "test/models/attached/one_test.rb" "test/models/attachment_test.rb" "test/models/blob_test.rb" "test/models/filename_test.rb" "test/models/presence_validation_test.rb" "test/models/preview_test.rb" "test/models/reflection_test.rb" "test/models/representation_test.rb" "test/models/strict_loading_test.rb" "test/models/variant_test.rb" "test/models/variant_with_record_test.rb" "test/previewer/mupdf_previewer_test.rb" "test/previewer/poppler_pdf_previewer_test.rb" "test/previewer/video_previewer_test.rb" "test/service/azure_storage_public_service_test.rb" "test/service/azure_storage_service_test.rb" "test/service/configurator_test.rb" "test/service/disk_public_service_test.rb" "test/service/disk_service_test.rb" "test/service/gcs_public_service_test.rb" "test/service/gcs_service_test.rb" "test/service/mirror_service_test.rb" "test/service/s3_public_service_test.rb" "test/service/s3_service_test.rb" "test/template/audio_tag_test.rb" "test/template/image_tag_test.rb" "test/template/video_tag_test.rb" "test/urls/rails_storage_proxy_url_test.rb" "test/urls/rails_storage_redirect_url_test.rb" --seed 9888
  • Actual result
Failure:
ActiveStorage::Representations::ProxyControllerWithPreviewsTest#test_showing_preview_inline [test/controllers/representations/proxy_controller_test.rb:135]:
Expected response to be a <200: ok>, but was a <500: Internal Server Error>
Response body: .
Expected: 200
  Actual: 500


bin/test test/controllers/representations/proxy_controller_test.rb:129

...........................

Finished in 18.296045s, 26.3445 runs/s, 79.6894 assertions/s.
482 runs, 1458 assertions, 1 failures, 0 errors, 1 skips

You have skipped tests. Run with --verbose for details.
$

Updated by byroot (Jean Boussier) 4 months ago

I'll try to get the underlying error for that one.

@tenderlovemaking (Aaron Patterson) is looking at these issues, but he's at a company event this week, so not much will happen until next week.

Updated by byroot (Jean Boussier) 4 months ago

So that proxy_controller_test failure I can't repro locally it seems, but I see it actually crashed on another build with YJIT in debug mode:

Assertion Failed: /usr/src/ruby/vm_callinfo.h:115:vm_ci_packed_p:imemo_type_p((VALUE)(ci), imemo_callinfo)
ruby 3.4.0dev (2024-06-21T09:25:03Z master bf061ce6fe) +YJIT [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0108 p:0027 s:0727 e:000724 METHOD /rails/activestorage/app/models/active_storage/variant_with_record.rb:36
c:0107 p:0014 s:0719 e:000718 METHOD /rails/activestorage/app/models/active_storage/preview.rb:92
c:0106 p:0006 s:0714 e:000713 BLOCK  /rails/activestorage/app/controllers/concerns/active_storage/streaming.rb:61
c:0105 p:0087 s:0710 e:000709 BLOCK  /rails/actionpack/lib/action_controller/metal/live.rb:359
c:0104 p:0033 s:0707 e:000706 METHOD /rails/activesupport/lib/active_support/notifications.rb:212
c:0103 p:0034 s:0701 e:000700 METHOD /rails/actionpack/lib/action_controller/metal/live.rb:350
c:0102 p:0030 s:0692 e:000691 METHOD /rails/activestorage/app/controllers/concerns/active_storage/streaming.rb:57
c:0101 p:0013 s:0685 e:000684 BLOCK  /rails/activestorage/app/controllers/active_storage/representations/proxy_controller.rb:15
c:0100 p:0034 s:0682 e:000681 METHOD /rails/actionpack/lib/action_controller/metal/conditional_get.rb:321
c:0099 p:0006 s:0676 e:000675 METHOD /rails/activestorage/app/controllers/active_storage/representations/proxy_controller.rb:14
c:0098 p:0010 s:0672 e:000671 METHOD /rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb:8
c:0097 p:0006 s:0665 e:000664 METHOD /rails/actionpack/lib/abstract_controller/base.rb:226
c:0096 p:0022 s:0659 e:000658 METHOD /rails/actionpack/lib/action_controller/metal/rendering.rb:193
c:0095 p:0006 s:0654 e:000653 BLOCK  /rails/actionpack/lib/abstract_controller/callbacks.rb:261 [FINISH]
c:0094 p:0048 s:0651 e:000649 BLOCK  /rails/activesupport/lib/active_support/callbacks.rb:121
c:0093 p:0018 s:0641 e:000640 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/turbo-rails-2.0.5/lib/turbo-rails.rb:24
c:0092 p:0016 s:0635 e:000634 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/turbo-rails-2.0.5/app/controllers/concerns/turbo/request_id_tracking.rb:10
c:0091 p:0127 s:0630 e:000629 BLOCK  /rails/activesupport/lib/active_support/callbacks.rb:130
c:0090 p:0013 s:0621 e:000620 METHOD /rails/actiontext/lib/action_text/rendering.rb:25
c:0089 p:0009 s:0615 e:000614 BLOCK  /rails/actiontext/lib/action_text/engine.rb:71 [FINISH]
c:0088 p:---- s:0610 e:000609 CFUNC  :instance_exec
c:0087 p:0127 s:0604 e:000603 BLOCK  /rails/activesupport/lib/active_support/callbacks.rb:130 [FINISH]
c:0086 p:0110 s:0595 E:0019b0 METHOD /rails/activesupport/lib/active_support/callbacks.rb:141
c:0085 p:0006 s:0584 E:000440 METHOD /rails/actionpack/lib/abstract_controller/callbacks.rb:260 [FINISH]
c:0084 p:0008 s:0578 e:000577 METHOD /rails/actionpack/lib/action_controller/metal/rescue.rb:27
c:0083 p:0009 s:0572 e:000571 BLOCK  /rails/actionpack/lib/action_controller/metal/instrumentation.rb:77
c:0082 p:0010 s:0566 e:000565 BLOCK  /rails/activesupport/lib/active_support/notifications.rb:210
c:0081 p:0027 s:0563 e:000562 METHOD /rails/activesupport/lib/active_support/notifications/instrumenter.rb:58
c:0080 p:0023 s:0555 e:000554 METHOD /rails/activesupport/lib/active_support/notifications.rb:210
c:0079 p:0084 s:0549 e:000548 METHOD /rails/actionpack/lib/action_controller/metal/instrumentation.rb:76
c:0078 p:0017 s:0543 e:000542 METHOD /rails/actionpack/lib/action_controller/metal/params_wrapper.rb:259
c:0077 p:0015 s:0538 e:000537 METHOD /rails/activerecord/lib/active_record/railties/controller_runtime.rb:39
c:0076 p:0070 s:0532 e:000531 METHOD /rails/actionpack/lib/abstract_controller/base.rb:163
c:0075 p:0033 s:0522 e:000521 METHOD /rails/actionview/lib/action_view/rendering.rb:40
c:0074 p:0029 s:0515 e:000514 BLOCK  /rails/actionpack/lib/action_controller/metal/live.rb:291
c:0073 p:0006 s:0509 e:000508 METHOD /rails/activesupport/lib/active_support/concurrency/share_lock.rb:162
c:0072 p:0009 s:0505 e:000504 METHOD /rails/activesupport/lib/active_support/dependencies/interlock.rb:37
c:0071 p:0008 s:0500 e:000499 BLOCK  /rails/actionpack/lib/action_controller/metal/live.rb:282
c:0070 p:0002 s:0497 e:000496 METHOD /rails/actionpack/lib/action_controller/test_case.rb:27
c:0069 p:0022 s:0493 e:000492 METHOD /rails/actionpack/lib/action_controller/metal/live.rb:281
c:0068 p:0017 s:0485 e:000484 METHOD /rails/actionpack/lib/action_controller/metal.rb:227
c:0067 p:0033 s:0478 e:000477 METHOD /rails/actionpack/lib/action_controller/metal.rb:310
c:0066 p:0010 s:0471 e:000470 METHOD /rails/actionpack/lib/action_dispatch/routing/route_set.rb:67
c:0065 p:0036 s:0463 e:000462 METHOD /rails/actionpack/lib/action_dispatch/routing/route_set.rb:50
c:0064 p:0122 s:0455 e:000454 BLOCK  /rails/actionpack/lib/action_dispatch/journey/router.rb:53 [FINISH]
c:0063 p:0032 s:0442 e:000441 BLOCK  /rails/actionpack/lib/action_dispatch/journey/router.rb:133
c:0062 p:0027 s:0436 e:000435 METHOD <internal:array>:54
c:0061 p:0057 s:0430 e:000429 METHOD /rails/actionpack/lib/action_dispatch/journey/router.rb:126
c:0060 p:0006 s:0423 e:000422 METHOD /rails/actionpack/lib/action_dispatch/journey/router.rb:34
c:0059 p:0027 s:0418 e:000417 METHOD /rails/actionpack/lib/action_dispatch/routing/route_set.rb:896
c:0058 p:0028 s:0412 e:000411 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/tempfile_reaper.rb:20
c:0057 p:0007 s:0404 e:000403 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/etag.rb:29
c:0056 p:0043 s:0394 e:000393 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/conditional_get.rb:31
c:0055 p:0007 s:0385 e:000384 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/head.rb:15
c:0054 p:0007 s:0377 e:000376 METHOD /rails/actionpack/lib/action_dispatch/http/permissions_policy.rb:38
c:0053 p:0007 s:0367 e:000366 METHOD /rails/actionpack/lib/action_dispatch/http/content_security_policy.rb:36
c:0052 p:0026 s:0353 e:000352 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272
c:0051 p:0005 s:0342 e:000341 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266
c:0050 p:0015 s:0337 e:000336 METHOD /rails/actionpack/lib/action_dispatch/middleware/cookies.rb:704
c:0049 p:0008 s:0329 e:000328 BLOCK  /rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:31
c:0048 p:0027 s:0326 e:000325 METHOD /rails/activesupport/lib/active_support/callbacks.rb:101
c:0047 p:0009 s:0316 e:000315 METHOD /rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:30
c:0046 p:0022 s:0309 e:000308 METHOD /rails/actionpack/lib/action_dispatch/middleware/actionable_exceptions.rb:18
c:0045 p:0007 s:0303 e:000302 METHOD /rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:31
c:0044 p:0007 s:0290 e:000289 METHOD /rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:32
c:0043 p:0047 s:0281 E:001488 METHOD /rails/railties/lib/rails/rack/logger.rb:41
c:0042 p:0048 s:0268 e:000267 METHOD /rails/railties/lib/rails/rack/logger.rb:29
c:0041 p:0034 s:0262 e:000261 METHOD /rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:96
c:0040 p:0032 s:0256 e:000255 METHOD /rails/actionpack/lib/action_dispatch/middleware/request_id.rb:33
c:0039 p:0057 s:0250 e:000249 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/method_override.rb:28
c:0038 p:0013 s:0244 e:000243 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/runtime.rb:24
c:0037 p:0019 s:0234 e:000233 METHOD /rails/activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb:29
c:0036 p:0016 s:0227 e:000226 METHOD /rails/actionpack/lib/action_dispatch/middleware/executor.rb:16
c:0035 p:0018 s:0218 e:000217 METHOD /rails/actionpack/lib/action_dispatch/middleware/static.rb:27
c:0034 p:0007 s:0213 e:000212 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/sendfile.rb:114
c:0033 p:0016 s:0200 e:000199 METHOD /rails/railties/lib/rails/engine.rb:535
c:0032 p:0042 s:0194 e:000193 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-test-2.1.0/lib/rack/test.rb:360
c:0031 p:0033 s:0185 e:000184 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/rack-test-2.1.0/lib/rack/test.rb:153
c:0030 p:0323 s:0178 e:000177 METHOD /rails/actionpack/lib/action_dispatch/testing/integration.rb:287
c:0029 p:0009 s:0159 e:000158 METHOD /rails/actionpack/lib/action_dispatch/testing/integration.rb:19
c:0028 p:0012 s:0153 e:000152 METHOD /rails/actionpack/lib/action_dispatch/testing/integration.rb:378
c:0027 p:0023 s:0146 e:000145 BLOCK  /rails/activestorage/test/controllers/representations/proxy_controller_test.rb:130
c:0026 p:0012 s:0142 e:000141 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:95
c:0025 p:0002 s:0139 e:000138 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:192
c:0024 p:0004 s:0134 e:000133 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:90
c:0023 p:0008 s:0131 e:000130 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:368
c:0022 p:0004 s:0126 e:000125 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:89
c:0021 p:0022 s:0123 e:000122 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467
c:0020 p:0027 s:0115 E:0007f8 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:240
c:0019 p:0004 s:0108 E:0011d0 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:88
c:0018 p:0006 s:0104 e:000103 BLOCK  /rails/activesupport/lib/active_support/executor/test_helper.rb:5
c:0017 p:0012 s:0101 e:000100 METHOD /rails/activesupport/lib/active_support/execution_wrapper.rb:104
c:0016 p:0009 s:0096 e:000095 METHOD /rails/activesupport/lib/active_support/executor/test_helper.rb:5
c:0015 p:0008 s:0091 e:000090 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:1200
c:0014 p:0019 s:0084 e:000082 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:433
c:0013 p:0009 s:0076 e:000075 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:420 [FINISH]
c:0012 p:0027 s:0072 e:000071 METHOD <internal:array>:54
c:0011 p:0005 s:0066 e:000065 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:419
c:0010 p:0022 s:0063 e:000062 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467
c:0009 p:0019 s:0055 E:001798 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:454
c:0008 p:0095 s:0048 E:0005d8 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:418
c:0007 p:0029 s:0039 e:000038 METHOD /rails/railties/lib/rails/test_unit/line_filtering.rb:10
c:0006 p:0008 s:0033 e:000032 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332 [FINISH]
c:0005 p:---- s:0029 e:000028 CFUNC  :map
c:0004 p:0025 s:0025 e:000024 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332
c:0003 p:0141 s:0016 e:000015 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:288
c:0002 p:0045 s:0008 E:001670 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:86 [FINISH]
c:0001 p:0000 s:0003 E:001900 DUMMY  [FINISH]
-- Ruby level backtrace information ----------------------------------------
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:86:in 'block in autorun'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:288:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in '__run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in 'map'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in 'block in __run'
/rails/railties/lib/rails/test_unit/line_filtering.rb:10:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:418:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:454:in 'with_info_handler'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467:in 'on_signal'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:419:in 'block in run'
<internal:array>:54:in 'each'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:420:in 'block (2 levels) in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:433:in 'run_one_method'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:1200:in 'run_one_method'
/rails/activesupport/lib/active_support/executor/test_helper.rb:5:in 'run'
/rails/activesupport/lib/active_support/execution_wrapper.rb:104:in 'perform'
/rails/activesupport/lib/active_support/executor/test_helper.rb:5:in 'block in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:88:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:240:in 'with_info_handler'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467:in 'on_signal'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:89:in 'block in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:368:in 'time_it'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:90:in 'block (2 levels) in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:192:in 'capture_exceptions'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:95:in 'block (3 levels) in run'
/rails/activestorage/test/controllers/representations/proxy_controller_test.rb:130:in 'block in <class:ProxyControllerWithPreviewsTest>'
/rails/actionpack/lib/action_dispatch/testing/integration.rb:378:in 'get'
/rails/actionpack/lib/action_dispatch/testing/integration.rb:19:in 'get'
/rails/actionpack/lib/action_dispatch/testing/integration.rb:287:in 'process'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-test-2.1.0/lib/rack/test.rb:153:in 'request'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-test-2.1.0/lib/rack/test.rb:360:in 'process_request'
/rails/railties/lib/rails/engine.rb:535:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/sendfile.rb:114:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/static.rb:27:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/executor.rb:16:in 'call'
/rails/activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/runtime.rb:24:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/method_override.rb:28:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/request_id.rb:33:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:96:in 'call'
/rails/railties/lib/rails/rack/logger.rb:29:in 'call'
/rails/railties/lib/rails/rack/logger.rb:41:in 'call_app'
/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:32:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:31:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in 'call'
/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:30:in 'call'
/rails/activesupport/lib/active_support/callbacks.rb:101:in 'run_callbacks'
/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:31:in 'block in call'
/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:704:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in 'context'
/rails/actionpack/lib/action_dispatch/http/content_security_policy.rb:36:in 'call'
/rails/actionpack/lib/action_dispatch/http/permissions_policy.rb:38:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/head.rb:15:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/conditional_get.rb:31:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/etag.rb:29:in 'call'
/usr/local/lib/ruby/gems/3.4.0+0/gems/rack-3.1.3/lib/rack/tempfile_reaper.rb:20:in 'call'
/rails/actionpack/lib/action_dispatch/routing/route_set.rb:896:in 'call'
/rails/actionpack/lib/action_dispatch/journey/router.rb:34:in 'serve'
/rails/actionpack/lib/action_dispatch/journey/router.rb:126:in 'find_routes'
<internal:array>:54:in 'each'
/rails/actionpack/lib/action_dispatch/journey/router.rb:133:in 'block in find_routes'
/rails/actionpack/lib/action_dispatch/journey/router.rb:53:in 'block in serve'
/rails/actionpack/lib/action_dispatch/routing/route_set.rb:50:in 'serve'
/rails/actionpack/lib/action_dispatch/routing/route_set.rb:67:in 'dispatch'
/rails/actionpack/lib/action_controller/metal.rb:310:in 'dispatch'
/rails/actionpack/lib/action_controller/metal.rb:227:in 'dispatch'
/rails/actionpack/lib/action_controller/metal/live.rb:281:in 'process'
/rails/actionpack/lib/action_controller/test_case.rb:27:in 'new_controller_thread'
/rails/actionpack/lib/action_controller/metal/live.rb:282:in 'block in process'
/rails/activesupport/lib/active_support/dependencies/interlock.rb:37:in 'running'
/rails/activesupport/lib/active_support/concurrency/share_lock.rb:162:in 'sharing'
/rails/actionpack/lib/action_controller/metal/live.rb:291:in 'block (2 levels) in process'
/rails/actionview/lib/action_view/rendering.rb:40:in 'process'
/rails/actionpack/lib/abstract_controller/base.rb:163:in 'process'
/rails/activerecord/lib/active_record/railties/controller_runtime.rb:39:in 'process_action'
/rails/actionpack/lib/action_controller/metal/params_wrapper.rb:259:in 'process_action'
/rails/actionpack/lib/action_controller/metal/instrumentation.rb:76:in 'process_action'
/rails/activesupport/lib/active_support/notifications.rb:210:in 'instrument'
/rails/activesupport/lib/active_support/notifications/instrumenter.rb:58:in 'instrument'
/rails/activesupport/lib/active_support/notifications.rb:210:in 'block in instrument'
/rails/actionpack/lib/action_controller/metal/instrumentation.rb:77:in 'block in process_action'
/rails/actionpack/lib/action_controller/metal/rescue.rb:27:in 'process_action'
/rails/actionpack/lib/abstract_controller/callbacks.rb:260:in 'process_action'
/rails/activesupport/lib/active_support/callbacks.rb:141:in 'run_callbacks'
/rails/activesupport/lib/active_support/callbacks.rb:130:in 'block in run_callbacks'
/rails/activesupport/lib/active_support/callbacks.rb:130:in 'instance_exec'
/rails/actiontext/lib/action_text/engine.rb:71:in 'block (4 levels) in <class:Engine>'
/rails/actiontext/lib/action_text/rendering.rb:25:in 'with_renderer'
/rails/activesupport/lib/active_support/callbacks.rb:130:in 'block in run_callbacks'
/usr/local/lib/ruby/gems/3.4.0+0/gems/turbo-rails-2.0.5/app/controllers/concerns/turbo/request_id_tracking.rb:10:in 'turbo_tracking_request_id'
/usr/local/lib/ruby/gems/3.4.0+0/gems/turbo-rails-2.0.5/lib/turbo-rails.rb:24:in 'with_request_id'
/rails/activesupport/lib/active_support/callbacks.rb:121:in 'block in run_callbacks'
/rails/actionpack/lib/abstract_controller/callbacks.rb:261:in 'block in process_action'
/rails/actionpack/lib/action_controller/metal/rendering.rb:193:in 'process_action'
/rails/actionpack/lib/abstract_controller/base.rb:226:in 'process_action'
/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb:8:in 'send_action'
/rails/activestorage/app/controllers/active_storage/representations/proxy_controller.rb:14:in 'show'
/rails/actionpack/lib/action_controller/metal/conditional_get.rb:321:in 'http_cache_forever'
/rails/activestorage/app/controllers/active_storage/representations/proxy_controller.rb:15:in 'block in show'
/rails/activestorage/app/controllers/concerns/active_storage/streaming.rb:57:in 'send_blob_stream'
/rails/actionpack/lib/action_controller/metal/live.rb:350:in 'send_stream'
/rails/activesupport/lib/active_support/notifications.rb:212:in 'instrument'
/rails/actionpack/lib/action_controller/metal/live.rb:359:in 'block in send_stream'
/rails/activestorage/app/controllers/concerns/active_storage/streaming.rb:61:in 'block in send_blob_stream'
/rails/activestorage/app/models/active_storage/preview.rb:92:in 'download'
/rails/activestorage/app/models/active_storage/variant_with_record.rb:36:in 'download'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 6
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.4(rb_print_backtrace+0x22) [0x7f0a94ba3b72] /usr/src/ruby/vm_dump.c:820
/usr/local/lib/libruby.so.3.4(fprintf+0x0) [0x7f0a94ba3d38] /usr/src/ruby/vm_dump.c:1151
/usr/local/lib/libruby.so.3.4(rb_vm_bugreport) /usr/src/ruby/vm_dump.c:1154
/usr/local/lib/libruby.so.3.4(rb_assert_failure_detail+0x122) [0x7f0a94956652] /usr/src/ruby/error.c:1189
/usr/local/lib/libruby.so.3.4(RB_BUILTIN_TYPE+0x0) [0x7f0a94956673] /usr/src/ruby/error.c:1169
/usr/local/lib/libruby.so.3.4(rb_assert_failure) (null):0
/usr/local/lib/libruby.so.3.4(VM_BH_FROM_ISEQ_BLOCK+0x0) [0x7f0a94960f07] /usr/src/ruby/vm_callinfo.h:115
/usr/local/lib/libruby.so.3.4(vm_ci_argc+0x9) [0x7f0a94b72809] /usr/src/ruby/vm_callinfo.h:156
/usr/local/lib/libruby.so.3.4(vm_caller_setup_fwd_args+0x89) [0x7f0a94b995b9] /usr/src/ruby/vm_args.c:1078
/usr/local/lib/libruby.so.3.4(rb_vm_send+0x70) [0x7f0a94b99770] /usr/src/ruby/vm_insnhelper.c:5963
[0x7f0a95203f6e]

Updated by byroot (Jean Boussier) 4 months ago

There is also:

Assertion Failed: /usr/src/ruby/include/ruby/internal/core/rarray.h:257:rb_array_len:RB_TYPE_P(a, RUBY_T_ARRAY)
ruby 3.4.0dev (2024-06-23T06:59:37Z master acce96647d) +YJIT [x86_64-linux]
actual type: 1-- Control frame information -----------------------------------------------
c:0031 p:0006 s:0172 e:000169 BLOCK  /rails/activerecord/lib/active_record/relation.rb:548
c:0030 p:0052 s:0167 e:000166 METHOD /rails/activerecord/lib/active_record/relation.rb:1359
c:0029 p:0019 s:0158 e:000157 METHOD /rails/activerecord/lib/active_record/relation.rb:548
c:0028 p:0013 s:0152 e:000151 BLOCK  /rails/activerecord/lib/active_record/scoping/named.rb:175
c:0027 p:0018 s:0146 e:000145 BLOCK  /rails/actiontext/test/unit/strict_loading_test.rb:23
c:0026 p:0012 s:0142 e:000141 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:95
c:0025 p:0002 s:0139 e:000138 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:192
c:0024 p:0004 s:0134 e:000133 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:90
c:0023 p:0008 s:0131 e:000130 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:368
c:0022 p:0004 s:0126 e:000125 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:89
c:0021 p:0022 s:0123 e:000122 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467
c:0020 p:0027 s:0115 E:001658 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:240
c:0019 p:0004 s:0108 E:001390 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:88
c:0018 p:0006 s:0104 e:000103 BLOCK  /rails/activesupport/lib/active_support/executor/test_helper.rb:5
c:0017 p:0012 s:0101 e:000100 METHOD /rails/activesupport/lib/active_support/execution_wrapper.rb:104
c:0016 p:0009 s:0096 e:000095 METHOD /rails/activesupport/lib/active_support/executor/test_helper.rb:5
c:0015 p:0008 s:0091 e:000090 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:1200
c:0014 p:0019 s:0084 e:000082 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:433
c:0013 p:0009 s:0076 e:000075 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:420 [FINISH]
c:0012 p:0027 s:0072 e:000071 METHOD <internal:array>:54
c:0011 p:0005 s:0066 e:000065 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:419
c:0010 p:0022 s:0063 e:000062 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467
c:0009 p:0019 s:0055 E:001ee8 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:454
c:0008 p:0095 s:0048 E:001ba8 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:418
c:0007 p:0029 s:0039 e:000038 METHOD /rails/railties/lib/rails/test_unit/line_filtering.rb:10
c:0006 p:0008 s:0033 e:000032 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332 [FINISH]
c:0005 p:---- s:0029 e:000028 CFUNC  :map
c:0004 p:0025 s:0025 e:000024 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332
c:0003 p:0141 s:0016 e:000015 METHOD /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:288
c:0002 p:0045 s:0008 E:001390 BLOCK  /usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:86 [FINISH]
c:0001 p:0000 s:0003 E:000770 DUMMY  [FINISH]
-- Ruby level backtrace information ----------------------------------------
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:86:in 'block in autorun'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:288:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in '__run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in 'map'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:332:in 'block in __run'
/rails/railties/lib/rails/test_unit/line_filtering.rb:10:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:418:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:454:in 'with_info_handler'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467:in 'on_signal'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:419:in 'block in run'
<internal:array>:54:in 'each'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:420:in 'block (2 levels) in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:433:in 'run_one_method'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:1200:in 'run_one_method'
/rails/activesupport/lib/active_support/executor/test_helper.rb:5:in 'run'
/rails/activesupport/lib/active_support/execution_wrapper.rb:104:in 'perform'
/rails/activesupport/lib/active_support/executor/test_helper.rb:5:in 'block in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:88:in 'run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:240:in 'with_info_handler'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:467:in 'on_signal'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:89:in 'block in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest.rb:368:in 'time_it'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:90:in 'block (2 levels) in run'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:192:in 'capture_exceptions'
/usr/local/lib/ruby/gems/3.4.0+0/gems/minitest-5.24.0/lib/minitest/test.rb:95:in 'block (3 levels) in run'
/rails/actiontext/test/unit/strict_loading_test.rb:23:in 'block in <class:StrictLoadingTest>'
/rails/activerecord/lib/active_record/scoping/named.rb:175:in 'block in scope'
/rails/activerecord/lib/active_record/relation.rb:548:in '_exec_scope'
/rails/activerecord/lib/active_record/relation.rb:1359:in '_scoping'
/rails/activerecord/lib/active_record/relation.rb:548:in 'block in _exec_scope'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 4
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.4(rb_print_backtrace+0x22) [0x7f4f61fc6b72] /usr/src/ruby/vm_dump.c:820
/usr/local/lib/libruby.so.3.4(fprintf+0x0) [0x7f4f61fc6d38] /usr/src/ruby/vm_dump.c:1151
/usr/local/lib/libruby.so.3.4(rb_vm_bugreport) /usr/src/ruby/vm_dump.c:1154
/usr/local/lib/libruby.so.3.4(rb_assert_failure_detail+0x122) [0x7f4f61d79652] /usr/src/ruby/error.c:1189
/usr/local/lib/libruby.so.3.4(rb_array_len+0x68) [0x7f4f61f9c178] /usr/src/ruby/include/ruby/internal/core/rarray.h:257
/usr/local/lib/libruby.so.3.4(RARRAY_LENINT+0x9) [0x7f4f61f9c189] /usr/src/ruby/include/ruby/internal/core/rarray.h:283
/usr/local/lib/libruby.so.3.4(vm_call_cfunc_only_splat+0x29) [0x7f4f61fafa29] /usr/src/ruby/vm_insnhelper.c:3875
/usr/local/lib/libruby.so.3.4(vm_sendish+0x109) [0x7f4f61faf6b9] /usr/src/ruby/vm_insnhelper.c:5938
/usr/local/lib/libruby.so.3.4(rb_vm_send+0x81) [0x7f4f61fbc781] /usr/src/ruby/vm_insnhelper.c:5965
[0x7f4f625972d7]

Updated by yahonda (Yasuo Honda) 4 months ago

Thanks for the update. The reason why I added another failure is to record which commit triggers the failure. No rush.

Updated by byroot (Jean Boussier) 4 months ago

I found a small repro for that last one:

class Model
  class << self
    def scope(name, body, &block)
      singleton_class.define_method(name) do |*args|
        new._exec_scope(*args, &body)
      end
      singleton_class.send(:ruby2_keywords, name)
    end
  end

  def _exec_scope(...)
    _scoping(nil, Object.new) { instance_exec(...) || self }
  end

  def _scoping(a, b)
    yield
  end
end

Model.scope(:some_query, -> { p 1 })

Model.some_query

But it turns out it's fixed by https://github.com/ruby/ruby/pull/11041, so no need to dig more into it.

Updated by yahonda (Yasuo Honda) 4 months ago

It looks like 4cbc41d5e5cb6793174d5964975fdb4470323ca1 addresses this issue.

$ RUBY_YJIT_ENABLE=1 bin/test test/cases/scoping/relation_scoping_test.rb test/cases/associations/eager_test.rb --seed 1670
/home/yahonda/.gem/ruby/3.4.0+0/gems/rake-13.1.0/lib/rake.rb:33: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
Using sqlite3
Run options: --seed 1670

# Running:

.....................................................................................................................................................................................................................................................................

Finished in 6.189991s, 42.1648 runs/s, 140.0648 assertions/s.
261 runs, 867 assertions, 0 failures, 0 errors, 0 skips
yahonda@myryzen:~/src/github.com/rails/rails/activerecord$ ruby -v
ruby 3.4.0dev (2024-06-26T20:01:26Z :detached: 4cbc41d5e5) +YJIT [x86_64-linux]
$

It causes another TypeError https://buildkite.com/rails/rails-nightly/builds/711#01905b80-6b82-460c-908d-c8bc7e69293a let me open another ticket.

Actions #10

Updated by byroot (Jean Boussier) 4 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like1Like0Like0