[PATCH 0/2] Warn on pthread errors

Tim Wiederhake posted 2 patches 3 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20240703124438.73218-1-twiederh@redhat.com
src/util/virthread.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
[PATCH 0/2] Warn on pthread errors
Posted by Tim Wiederhake 3 months, 2 weeks ago
libvirt currently exhibits undefined behavior due to pthread mutex misuse,
e.g. destroying a locked mutex or attempting to unlock an already unlocked
mutex.

Add a warning if such a case is detected, so we can start on fixing the
issues.

Tim Wiederhake (2):
  virMutex: Warn on error
  DO NOT MERGE: virMutex: Fail loudly

 src/util/virthread.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

-- 
2.43.0
Re: [PATCH 0/2] Warn on pthread errors
Posted by Michal Prívozník 3 months, 2 weeks ago
On 7/3/24 14:44, Tim Wiederhake wrote:
> libvirt currently exhibits undefined behavior due to pthread mutex misuse,
> e.g. destroying a locked mutex or attempting to unlock an already unlocked
> mutex.
> 
> Add a warning if such a case is detected, so we can start on fixing the
> issues.
> 

I expect this to be even harder to fix than to detect. BTW: in the past
I used to play with:

  https://github.com/dbadapt/mutrace

which looked like it could detect some locking problems. I think I even
had some patches locally for easier debugging of libvirt. But I can't
find that repo anymore.

Oh, and then there's DRD tool in valgrind, but I can't find the right
combination of arguments to make it produce anything usable.

Michal