Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeSharedShape() called on a shared shape #3179

Open
nirvdrum opened this issue Jul 25, 2023 · 10 comments
Open

makeSharedShape() called on a shared shape #3179

nirvdrum opened this issue Jul 25, 2023 · 10 comments
Assignees
Labels

Comments

@nirvdrum
Copy link
Collaborator

While running a Rails application under Puma I encountered java.lang.UnsupportedOperationException: makeSharedShape() can only be called on non-shared shapes.. I've seen this error pop up before, although likely under different circumstances. Can we make the sharing operation idempotent?

Ruby Thread id=83 from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/thread_pool.rb:110 terminated with internal error: (java.lang.RuntimeException)
	from org.truffleruby.core.thread.ThreadManager.printInternalError(ThreadManager.java:360)
	from org.truffleruby.core.thread.ThreadManager.threadMain(ThreadManager.java:349)
	from org.truffleruby.core.thread.ThreadManager.lambda$initialize$4(ThreadManager.java:320)
	from java.lang.Thread.runWith(Thread.java:1596)
	from java.lang.Thread.run(Thread.java:1583)
	from com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
	from com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:106)
	from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:140)
	from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:131)
/home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/single.rb:63:in `join'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/single.rb:63:in `run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/launcher.rb:194:in `run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/cli.rb:75:in `run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/bin/puma:10:in `<top (required)>'
	from <internal:core> core/kernel.rb:381:in `load'
	from ./bin/puma:17:in `<main>'
Caused by:
makeSharedShape() can only be called on non-shared shapes. (java.lang.UnsupportedOperationException)
	from com.oracle.truffle.object.ShapeImpl.makeSharedShape(ShapeImpl.java:1115)
	from com.oracle.truffle.object.DynamicObjectLibraryImpl$MakeSharedNode.makeSharedShape(DynamicObjectLibraryImpl.java:1837)
	from com.oracle.truffle.object.DynamicObjectLibraryImplFactory$MakeSharedNodeGen$Uncached.execute(DynamicObjectLibraryImplFactory.java:452)
	from com.oracle.truffle.object.DynamicObjectLibraryImpl.markShared(DynamicObjectLibraryImpl.java:271)
	from com.oracle.truffle.object.DynamicObjectLibraryImplGen$DynamicObjectLibraryExports$Uncached.markShared(DynamicObjectLibraryImplGen.java:1591)
	from com.oracle.truffle.api.object.DynamicObjectLibraryGen$CachedToUncachedDispatch.markShared(DynamicObjectLibraryGen.java:1405)
	from com.oracle.truffle.api.object.DynamicObjectLibraryGen$CachedDispatch.markShared(DynamicObjectLibraryGen.java:2051)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:69)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeAndSpecialize(WriteBarrierNodeGen.java:264)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:166)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:49)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeAndSpecialize(WriteBarrierNodeGen.java:264)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:166)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:49)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeAndSpecialize(WriteBarrierNodeGen.java:552)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeInternal(WriteBarrierNodeGen.java:454)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:45)
	from org.truffleruby.core.array.library.ObjectArrayStore$ShareElements.shareElements(ObjectArrayStore.java:105)
	from org.truffleruby.core.array.library.ObjectArrayStoreGen$ArrayStoreLibraryExports$Cached.shareElementsAndSpecialize(ObjectArrayStoreGen.java:165)
	from org.truffleruby.core.array.library.ObjectArrayStoreGen$ArrayStoreLibraryExports$Cached.shareElements(ObjectArrayStoreGen.java:146)
	from org.truffleruby.core.array.library.ObjectArrayStore.makeShared(ObjectArrayStore.java:89)
	from org.truffleruby.core.array.library.ObjectArrayStoreGen$ArrayStoreLibraryExports$Cached.makeShared(ObjectArrayStoreGen.java:401)
	from org.truffleruby.language.objects.shared.ShareInternalFieldsNode.shareArray(ShareInternalFieldsNode.java:54)
	from org.truffleruby.language.objects.shared.ShareInternalFieldsNodeGen$Inlined.executeAndSpecialize(ShareInternalFieldsNodeGen.java:183)
	from org.truffleruby.language.objects.shared.ShareInternalFieldsNodeGen$Inlined.executeInternal(ShareInternalFieldsNodeGen.java:143)
	from org.truffleruby.language.objects.shared.ShareInternalFieldsNode.execute(ShareInternalFieldsNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:81)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeAndSpecialize(WriteBarrierNodeGen.java:264)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:166)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:49)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeAndSpecialize(WriteBarrierNodeGen.java:264)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:166)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:49)
	from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
	from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
	from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
	from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:79)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeAndSpecialize(WriteBarrierNodeGen.java:552)
	from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeInternal(WriteBarrierNodeGen.java:454)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:41)
	from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:45)
	from org.truffleruby.language.objects.WriteObjectFieldNode.writeShared(WriteObjectFieldNode.java:46)
	from org.truffleruby.language.objects.WriteObjectFieldNodeGen.executeAndSpecialize(WriteObjectFieldNodeGen.java:187)
	from org.truffleruby.language.objects.WriteObjectFieldNodeGen.execute(WriteObjectFieldNodeGen.java:108)
	from org.truffleruby.language.objects.WriteInstanceVariableNode.write(WriteInstanceVariableNode.java:74)
	from org.truffleruby.language.objects.WriteInstanceVariableNode.doWrite(WriteInstanceVariableNode.java:50)
	from org.truffleruby.language.objects.WriteInstanceVariableNodeGen.execute(WriteInstanceVariableNodeGen.java:27)
	from org.truffleruby.language.control.OrLazyValueDefinedNode.doOrLazyValueDefined(OrLazyValueDefinedNode.java:52)
	from org.truffleruby.language.control.OrLazyValueDefinedNodeGen.execute(OrLazyValueDefinedNodeGen.java:88)
	from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:37)
	from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:65)
/home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:252:in `encrypted'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:261:in `signed_or_encrypted'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:118:in `cookie_jar'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:114:in `get_cookie'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:89:in `block (2 levels) in unpacked_cookie_data'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:88:in `block in unpacked_cookie_data'
	from <internal:core> core/hash.rb:236:in `fetch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/request.rb:69:in `fetch_header'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:87:in `unpacked_cookie_data'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:81:in `block in extract_session_id'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/session/cookie_store.rb:80:in `extract_session_id'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:65:in `block in id'
	from <internal:core> core/hash.rb:236:in `fetch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:64:in `id'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:84:in `id'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:329:in `current_session_id'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:335:in `session_exists?'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:223:in `exists?'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:246:in `load_for_read!'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/request/session.rb:111:in `[]'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:451:in `real_csrf_token'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:469:in `csrf_token_hmac'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:463:in `global_csrf_token'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:372:in `masked_authenticity_token'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:359:in `form_authenticity_token'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/request_forgery_protection.rb:107:in `form_authenticity_token'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/helpers/csrf_helper.rb:26:in `csrf_meta_tags'
	from /home/spin/src/github.com/my_app/app/views/layouts/_head.html.erb:8:in `_app_views_layouts__head_html_erb__4452314692641802828_4593720'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/base.rb:244:in `_run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:157:in `block in render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:208:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:361:in `instrument_render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:155:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/partial_renderer.rb:251:in `block in render_partial_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `block in instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/partial_renderer.rb:237:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/renderer.rb:53:in `render_partial'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/helpers/rendering_helper.rb:44:in `render'
	from /home/spin/src/github.com/my_app/app/views/layouts/vault/application.html.erb:7:in `_app_views_layouts_vault_application_html_erb__6111068772869713647_4587224'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/base.rb:244:in `_run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:157:in `block in render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:208:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:361:in `instrument_render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/template.rb:155:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/template_renderer.rb:76:in `block in render_with_layout'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `block in instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/template_renderer.rb:74:in `render_with_layout'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/template_renderer.rb:11:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/rendering.rb:117:in `block in _render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/base.rb:270:in `in_rendering_context'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/rendering.rb:116:in `_render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/streaming.rb:216:in `_render_template'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/rendering.rb:103:in `render_to_body'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/abstract_controller/rendering.rb:27:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/rendering.rb:139:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:22:in `block (2 levels) in render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/benchmark-0.2.1/lib/benchmark.rb:311:in `realtime'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/core_ext/benchmark.rb:14:in `ms'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:22:in `block in render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:91:in `cleanup_view_runtime'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activerecord-7.0.6/lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:21:in `render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/implicit_render.rb:35:in `default_render'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/basic_implicit_render.rb:7:in `send_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:215:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify_metrics-1.19.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/rendering.rb:165:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actiontext-7.0.6/lib/action_text/rendering.rb:20:in `with_renderer'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actiontext-7.0.6/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127:in `instance_exec'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:138:in `run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:233:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/rescue.rb:23:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `block in instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `instrument'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activerecord-7.0.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify_metrics-1.19.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify_metrics-1.19.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:151:in `process'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionview-7.0.6/lib/action_view/rendering.rb:39:in `process'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal.rb:188:in `dispatch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-action_pack-0.6.0/lib/opentelemetry/instrumentation/action_pack/patches/action_controller/metal.rb:27:in `dispatch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_controller/metal.rb:251:in `dispatch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:32:in `serve'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:32:in `each'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:32:in `serve'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:852:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/static.rb:23:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202:in `call!'
	from /home/spin/.gem/truffleruby/3.1.3/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/omniauth-2.0.4/lib/omniauth/builder.rb:45:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/bullet-7.0.7/lib/bullet/rack.rb:17:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/static.rb:161:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/tempfile_reaper.rb:15:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/etag.rb:27:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/conditional_get.rb:27:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/head.rb:12:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/security_reports-2.4.3.1/lib/security_reports/middleware.rb:15:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:266:in `context'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:260:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:704:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activerecord-7.0.6/lib/active_record/migration.rb:603:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:99:in `run_callbacks'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/bugsnag-6.25.2/lib/bugsnag/integrations/rack.rb:51:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/web-console-4.2.0/lib/web_console/middleware.rb:132:in `call_app'
	from /home/spin/.gem/truffleruby/3.1.3/gems/web-console-4.2.0/lib/web_console/middleware.rb:19:in `block in call'
	from <internal:core> core/throw_catch.rb:36:in `catch'
	from /home/spin/.gem/truffleruby/3.1.3/gems/web-console-4.2.0/lib/web_console/middleware.rb:17:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/show_exceptions.rb:29:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/railties-7.0.6/lib/rails/rack/logger.rb:40:in `call_app'
	from /home/spin/.gem/truffleruby/3.1.3/gems/railties-7.0.6/lib/rails/rack/logger.rb:27:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify-cloud-2.23.0/lib/shopify-cloud/canonical_logging/middleware.rb:19:in `block in call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify-cloud-2.23.0/lib/shopify-cloud/logger.rb:189:in `with_unit_of_work'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify-cloud-2.23.0/lib/shopify-cloud/canonical_logging/middleware.rb:18:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/method_override.rb:24:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/runtime.rb:22:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/activesupport-7.0.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/static.rb:23:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-2.2.7/lib/rack/sendfile.rb:110:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/actionpack-7.0.6/lib/action_dispatch/middleware/host_authorization.rb:137:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-cors-2.0.1/lib/rack/cors.rb:102:in `call'
	from /home/spin/src/github.com/my_app/lib/legacy_page_redirector.rb:12:in `call'
	from /home/spin/src/github.com/my_app/lib/short_url_redirector.rb:10:in `call'
	from /home/spin/src/github.com/my_app/lib/ruby_info_header.rb:8:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify_metrics-1.19.0/lib/shopify_metrics/middlewares/raindrops_middleware.rb:22:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/shopify_metrics-1.19.0/lib/shopify_metrics/middlewares/request_metrics_middleware.rb:50:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:81:in `block (3 levels) in call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack.rb:45:in `block in with_span'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/context.rb:87:in `with_value'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack.rb:45:in `with_span'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:80:in `block (2 levels) in call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/trace.rb:72:in `block in with_span'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/context.rb:87:in `with_value'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/trace.rb:72:in `with_span'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/trace/tracer.rb:29:in `in_span'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:77:in `block in call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-api-1.2.0/lib/opentelemetry/context.rb:71:in `with_current'
	from /home/spin/.gem/truffleruby/3.1.3/gems/opentelemetry-instrumentation-rack-0.23.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:74:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/rack-mini-profiler-3.1.0/lib/mini_profiler.rb:413:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/railties-7.0.6/lib/rails/engine.rb:530:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/commonlogger.rb:47:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/configuration.rb:270:in `call'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/request.rb:100:in `block in handle_request'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/thread_pool.rb:344:in `with_force_shutdown'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/request.rb:99:in `handle_request'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/server.rb:443:in `process_client'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/server.rb:245:in `block in run'
	from /home/spin/.gem/truffleruby/3.1.3/gems/puma-6.3.0/lib/puma/thread_pool.rb:151:in `block in spawn_thread'
@eregon
Copy link
Member

eregon commented Jul 25, 2023

Can we make the sharing operation idempotent?

No, because this means something was actually shared between threads but wasn't marked as shared beforehand, i.e. a bug in the sharing logic or a missing write barrier or possibly a race in the code like concurrent Hash mutation or so.
For sharing to be safe, we must never run into that case.

The first backtrace line are
https://github.com/rails/rails/blob/v7.0.6/actionpack/lib/action_dispatch/middleware/cookies.rb#L253
https://github.com/rails/rails/blob/v7.0.6/actionpack/lib/action_dispatch/middleware/cookies.rb#L261
https://github.com/rails/rails/blob/v7.0.6/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb#L118

But I don't see anything wrong there from a quick look.
I will try to reproduce.

@eregon eregon added the bug label Jul 25, 2023
@nirvdrum
Copy link
Collaborator Author

nirvdrum commented Jul 25, 2023

Okay. Maybe I've just misread the message. "makeSharedShape() can only be called on non-shared shapes" reads to me like the item was marked as shared from another thread and this one didn't see the update.

@eregon eregon self-assigned this Jul 25, 2023
@eregon
Copy link
Member

eregon commented Jul 25, 2023

That interpretation is fairly correct, we are seeing two threads racing to mark an object as shared.
But that should never happen, because before the object can be referenced by another thread it must be marked as shared.

It is very similar to another error message we have:

Thread-safety bug: the object is already shared. This means another thread marked the object as shared concurrently.

This happened just a tiny bit later.

@byroot
Copy link

byroot commented Jan 8, 2024

I'm seeing this one on redis/redis-rb: https://github.com/redis/redis-rb/actions/runs/7453547547/job/20279162533?pr=1245.

No idea what to make of it.

@eregon
Copy link
Member

eregon commented Jan 9, 2024

@byroot So it likely means two threads are trying to share the same object at the same time, which is unexpected (TruffleRuby should avoid that situation).
This code looks like it might end up doing that:
https://github.com/redis/redis-rb/blob/09acb9026ab2deaca4c851e0bcdb0ef9318b1ee0/test/redis/publish_subscribe_test.rb#L349-L351
Because that Redis instance and other objects it references are passed as an argument to Thread.new and also stored globally in @threads, concurrently.
We do share the block passed to Thread.new but it looks like TruffleRuby is missing to share the arguments passed to Thread.new like redis in thread = Thread.new(redis, &block).
(and interestingly in this case because it's not a literal block it does not refer to redis)
That's the most likely bug here, I'll fix it.
Thank you for the report.

@eregon
Copy link
Member

eregon commented Jan 9, 2024

I was wondering if the original report was the same issue.
I found that Puma uses th = Thread.new(@spawned) do |spawned| in https://github.com/puma/puma/blob/v6.3.0/lib/puma/thread_pool.rb#L110 but that should be no issue because @spawned is just an Integer and that's immutable/does not need to be shared.
So that's probably a different issue and I'll keep this open after the fix for Thread.new arguments lands (#3374).

@byroot
Copy link

byroot commented Jan 9, 2024

Right, I saw 3 issues referencing the error, so I figured I wouldn't open an independent one. Thanks for the fix.

@rwstauner
Copy link
Collaborator

I got a few similar exceptions in case the backtrace is useful.
I was using Puma::ThreadPool around Rack::MockRequest but forgot to do the equivalent of "preload_app" before starting the threads.

Ruby Thread id=50 from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:113 terminated with internal error: (java.lang.RuntimeException)
        from org.truffleruby.core.thread.ThreadManager.printInternalError(ThreadManager.java:360)
        from org.truffleruby.core.thread.ThreadManager.threadMain(ThreadManager.java:349)
        from org.truffleruby.core.thread.ThreadManager.lambda$initialize$4(ThreadManager.java:320)
        from java.lang.Thread.run(Thread.java:1570)
        from com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
        from com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:106)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:140)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:131)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `join'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `join'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `shutdown'
        from /app/rack.rb:1:in `threads'
        from /app/rack.rb:1:in `block in <top (required)>'
        from <internal:core> core/kernel.rb:523:in `yield_self'
        from /app/rack.rb:1:in `<top (required)>'
        from <internal:core> core/kernel.rb:383:in `load'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands/runner/runner_command.rb:41:in `block in perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/execution_wrapper.rb:92:in `wrap'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands/runner/runner_command.rb:40:in `perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command/base.rb:178:in `invoke_command'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command/base.rb:73:in `perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:71:in `block in invoke'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:149:in `with_argv'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:69:in `invoke'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands.rb:18:in `<top (required)>'
        from <internal:core> core/kernel.rb:234:in `gem_original_require'
        from <internal:/usr/local/ruby/lib/mri/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /app/bin/rails:5:in `<main>'
Caused by:
makeSharedShape() can only be called on non-shared shapes. (java.lang.UnsupportedOperationException)
        from com.oracle.truffle.object.ShapeImpl.makeSharedShape(ShapeImpl.java:1115)
        from com.oracle.truffle.object.DynamicObjectLibraryImpl$MakeSharedNode.makeSharedShape(DynamicObjectLibraryImpl.java:1837)
        from com.oracle.truffle.object.DynamicObjectLibraryImplFactory$MakeSharedNodeGen$Inlined.executeAndSpecialize(DynamicObjectLibraryImplFactory.java:429)
        from com.oracle.truffle.object.DynamicObjectLibraryImplFactory$MakeSharedNodeGen$Inlined.execute(DynamicObjectLibraryImplFactory.java:423)
        from com.oracle.truffle.object.DynamicObjectLibraryImpl.markShared(DynamicObjectLibraryImpl.java:271)
        from com.oracle.truffle.object.DynamicObjectLibraryImplGen$DynamicObjectLibraryExports$Cached.markSharedNode_AndSpecialize(DynamicObjectLibraryImplGen.java:1149)
        from com.oracle.truffle.object.DynamicObjectLibraryImplGen$DynamicObjectLibraryExports$Cached.markShared(DynamicObjectLibraryImplGen.java:1134)
        from com.oracle.truffle.api.object.DynamicObjectLibraryGen$CachedDispatch.markShared(DynamicObjectLibraryGen.java:2058)
        from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:69)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
        from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:78)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeAndSpecialize(WriteBarrierNodeGen.java:254)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:156)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:40)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:48)
        from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:173)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
        from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:78)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeAndSpecialize(WriteBarrierNodeGen.java:529)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeInternal(WriteBarrierNodeGen.java:431)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:40)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:44)
        from org.truffleruby.language.objects.WriteObjectFieldNode.writeShared(WriteObjectFieldNode.java:46)
        from org.truffleruby.language.objects.WriteObjectFieldNodeGen.executeAndSpecialize(WriteObjectFieldNodeGen.java:187)
        from org.truffleruby.language.objects.WriteObjectFieldNodeGen.execute(WriteObjectFieldNodeGen.java:108)
        from org.truffleruby.language.objects.WriteInstanceVariableNode.write(WriteInstanceVariableNode.java:75)
        from org.truffleruby.language.objects.WriteInstanceVariableNode.doWrite(WriteInstanceVariableNode.java:51)
        from org.truffleruby.language.objects.WriteInstanceVariableNodeGen.execute(WriteInstanceVariableNodeGen.java:27)
        from org.truffleruby.language.control.OrLazyValueDefinedNode.doOrLazyValueDefined(OrLazyValueDefinedNode.java:52)
        from org.truffleruby.language.control.OrLazyValueDefinedNodeGen.execute(OrLazyValueDefinedNodeGen.java:88)
        from org.truffleruby.language.control.IfNode.doIf(IfNode.java:37)
        from org.truffleruby.language.control.IfNodeGen.execute(IfNodeGen.java:88)
        from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:38)
        from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:65)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:103:in `details_key'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:176:in `detail_args_for'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:130:in `find'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:49:in `determine_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:7:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:63:in `render_template_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:135:in `block in _render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/base.rb:291:in `in_rendering_context'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:134:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/streaming.rb:256:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:121:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/rendering.rb:27:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:139:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:29:in `block (2 levels) in render'
        ...
Ruby Thread id=47 from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:113 terminated with internal error: (java.lang.RuntimeException)
        from org.truffleruby.core.thread.ThreadManager.printInternalError(ThreadManager.java:360)
        from org.truffleruby.core.thread.ThreadManager.threadMain(ThreadManager.java:349)
        from org.truffleruby.core.thread.ThreadManager.lambda$initialize$4(ThreadManager.java:320)
        from java.lang.Thread.run(Thread.java:1570)
        from com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
        from com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:106)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:140)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:131)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `join'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `join'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:403:in `shutdown'
        from /app/rack.rb:1:in `threads'
        from /app/rack.rb:1:in `block in <top (required)>'
        from <internal:core> core/kernel.rb:523:in `yield_self'
        from /app/rack.rb:1:in `<top (required)>'
        from <internal:core> core/kernel.rb:383:in `load'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands/runner/runner_command.rb:41:in `block in perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/execution_wrapper.rb:92:in `wrap'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands/runner/runner_command.rb:40:in `perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command/base.rb:178:in `invoke_command'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command/base.rb:73:in `perform'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:71:in `block in invoke'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:149:in `with_argv'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/command.rb:69:in `invoke'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/commands.rb:18:in `<top (required)>'
        from <internal:core> core/kernel.rb:234:in `gem_original_require'
        from <internal:/usr/local/ruby/lib/mri/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /app/bin/rails:5:in `<main>'
Caused by:
Thread-safety bug: the object is already shared. This means another thread marked the object as shared concurrently. (java.lang.UnsupportedOperationException)
        from org.truffleruby.language.objects.shared.ShareObjectNode.createSharedShape(ShareObjectNode.java:133)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeAndSpecialize(ShareObjectNodeGen.java:140)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:117)
        from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:78)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeInternal(WriteBarrierNodeGen.java:401)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:40)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:44)
        from org.truffleruby.language.objects.WriteObjectFieldNode.writeShared(WriteObjectFieldNode.java:46)
        from org.truffleruby.language.objects.WriteObjectFieldNodeGen.execute(WriteObjectFieldNodeGen.java:101)
        from org.truffleruby.language.objects.WriteInstanceVariableNode.write(WriteInstanceVariableNode.java:75)
        from org.truffleruby.language.objects.WriteInstanceVariableNode.doWrite(WriteInstanceVariableNode.java:51)
        from org.truffleruby.language.objects.WriteInstanceVariableNodeGen.execute(WriteInstanceVariableNodeGen.java:27)
        from org.truffleruby.language.control.OrLazyValueDefinedNode.doOrLazyValueDefined(OrLazyValueDefinedNode.java:52)
        from org.truffleruby.language.control.OrLazyValueDefinedNodeGen.execute(OrLazyValueDefinedNodeGen.java:88)
        from org.truffleruby.language.control.IfNode.doIf(IfNode.java:37)
        from org.truffleruby.language.control.IfNodeGen.execute(IfNodeGen.java:88)
        from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:38)
        from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:65)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:103:in `details_key'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:176:in `detail_args_for'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/lookup_context.rb:130:in `find'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:49:in `determine_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:7:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:63:in `render_template_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:135:in `block in _render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/base.rb:291:in `in_rendering_context'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:134:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/streaming.rb:256:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:121:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/rendering.rb:27:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:139:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:29:in `block (2 levels) in render'
...

@rwstauner
Copy link
Collaborator

rwstauner commented Feb 28, 2024

I'm seeing this with increasing frequency running a rails app with puma and the latest GFTC dev build.
Usually I'll get this within the first 20 or so requests and then after it restarts it seems to get past it.

Latest stack trace:

Ruby Thread id=49 from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:113 terminated with internal error: (java.lang.RuntimeException)
        from org.truffleruby.core.thread.ThreadManager.printInternalError(ThreadManager.java:360)
        from org.truffleruby.core.thread.ThreadManager.threadMain(ThreadManager.java:349)
        from org.truffleruby.core.thread.ThreadManager.lambda$initialize$4(ThreadManager.java:320)
        from java.lang.Thread.run(Thread.java:1570)
        from com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
        from com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:106)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:140)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:131)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/single.rb:63:in `join'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/single.rb:63:in `run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/launcher.rb:194:in `run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/cli.rb:75:in `run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/bin/puma:10:in `<top (required)>'
        from <internal:core> core/kernel.rb:383:in `load'
        from bin/puma:17:in `<main>'
Caused by:
makeSharedShape() can only be called on non-shared shapes. (java.lang.UnsupportedOperationException)
        from com.oracle.truffle.object.ShapeImpl.makeSharedShape(ShapeImpl.java:1115)
        from com.oracle.truffle.object.DynamicObjectLibraryImpl$MakeSharedNode.makeSharedShape(DynamicObjectLibraryImpl.java:1837)
        from com.oracle.truffle.object.DynamicObjectLibraryImplFactory$MakeSharedNodeGen$Uncached.execute(DynamicObjectLibraryImplFactory.java:452)
        from com.oracle.truffle.object.DynamicObjectLibraryImpl.markShared(DynamicObjectLibraryImpl.java:271)
        from com.oracle.truffle.object.DynamicObjectLibraryImplGen$DynamicObjectLibraryExports$Uncached.markShared(DynamicObjectLibraryImplGen.java:1591)
        from com.oracle.truffle.api.object.DynamicObjectLibraryGen$UncachedDispatch.markShared(DynamicObjectLibraryGen.java:1595)
        from org.truffleruby.language.objects.shared.SharedObjects.share(SharedObjects.java:162)
        from org.truffleruby.language.objects.shared.SharedObjects.shareObjects(SharedObjects.java:104)
        from org.truffleruby.language.objects.shared.SharedObjects.shareInternalFields(SharedObjects.java:185)
        from org.truffleruby.language.objects.shared.ShareInternalFieldsNode.shareUncached(ShareInternalFieldsNode.java:80)
        from org.truffleruby.language.objects.shared.ShareInternalFieldsNodeGen$Inlined.executeInternal(ShareInternalFieldsNodeGen.java:138)
        from org.truffleruby.language.objects.shared.ShareInternalFieldsNode.execute(ShareInternalFieldsNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:81)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:94)
        from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:78)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen.executeInternal(WriteBarrierNodeGen.java:126)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:40)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.executeCached(WriteBarrierNode.java:48)
        from org.truffleruby.language.objects.shared.ShareObjectNode.shareCached(ShareObjectNode.java:86)
        from org.truffleruby.language.objects.shared.ShareObjectNodeGen.executeInternal(ShareObjectNodeGen.java:94)
        from org.truffleruby.language.objects.shared.ShareObjectNode.execute(ShareObjectNode.java:45)
        from org.truffleruby.language.objects.shared.ShareObjectNode.executeCached(ShareObjectNode.java:49)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.writeBarrierCached(WriteBarrierNode.java:78)
        from org.truffleruby.language.objects.shared.WriteBarrierNodeGen$Inlined.executeInternal(WriteBarrierNodeGen.java:401)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:40)
        from org.truffleruby.language.objects.shared.WriteBarrierNode.execute(WriteBarrierNode.java:44)
        from org.truffleruby.core.array.library.SharedArrayStorage.write(SharedArrayStorage.java:82)
        from org.truffleruby.core.array.library.SharedArrayStorageGen$ArrayStoreLibraryExports$Cached.write(SharedArrayStorageGen.java:345)
        from org.truffleruby.core.array.library.ArrayStoreLibraryGen$CachedDispatch.write(ArrayStoreLibraryGen.java:2480)
        from org.truffleruby.core.array.ArrayAppendOneNode.appendOneGeneralizeNonMutable(ArrayAppendOneNode.java:88)
        from org.truffleruby.core.array.ArrayAppendOneNodeGen.executeAppendOne(ArrayAppendOneNodeGen.java:133)
        from org.truffleruby.core.array.ArrayNodes$AppendNode.append(ArrayNodes.java:1687)
        from org.truffleruby.core.array.ArrayNodesFactory$AppendNodeFactory$AppendNodeGen.execute(ArrayNodesFactory.java:11737)
        from org.truffleruby.language.RubyCoreMethodRootNode.execute(RubyCoreMethodRootNode.java:58)
/artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bugsnag-6.26.3/lib/bugsnag/utility/circular_buffer.rb:27:in `<<'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bugsnag-6.26.3/lib/bugsnag/utility/circular_buffer.rb:27:in `<<'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bugsnag-6.26.3/lib/bugsnag.rb:309:in `leave_breadcrumb'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bugsnag-6.26.3/lib/bugsnag/integrations/railtie.rb:48:in `block in event_subscription'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:137:in `block in finish'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:26:in `block in iterate_guarding_exceptions'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:25:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:25:in `iterate_guarding_exceptions'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:125:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:136:in `finish'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:262:in `block in finish_with_values'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:26:in `block in iterate_guarding_exceptions'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:25:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:25:in `iterate_guarding_exceptions'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:261:in `finish_with_values'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/fanout.rb:254:in `finish'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/instrumenter.rb:64:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:206:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/partial_renderer.rb:237:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:83:in `render_partial_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:55:in `render_partial'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/helpers/rendering_helper.rb:44:in `render'
        from /app/app/views/layouts/application.html.erb:45:in `_app_views_layouts_application_html_erb__2475414515311936286_1640760'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/base.rb:264:in `_run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/template.rb:261:in `block in render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:208:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/template.rb:549:in `instrument_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/template.rb:249:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:77:in `block in render_with_layout'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:206:in `block in instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:206:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/template_renderer.rb:11:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:63:in `render_template_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:135:in `block in _render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/base.rb:291:in `in_rendering_context'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:134:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/streaming.rb:256:in `_render_template'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:121:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/rendering.rb:27:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:139:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:29:in `block (2 levels) in render'
        from /usr/local/ruby/lib/mri/benchmark.rb:311:in `realtime'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/core_ext/benchmark.rb:14:in `ms'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:29:in `block in render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:98:in `cleanup_view_runtime'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activerecord-7.1.3/lib/active_record/railties/controller_runtime.rb:39:in `cleanup_view_runtime'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:28:in `render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/implicit_render.rb:37:in `default_render'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/basic_implicit_render.rb:7:in `send_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/base.rb:224:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify_metrics-1.21.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rendering.rb:165:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actiontext-7.1.3/lib/action_text/rendering.rb:23:in `with_renderer'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actiontext-7.1.3/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:130:in `instance_exec'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:141:in `run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/callbacks.rb:258:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/rescue.rb:25:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:206:in `block in instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/notifications.rb:206:in `instrument'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activerecord-7.1.3/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify_metrics-1.21.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify_metrics-1.21.0/lib/shopify_metrics/action_controller_tags.rb:8:in `process_action'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/abstract_controller/base.rb:160:in `process'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionview-7.1.3/lib/action_view/rendering.rb:40:in `process'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal.rb:227:in `dispatch'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_controller/metal.rb:309:in `dispatch'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/routing/route_set.rb:32:in `serve'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/journey/router.rb:51:in `block in serve'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/journey/router.rb:124:in `each'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/journey/router.rb:124:in `find_routes'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/journey/router.rb:32:in `serve'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/routing/route_set.rb:882:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/omniauth-2.1.2/lib/omniauth/builder.rb:44:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/tempfile_reaper.rb:20:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/etag.rb:29:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/conditional_get.rb:31:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/head.rb:15:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/http/permissions_policy.rb:36:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/http/content_security_policy.rb:33:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/security_reports-3.0.0/lib/security_reports/middleware.rb:17:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in `context'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/cookies.rb:689:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/callbacks.rb:101:in `run_callbacks'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/bugsnag-6.26.3/lib/bugsnag/integrations/rack.rb:51:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/rack/logger.rb:37:in `call_app'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/rack/logger.rb:26:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify-cloud-2.24.0/lib/shopify-cloud/canonical_logging/middleware.rb:19:in `block in call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify-cloud-2.24.0/lib/shopify-cloud/logger.rb:189:in `with_unit_of_work'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/broadcast_logger.rb:240:in `method_missing'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify-cloud-2.24.0/lib/shopify-cloud/canonical_logging/middleware.rb:18:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/request_id.rb:28:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/method_override.rb:28:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/runtime.rb:24:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/activesupport-7.1.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/executor.rb:14:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/static.rb:25:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-3.0.9/lib/rack/sendfile.rb:114:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/actionpack-7.1.3/lib/action_dispatch/middleware/ssl.rb:79:in `call'
        from /app/lib/redirector.rb:18:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/rack-cors-2.0.1/lib/rack/cors.rb:102:in `call'
        from /app/lib/short_url_redirector.rb:10:in `call'
        from /app/lib/thread_logger.rb:10:in `call'
        from /app/lib/ruby_info_header.rb:8:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify_metrics-1.21.0/lib/shopify_metrics/middlewares/raindrops_middleware.rb:22:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/shopify_metrics-1.21.0/lib/shopify_metrics/middlewares/request_metrics_middleware.rb:51:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/railties-7.1.3/lib/rails/engine.rb:536:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
        from /artifacts/bundle/truffleruby/3.2.2.24.0.0.2/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'

@eregon
Copy link
Member

eregon commented Feb 29, 2024

From that latest stracktrace, the top entry is https://github.com/bugsnag/bugsnag-ruby/blob/v6.26.3/lib/bugsnag/utility/circular_buffer.rb#L27 which is Array#<<.
My guess is that array/CircularBuffer is mutated concurrently from multiple threads and there seems to be no synchronization for it in that file. So that seems definitely racy and unsafe.
And I think the makeSharedShape() can only be called on non-shared shapes. (java.lang.UnsupportedOperationException) happens as a consequence of that.


For the previous stacktrace, the top entry is https://github.com/rails/rails/blob/v7.1.3/actionview/lib/action_view/lookup_context.rb#L103. We're inside writing an ivar, so it must be the @details_key ||=.
This is different, the value assigned to it DetailsKey.details_cache_key(@details) is something in a global (stored as an ivar of a class) Concurrent::Map.
But I found that TruffleRuby::ConcurrentMap#[]= does not share the value, so that is a bug and the very likely cause for that one.
=> #3474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants