[SYCL][E2E] Fix enum parameter free function kernel test failure #20423
+3
−6
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.
Fix of #20225.
I think that the issue here is that the default accessor is being passed by reference rather than by value to the
set_arg
function which causes the handler object to sporadically have a corrupted copy of the accessor during itsfinalize
function where some final checks are done. I suspect that with other types of accessors that are constructed using the command group handler, we can declare the accessor at any scope we want because some internal deep copy of the accessor is stored within the handler whereas with default constructed accessors we need a scope that will not die before the handler. This would explain the sporadic nature of the bug.An easy fix is to move the accessor outside the scope of the command group. Since this is a host-side issue, I played around with Valgrind and indeed, before the fix, I was seeing several reports of memory access inside a deallocated region that I traced back to the default constructed accessors and after the fix, nothing, so fingers crossed.
Closes #20225