Skip to content

Commit 931c5ef

Browse files
authored
Merge pull request rails#51025 from Shopify/dont-clone-proc
Workaround a Ruby bug that can cause a VM crash
2 parents 3b8222c + 7025c84 commit 931c5ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activesupport/lib/active_support/tagged_logging.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def self.new(logger)
119119

120120
if logger.formatter
121121
logger.formatter = logger.formatter.clone
122+
123+
# Workaround for https://bugs.ruby-lang.org/issues/20250
124+
# Can be removed when Ruby 3.4 is the least supported version.
125+
logger.formatter.object_id if logger.formatter.is_a?(Proc)
122126
else
123127
# Ensure we set a default formatter so we aren't extending nil!
124128
logger.formatter = ActiveSupport::Logger::SimpleFormatter.new

0 commit comments

Comments
 (0)