PersistentDeviceCodeCacheImpl/PersistentDeviceCodeCache.KeysWithNullTermSymbol/0 sporadic fail on Windows
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
### Describe the bug
```
[ RUN ] PersistentDeviceCodeCacheImpl/PersistentDeviceCodeCache.KeysWithNullTermSymbol/0
Exception Code: 0xC0000005
#0 0x00007ff7d6a1b037 std::swap C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\utility:140:0
#1 0x00007ff7d6a1b037 sycl::_V1::detail::device_impl::unregisterQueue D:\github\_work\llvm\llvm\src\sycl\source\detail\device_impl.hpp:2393:0
#2 0x00007ff7d6a1b037 sycl::_V1::detail::queue_impl::~queue_impl(void) D:\github\_work\llvm\llvm\src\sycl\source\detail\queue_impl.hpp:251:0
#3 0x00007ff7d6c0a52c std::_Ref_count_base::_Decwref C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\memory:1166:0
#4 0x00007ff7d6c0a52c std::_Ref_count_base::_Decref C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\memory:1161:0
#5 0x00007ff7d6c0a52c std::_Ptr_base::_Decref C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\memory:1377:0
#6 0x00007ff7d6c0a52c std::shared_ptr::~shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\memory:1682:0
#7 0x00007ff7d6c0a52c sycl::_V1::detail::Scheduler::NotifyHostTaskCompletion(class sycl::_V1::detail::Command *) D:\github\_work\llvm\llvm\src\sycl\source\detail\scheduler\scheduler.cpp:520:0
#8 0x00007ff7d6c02e7a std::unique_ptr >::~unique_ptr C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\memory:3408:0
#9 0x00007ff7d6c02e7a sycl::_V1::detail::DispatchHostTask::operator()(void) const D:\github\_work\llvm\llvm\src\sycl\source\detail\scheduler\commands.cpp:420:0
#10 0x00007ff7d6b00cac std::_Mutex_base::lock C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\mutex:52:0
#11 0x00007ff7d6b00cac std::unique_lock::lock C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\mutex:198:0
#12 0x00007ff7d6b00cac sycl::_V1::detail::ThreadPool::worker(void) D:\github\_work\llvm\llvm\src\sycl\source\detail\thread_pool.hpp:79:0
#13 0x00007ff7d6b00b0e std::thread::_Invoke>, 0>(void *) C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\thread:61:0
#14 0x00007ffb27e4cd30 (C:\WINDOWS\System32\ucrtbase.dll+0x2cd30)
#15 0x00007ffb2911cd87 (C:\WINDOWS\System32\KERNEL32.DLL+0x2cd87)
#16 0x00007ffb2a52caec (C:\WINDOWS\SYSTEM32\ntdll.dll+0xacaec)
Access violation
```
https://github.com/intel/llvm/actions/runs/34408006552/job/102655521992
### To reproduce
1. Include a code snippet that is as short as possible
2. Specify the command which should be used to compile the program
3. Specify the command which should be used to launch the program
4. Indicate what is wrong and what was expected
### Environment
- OS: [e.g Windows/Linux]
- Target device and vendor: [e.g. Intel GPU]
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]
- Dependencies version: [e.g. the output of `sycl-ls --verbose`]
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing PersistentDeviceCodeCacheImpl/PersistentDeviceCodeCache.KeysWithNullTermSymbol/0 on Windows using the linked GitHub Actions run. Read sycl/source/detail/device_impl.hpp at unregisterQueue, queue_impl.hpp at the destructor, and scheduler.cpp at NotifyHostTaskCompletion; trace the queue lifetime through commands.cpp at DispatchHostTask. Done means the sporadic access violation is fixed and the named test passes reliably on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, operating-systems, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100