You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a flaky bug in event.cpp where an async exception handler associated to a queue had already gone out of scope by the time the queue_impl destructor was called. Since the latter(destructor) calls the former(exception handler), this is clearly a problem as we get undefined behavior. This PR moves the exception handler, previously declared in function scope, to global scope so that it always outlives the queue resources.
lbushi25
changed the title
[SYCL] Fix bug where queue_impl outlives async handler and causes a segmentation fault
Fix bug in event.cpp where queue_impl outlives async handler and causes a segmentation fault
Jan 26, 2026
In theory better to clear(); at the beginning of the test, not at the end.
Indeed if a test fail, maybe clear() will not be triggered and leave the handle in a bad state. But 🤷🏽 , not that critical. Thanks for the fix!
@lbushi25, let me know if you are going to apply this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AgendaTo be discussed during a SYCL committee meeting
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a flaky bug in
event.cppwhere an async exception handler associated to a queue had already gone out of scope by the time thequeue_impldestructor was called. Since the latter(destructor) calls the former(exception handler), this is clearly a problem as we get undefined behavior. This PR moves the exception handler, previously declared in function scope, to global scope so that it always outlives the queue resources.