On Fri Sep 8 17:30:15 2023 +0000, Zebediah Figura wrote:
See the details in https://bugs.winehq.org/show_bug.cgi?id=52213 and
https://gitlab.winehq.org/wine/wine/-/merge_requests/1088, also https://gitlab.winehq.org/wine/wine/-/merge_requests/1503#note_17119 As far as I understand, what's happening in bug 52213 is that threads that are killed while in glibc die noisily, by triggering a Wine segmentation fault. But this doesn't inhere to condition variables, it only happens after threads are killed for one reason or another, and it doesn't actually have any adverse effects besides printing some extra messages to the console (I don't even think it triggers a winedbg window?) In that case it doesn't seem to me that condition variables are actually broken, or really that anything is. The extra messages do seem undesirable and misleading, but they're a consequence of killing threads, which I think should be avoidable in most cases anyway. Or is there some other aspect of the problem that I'm misunderstanding? Do condition variables actually misbehave in some meaningful way?
It happens every time a process terminates while one of its thread is waiting on a condition variable.
The result is completely unpredictable and it may "just" crash indeed, but I've also seen it trigger silent infinite loops if the invalid stack frames are bad enough, or the segv_handler can handle the crash and restore the thread to another corrupted frame, again and again. This can and does end up with stuck processes.