Skip to content

SIL: Gate checkForLeaksAfterDestruction to asserts builds #35568

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

kastiglione
Copy link
Contributor

@kastiglione kastiglione commented Jan 23, 2021

A few lldb bug reports have shown that SILModule::checkForLeaksAfterDestruction() can fail. The root cause is TBD, possibly by calling IRGenRequest::evaluate concurrently (the leaks check uses counters that are not thread safe).

This leaks check should reasonably be performed only in asserts builds. That way end users won't face a crash if there's a race in how the check is performed, or if there is a leak. Note that SILModule::checkForLeaks() is called only in asserts builds.

rdar://70826934

@kastiglione kastiglione requested a review from eeckstein January 23, 2021 01:37
@kastiglione
Copy link
Contributor Author

@swift-ci smoke test

@kastiglione
Copy link
Contributor Author

@swift-ci smoke test Linux

1 similar comment
@kastiglione
Copy link
Contributor Author

@swift-ci smoke test Linux

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

Basically LGTM.
Can you add a comment why this check is not done in release builds. E.g. add a link to the radar and mention that it's for LLDB.

@kastiglione
Copy link
Contributor Author

@swift-ci smoke test

@kastiglione
Copy link
Contributor Author

@swift-ci smoke test Linux

@kastiglione kastiglione merged commit c36c320 into main Jan 27, 2021
@kastiglione kastiglione deleted the SIL-Gate-checkForLeaksAfterDestruction-to-asserts-builds branch January 27, 2021 18:30
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