Skip to content

Fix serialization crashes found from stress tester #38779

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

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Aug 6, 2021

I ran another stress tester in preparation for merging the TestModule request, which found a couple new issues:

  • A previous fix to not serialize invalid destructors wasn't skipping the common serialization section
  • A segfault when a PDB has no anchoring VarDecl

7856f2d only partially skipped writing
out destructors when they were invalid, ie. it skipped writing the decl
itself but not the records common to all decls. This would cause any
records on the destructor to be applied on the next serialized decl.

Make sure to skip serializing anything to do with the destructor when
it's invalid and does not have a class context.
An invalid PDB may have no anchoring VarDecl when allowing errors, make
sure not to crash in that case.
@bnbarham bnbarham requested a review from xymus August 6, 2021 08:03
@bnbarham
Copy link
Contributor Author

bnbarham commented Aug 6, 2021

@swift-ci please test

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

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

Looks good!

@bnbarham bnbarham merged commit a364aed into main Aug 6, 2021
@bnbarham bnbarham deleted the serialization-crashes branch August 6, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants