Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove precompile mutation step from staticdata #48309

Merged
merged 1 commit into from
Jan 19, 2023
Merged

remove precompile mutation step from staticdata #48309

merged 1 commit into from
Jan 19, 2023

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jan 17, 2023

Make sure things are properly ordered here, so that when serializing, nothing is mutating the system at the same time.

Fix #48047

@vtjnash vtjnash added compiler:precompilation Precompilation of modules kind:bugfix This change fixes an existing bug backport 1.9 Change should be backported to release-1.9 labels Jan 17, 2023
@KristofferC KristofferC mentioned this pull request Jan 17, 2023
35 tasks
Make sure things are properly ordered here, so that when serializing,
nothing is mutating the system at the same time.

Fix #48047
return NULL;
// We must avoid attempting to re-enter inference here
assert(0 && "attempted to enter inference while writing out image");
abort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aborting here in non-debug mode seems a bit aggressive. Generally the image may still be ok even if this fails, and it seems unfriendly to the user to not try and continue.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not really any points in this code that would be calling back into julia now, so I had considered deleting this special flag, but I did want to make it hard for someone to introduce the same mistake again. In most later places, the image might also not be complete, which also seemed more aggravating to encounter for the user than a clear abort and backtrace from the source of the problem

Copy link
Sponsor Member

@timholy timholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I also favor the assert.

Is the external methodtable the main fix, and most of the rest (nice) cleanup? I like both the conditional-edges allocation and the typemap visitor pattern. Oh nvm, I now see you're calling jl_prepare_serialization_data twice as in #48054 (comment)

@vtjnash vtjnash merged commit 87b8896 into master Jan 19, 2023
@vtjnash vtjnash deleted the jn/48047 branch January 19, 2023 19:52
vtjnash added a commit that referenced this pull request Feb 6, 2023
Make sure things are properly ordered here, so that when serializing,
nothing is mutating the system at the same time.

Fix #48047

(cherry picked from commit 87b8896)
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing backedge somewhere on master?
4 participants