Skip to content

Conversation

@cperkinsintel
Copy link
Contributor

Tracked this down when the sycl/test-e2e/Schedulder/HostAccDestruction.cpp test started timing out on some Win machines. UR has the fix, but it wasn't being used when SYCL_UR_TRACE was elected.

@cperkinsintel cperkinsintel marked this pull request as ready for review November 6, 2025 00:30
@cperkinsintel cperkinsintel requested a review from a team as a code owner November 6, 2025 00:30
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

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

My preference would be to change the test to work with the new log format. If that's not feasible, you can change the one log entry that is causing issues to use the UR_LOG_LEGACY macro.

@cperkinsintel
Copy link
Contributor Author

@pbalcer - I may not be quite understanding your comment, and perhaps I should have been clearer in the description.

On Windows, when SYCL_UR_TRACE is used then we sometimes see a SegFault coming from the UR when the app is shutting down. What is happening is UR_LOG inserts a call to a print virtual function that the OS has already cleaned up.
But the UR has an existing fix, it sets and checks the isTearDowned variable to avoid accidentally calling static vars that the OS may have destroyed. That logic is in the legacy sink which but the sink is not used generally, just in a few situations. If someone uses SYCL_UR_TRACE on Windows then it is needed. That's what this PR does it adds another situation where it is used.

I don't work on the UR generally, so I may not be appreciating the full landscape. If there is some OTHER approach instead of the legacy, let me know.

@pbalcer
Copy link
Contributor

pbalcer commented Nov 7, 2025

The legacy sink was originally added as a way to maintain backward compatibility with the old log format, for tests and tools that relied on parsing it. I wasn't aware it was them co-opted to support this issue with destruction and unload ordering. Setting the legacy sink will, in addition to handling the teardown differently, change the format of the logs. We need to separate these two things.

@cperkinsintel cperkinsintel marked this pull request as draft November 7, 2025 22:00
Signed-off-by: Chris Perkins <chris.perkins@intel.com>
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