From: "naruse (Yui NARUSE) via ruby-core" <ruby-core@...>
Date: 2024-03-21T06:59:05+00:00
Subject: [ruby-core:117278] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error

Issue #20250 has been updated by naruse (Yui NARUSE).

Backport changed from 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: DONE

ruby_3_3 a63e979853783601a60228b45741f8b3776e5507 merged revision(s) d19d683a354530a27b4cbb049223f8dc70c75849,de1a586ecc2ee7f465f0c0a69291054136a3a819.

----------------------------------------
Bug #20250: Crash with "Object ID seen, but not in mapping table: proc" error
https://bugs.ruby-lang.org/issues/20250#change-107406

* Author: zetter (Chris Zetter)
* Status: Closed
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
* Backport: 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: DONE
----------------------------------------


Hello, I experienced a crash which I was able to reliably reproduce with the following:

``` ruby

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'
  gem 'activesupport', '7.1.3'
end

require 'active_support'

logger = ActiveSupport::Logger.new('log/log.log', 1, 100 * 1024 * 1024)

logger.formatter = proc {|_, _, _, message| "#{message}\n" }

logger = ActiveSupport::TaggedLogging.new(logger)

logger.tagged("TAG").info "hello"
logger.tagged("TAG").info "hello" # usually crashes here
GC.start # sometimes need to trigger crash with GC
```

It looks like this is caused by the interaction with the formatter proc and the tagged logging features of activesupport. Let me know if a more minimal example would be useful.

I can reproduce this with:
* ruby 3.3.0 on arm64-darwin23 
* ruby 3.3.0 on x86_64-linux
* latest ruby HEAD (5e12b75716) on arm64-darwin23

I cannot reproduce this on ruby 3.2.2.

Thanks for any help

---Files--------------------------------
ruby-2024-02-09-092829.ips (13.2 KB)
output.log (142 KB)
crash_test_2.rb (465 Bytes)


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