Skip to content

Conversation

@igchor
Copy link
Contributor

@igchor igchor commented Aug 21, 2024

Global xptiContext was beeing (sometimes) destroyed before the tracing context (as both were global variables, their order of destruction was not guaranteed). This resulted in lost notifications as xptiFinalize was being called after xptiFrameworkFinalize.

Fix this by creating a global shared_ptr to the xptiContext. Bump the refcount of that pointer every time a context is created and decrease when it is destroyed to make sure that xptiFrameworkInitialize() is not beeing called before the last context is destroyed.

@igchor igchor requested a review from a team as a code owner August 21, 2024 21:34
@github-actions github-actions bot added the loader Loader related feature/bug label Aug 21, 2024
Global xptiContext was beeing (sometimes) destroyed before the
tracing context (as both were global variables, their order of
destruction was not guaranteed). This resulted in lost
notifications as xptiFinalize was being called after xptiFrameworkFinalize.

Fix this by creating a global shared_ptr to the xptiContext.
Bump the refcount of that pointer every time a context is created
and decrease when it is destroyed to make sure that xptiFrameworkInitialize()
is not beeing called before the last context is destroyed.
@kbenzie kbenzie added the v0.10.x Include in the v0.10.x release label Aug 22, 2024
@omarahmed1111 omarahmed1111 merged commit 2f67b38 into oneapi-src:main Aug 22, 2024
kbenzie pushed a commit that referenced this pull request Aug 22, 2024
[Loader] Fix xpti finalization order
@kbenzie kbenzie mentioned this pull request Aug 22, 2024
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loader Loader related feature/bug v0.10.x Include in the v0.10.x release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants