Deduplicate method tables in jl_foreach_reachable_mtable#61221
Merged
Deduplicate method tables in jl_foreach_reachable_mtable#61221
Conversation
vtjnash
reviewed
Mar 4, 2026
Member
vtjnash
left a comment
There was a problem hiding this comment.
LGTM. We used to have some check that mt->module == v && mt->name == name (just like module visitor), but I guess that was lost in refactoring
When a custom method table is defined in one package and imported by another, jl_foreach_reachable_mtable visits the same table twice (once per module binding). This causes extext methods to be collected and serialized twice, and on loading, jl_method_table_activate asserts because dispatch_status was already set by the first activation. Add an htable to track visited method tables and skip duplicates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1aea422 to
c9237d8
Compare
Member
Author
|
Ah yes, found it in https://github.com/JuliaLang/julia/pull/58131/changes#diff-9a718f382a240acdbe9d0bdbc3ffb521f67af0e62b2ba8c8594b8faa65c78014L799 |
maleadt
added a commit
that referenced
this pull request
Mar 6, 2026
When a custom method table is defined in one package and imported by another, jl_foreach_reachable_mtable visits the same table twice (once per module binding). This causes extext methods to be collected and serialized twice, and on loading, jl_method_table_activate asserts because dispatch_status was already set by the first activation. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
maleadt
added a commit
that referenced
this pull request
Mar 6, 2026
When a custom method table is defined in one package and imported by another, jl_foreach_reachable_mtable visits the same table twice (once per module binding). This causes extext methods to be collected and serialized twice, and on loading, jl_method_table_activate asserts because dispatch_status was already set by the first activation. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a custom method table is defined in one package and imported by another, jl_foreach_reachable_mtable visits the same table twice (once per module binding). This causes extext methods to be collected and serialized twice, and on loading, jl_method_table_activate asserts because dispatch_status was already set by the first activation.
Add an htable to track visited method tables and skip duplicates.