Skip to content

[5.5][Collections] PackageCollectionsTests.testUpdateAuthTokens sometimes causes signal 11 #3535

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

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Jun 7, 2021

#3534 for 5.5

…causes signal 11 (swiftlang#3534)

Motivation:
rdar://78939220

`SQLitePackageCollectionsStorage.populateTargetTrie` is always called in the initializer and to be completed by a background thread. Looks like the crash could be caused by `populateTargetTrie` being run while `SQLitePackageCollectionsStorage` gets destroyed as part of `PackageCollections` deallocation.

Modifications:
Add option in `SQLitePackageCollectionsStorage.Configuration` to skip calling `populateTargetTrie` in tests to avoid the race between db destruction and `populateTargetTrie`. Not all tests need storage or make use of `populateTargetTrie`, and it's caused many crashes in CI already. We have added traps for db connection state but that doesn't seem to be enough.

Another approach is probably to use `withExtendedLifetime` in `testUpdateAuthTokens`, but I think it is better/easier to have the config option.
@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 7, 2021

@swift-ci please test

@abertelrud abertelrud added the 5.5 label Jun 7, 2021
@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 8, 2021

@swift-ci please test macOS

@yim-lee yim-lee merged commit ef65666 into swiftlang:release/5.5 Jun 8, 2021
@yim-lee yim-lee deleted the testUpdateAuthTokens-sig11-5.5 branch June 8, 2021 04:08
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.

3 participants