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

refactor loader lifetime management #1826

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

pbalcer
Copy link
Contributor

@pbalcer pbalcer commented Jul 5, 2024

This patch implements an atomic singleton class for managing the lifecycle of the context objects inside of the loader. This class ensures that the contexts always exist and lets the loader manually destroy them on user request (during teardown).

Thanks to this change, the loader no longer relies on the order of library constructors and destructors. It also gets us 90% towards allowing the loader to be statically linked with the application (which is why I did this :P).

@github-actions github-actions bot added loader Loader related feature/bug common Changes or additions to common utilities sanitizer Sanitizer layer issues/changes/specification labels Jul 5, 2024
@pbalcer pbalcer marked this pull request as ready for review July 8, 2024 13:07
@pbalcer pbalcer requested a review from a team as a code owner July 8, 2024 13:07
@pbalcer pbalcer force-pushed the loader-lifetime-context branch 6 times, most recently from a1f2402 to 9220498 Compare July 10, 2024 13:37
Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

I've been investigating tear down regression in intel/llvm#14145 and I believe this will solve those.

I'll be adding some logging on top of this once it merges for loading/unloader apdater libs to satisfy some e2e testing.

@pbalcer pbalcer force-pushed the loader-lifetime-context branch 3 times, most recently from 31c3af8 to 4d1b56e Compare July 11, 2024 13:21
This patch implements an atomic singleton class for managing
the lifecycle of the context objects inside of the loader.
This class ensures that the contexts always exist and lets the
loader manually destroy them on user request (during teardown).

Thanks to this change, the loader no longer relies on the order
of library constructors and destructors. It also gets us 90%
towards allowing the loader to be statically linked with the
application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Changes or additions to common utilities loader Loader related feature/bug ready to merge Added to PR's which are ready to merge sanitizer Sanitizer layer issues/changes/specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants