Open nirvdrum opened 1 year ago
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.
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.
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.
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.
@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.
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 (https://github.com/oracle/truffleruby/pull/3374).
Right, I saw 3 issues referencing the error, so I figured I wouldn't open an independent one. Thanks for the fix.
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'
...
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'
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.
=> https://github.com/oracle/truffleruby/pull/3474
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?