-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zeCommandQueueCreate spontaneously segfault when creating one queue per thread #568
Comments
Here is a reproducer:
To compile, use "g++ -O0 -g test_queue.cc -lze_loader -lpthread" or clang++. |
thanks. Taking a look. |
Any updates on this? @pengtu @JablonskiMateusz |
@pvelesko: The bug was rejected by the driver team. Quote of the analysis below: This is a problem in your application. You have the threads spawning here: // 1) Create qeueu with the main thread for (auto& th : threads) { What is occurring is that the main program is exiting before all the threads finished, with the device and driver resources freed while your threads were still running. The correct way to write this program is to change to the following: // 1) Create qeueu with the main thread The main program must not start releasing the resources for the devices and driver before the threads have finished otherwise this segfault is expected. Basically, the L0 device resources were freed resulting in a thread attempting to create a queue without any data structures for the device being available ie: process locked thread id read, 0x5575b7043e20 processLocked function Please fix your test program. This is not a bug, but a misunderstanding of the functionality. |
This is a cutdown case from CHIP-SPV/chipStar#146. When calling zeCommandQueueCreate from multiple threads, it spontaneously segfaults.
The call stack trace is:
Thread 101 "a.out" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff88404700 (LWP 7105)]
0x00007ffff741f5c4 in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
(gdb) bt
#0 0x00007ffff741f5c4 in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#1 0x00007ffff7153958 in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#2 0x00007ffff714f3c5 in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#3 0x00007ffff714f523 in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#4 0x00007ffff714f69a in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#5 0x00007ffff71567be in ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#6 0x00007ffff7ef56fd in zeCommandQueueCreate () from /usr/local/lib/libze_loader.so.1
#7 0x0000555555555479 in QueuePerThread () at test_queue.cc:28
#8 0x00005555555575aa in std::__invoke_impl<void, void ()()> (__f=@0x55555585b308: 0x55555555543a <Q
ueuePerThread()>) at /usr/include/c++/9/bits/invoke.h:60
#9 0x0000555555557542 in std::__invoke<void ()()> (__fn=@0x55555585b308: 0x55555555543a <QueuePerThr
ead()>) at /usr/include/c++/9/bits/invoke.h:95
#10 0x00005555555574d4 in std::thread::_Invoker<std::tuple<void ()()> >::_M_invoke<0ul> (this=0x55555
585b308) at /usr/include/c++/9/thread:244
#11 0x0000555555557491 in std::thread::_Invoker<std::tuple<void ()()> >::operator() (this=0x55555585b
308) at /usr/include/c++/9/thread:251
#12 0x0000555555557462 in std::thread::_State_impl<std::thread::Invoker<std::tuple<void (*)()> > >::
M_run (this=0x55555585b300) at /usr/include/c++/9/thread:195
#13 0x00007ffff7d9fde4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x00007ffff7eb3609 in start_thread (arg=) at pthread_create.c:477
#15 0x00007ffff7bdb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The text was updated successfully, but these errors were encountered: