ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
@ 2024-02-09 10:11 zetter (Chris Zetter) via ruby-core
  2024-02-09 12:30 ` [ruby-core:116648] " byroot (Jean Boussier) via ruby-core
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zetter (Chris Zetter) via ruby-core @ 2024-02-09 10:11 UTC (permalink / raw)
  To: ruby-core; +Cc: zetter (Chris Zetter)

Issue #20250 has been reported by zetter (Chris Zetter).

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

* Author: zetter (Chris Zetter)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116648] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
  2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
@ 2024-02-09 12:30 ` byroot (Jean Boussier) via ruby-core
  2024-02-09 12:42 ` [ruby-core:116649] " byroot (Jean Boussier) via ruby-core
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-02-09 12:30 UTC (permalink / raw)
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20250 has been updated by byroot (Jean Boussier).


I had a quick look and this is very interesting. As far as I can tell `cached_object_id` for this Proc, so the most likely explanation is that some other part of the codebase is messing with the object flags.

I'll try to dig deeper.

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

* Author: zetter (Chris Zetter)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116649] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
  2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
  2024-02-09 12:30 ` [ruby-core:116648] " byroot (Jean Boussier) via ruby-core
@ 2024-02-09 12:42 ` byroot (Jean Boussier) via ruby-core
  2024-02-09 13:31 ` [ruby-core:116651] " byroot (Jean Boussier) via ruby-core
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-02-09 12:42 UTC (permalink / raw)
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20250 has been updated by byroot (Jean Boussier).


Alright, it's a bug in `#clone`, I managed to reduce it to:

```ruby
proc = Proc.new { }
proc.object_id
proc.clone
GC.start
```

Shouldn't be too hard to figure out. IIRC `Proc#clone` was modified recently, the flag that indicate the instance has an `object_id` need to be cleared on the cloned object.


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

* Author: zetter (Chris Zetter)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116651] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
  2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
  2024-02-09 12:30 ` [ruby-core:116648] " byroot (Jean Boussier) via ruby-core
  2024-02-09 12:42 ` [ruby-core:116649] " byroot (Jean Boussier) via ruby-core
@ 2024-02-09 13:31 ` byroot (Jean Boussier) via ruby-core
  2024-03-21  6:59 ` [ruby-core:117278] " naruse (Yui NARUSE) via ruby-core
  2024-07-13  6:18 ` [ruby-core:118586] " nagachika (Tomoyuki Chikanaga) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-02-09 13:31 UTC (permalink / raw)
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20250 has been updated by byroot (Jean Boussier).

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

Patch: https://github.com/ruby/ruby/pull/9903

Also this bug affect all Ruby versions since the new `object_id` implementation back in 2.7, I got all of them to crash on it.

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

* Author: zetter (Chris Zetter)
* Status: Open
* Priority: Normal
* 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: REQUIRED
----------------------------------------


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:117278] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
  2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
                   ` (2 preceding siblings ...)
  2024-02-09 13:31 ` [ruby-core:116651] " byroot (Jean Boussier) via ruby-core
@ 2024-03-21  6:59 ` naruse (Yui NARUSE) via ruby-core
  2024-07-13  6:18 ` [ruby-core:118586] " nagachika (Tomoyuki Chikanaga) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: naruse (Yui NARUSE) via ruby-core @ 2024-03-21  6:59 UTC (permalink / raw)
  To: ruby-core; +Cc: naruse (Yui NARUSE)

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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:118586] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error
  2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
                   ` (3 preceding siblings ...)
  2024-03-21  6:59 ` [ruby-core:117278] " naruse (Yui NARUSE) via ruby-core
@ 2024-07-13  6:18 ` nagachika (Tomoyuki Chikanaga) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: nagachika (Tomoyuki Chikanaga) via ruby-core @ 2024-07-13  6:18 UTC (permalink / raw)
  To: ruby-core; +Cc: nagachika (Tomoyuki Chikanaga)

Issue #20250 has been updated by nagachika (Tomoyuki Chikanaga).

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

ruby_3_2 commit:584a02aaafda74c21d24dc4c5e223a2482c7fde3 merged revision(s) commit:d19d683a354530a27b4cbb049223f8dc70c75849.

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

* 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: DONE, 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/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-13  6:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 10:11 [ruby-core:116643] [Ruby master Bug#20250] Crash with "Object ID seen, but not in mapping table: proc" error zetter (Chris Zetter) via ruby-core
2024-02-09 12:30 ` [ruby-core:116648] " byroot (Jean Boussier) via ruby-core
2024-02-09 12:42 ` [ruby-core:116649] " byroot (Jean Boussier) via ruby-core
2024-02-09 13:31 ` [ruby-core:116651] " byroot (Jean Boussier) via ruby-core
2024-03-21  6:59 ` [ruby-core:117278] " naruse (Yui NARUSE) via ruby-core
2024-07-13  6:18 ` [ruby-core:118586] " nagachika (Tomoyuki Chikanaga) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).