Bug 439226 - Multiple io_urings per thread not supported
Summary: Multiple io_urings per thread not supported
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-27 14:17 UTC by Mauro Dege
Modified: 2023-11-18 12:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Dege 2021-06-27 14:17:41 UTC
Hi,

I am trying to use valgrind 3.17.0 on a multi-threaded program that starts multiple io_uring loops on 4 different threads. The problem that I am encountering is that Valgrind works only on the first thread and stops the execution of all three remaining threads. When running these same 4 threads without io_uring enabled everything works well, so it seems that the problem might be related to having multiple io_uring instances running on each thread.

Here is the sample output from valgrind:

==56962== Memcheck, a memory error detector
==56962== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==56962== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==56962== Command: ./build/test
==56962== 
Detected 4 cores, starting one thread per core.
About to start thread 0...
About to start thread 1...
About to start thread 2...
About to start thread 3...
Finished starting threads.
Started thread 1

When using GDB all four io_uring loops are started properly:

Starting program: /build/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Detected 4 cores, starting one thread per core.
About to start thread 0...
[New Thread 0x7ffff78ae700 (LWP 57414)]
About to start thread 1...
[New Thread 0x7ffff70ad700 (LWP 57415)]
About to start thread 2...
[New Thread 0x7ffff68ac700 (LWP 57418)]
About to start thread 3...
Started thread 0
[New Thread 0x7ffff5568700 (LWP 57421)]
Finished starting threads.
Started thread 2
Started thread 1
Started thread 3

$ uname -a
Linux ubuntu-focal 5.11.0-051100-generic #202102142330 SMP Sun Feb 14 23:33:21 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

To reproduce this problem start multiple threads and run io_uring on each one of them. In case you are not able to reproduce this easily please let me know and I'll try writing some code to reproduce this behaviour.

Thank you!


Best,
Mauro
Comment 1 Paul Floyd 2023-11-18 12:08:48 UTC
Can you reproduce this with a small example?