Re: [vdr] [PATCH] ThreadSanitizer warnings for cThread

2022-12-14 Thread Marko Mäkelä
Wed, Dec 14, 2022 at 10:21:10AM +0100, Klaus Schmidinger wrote: Is there an actual problem that requires this? It has been that way for many, many years, so I'd like to see more than "looks problematic to me" before I dare touch this ;-). The only problem that I am currently aware of is

Re: [vdr] [PATCH] ThreadSanitizer warnings for cThread

2022-12-14 Thread Klaus Schmidinger
On 10.12.22 18:30, Marko Mäkelä wrote: ... Finally, I figured out what is causing the first report: cThread::description is not protected by cThread::mutex. Possibly, most cThread data members (including cThread::active) should be protected by cThread::mutex? Unless I'm missing something,

Re: [vdr] [PATCH] ThreadSanitizer warnings for cThread

2022-12-12 Thread Marko Mäkelä
Sat, Dec 10, 2022 at 07:30:50PM +0200, Marko Mäkelä wrote: Because of the heap-use-after-free race condition that was rather easily reproducible with AddressSanitizer (-fsanitize=address), I thought that I should finally try to learn to use ThreadSanitizer (TSAN, -fsanitize=thread in GCC and

Re: [vdr] [PATCH] ThreadSanitizer warnings for cThread

2022-12-10 Thread Marko Mäkelä
Sat, Dec 10, 2022 at 07:30:50PM +0200, Marko Mäkelä wrote: Finally, I figured out what is causing the first report: cThread::description is not protected by cThread::mutex. Sorry, I failed to notice that even after applying both patches, both TSAN reports are still there. The race condition

[vdr] [PATCH] ThreadSanitizer warnings for cThread

2022-12-10 Thread Marko Mäkelä
Because of the heap-use-after-free race condition that was rather easily reproducible with AddressSanitizer (-fsanitize=address), I thought that I should finally try to learn to use ThreadSanitizer (TSAN, -fsanitize=thread in GCC and clang). https://clang.llvm.org/docs/ThreadSanitizer.html