https://bugs.kde.org/show_bug.cgi?id=469971

            Bug ID: 469971
           Summary: Helgrind reports possible data race which isn't
    Classification: Developer tools
           Product: valgrind
           Version: 3.18.1
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: helgrind
          Assignee: jsew...@acm.org
          Reporter: h.teisse...@hotmail.fr
  Target Milestone: ---

SUMMARY
***
Using `valgrind --tool=helgrind ./philo 5 300 100 50` a possible data race is
reported that shouldn't possible.
Because at the end of the routine I call in a newly created thread I
lock/unlock a mutex. And in my main thread I make a call to
pthread_mutex_destroy().
***


STEPS TO REPRODUCE
1. Download my project source file from
https://github.com/teisseire117/cursus42/tree/master/Philosophers/philo and
compile the project using the command `make`
2. Launch the program with valgrind using the command `valgrind --tool=helgrind
./philo 5 300 100 50`
3. It will report the above-mentioned possible data race.

OBSERVED RESULT
Possible data race report from Helgrind

EXPECTED RESULT
No error reports were expected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux hateisse-VB 5.19.0-41-generic #42~22.04.1-Ubuntu SMP
PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ADDITIONAL INFORMATION
Before making a call to pthread_mutex_destroy() I ensure that the thread in
which I try to lock/unlock will not be using that mutex because it would have
made a final return which will exit the thread. So it shouldn't be possible for
pthread_mutex_destroy() to have a data race because it's only called when no
more lock/unlock of that mutex are possible to happen.
(It's always possible that I'm wrong but I'm reading it as open-minded as I can
and I don't see the issue. If you find a real issue then I would be glad to
have learned why !)

Thank you

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to