On Thu, Jul 11, 2019 at 8:52 PM Andreas Politz wrote: > I think there is a race-condition in the implementation of threads. I > tried to find a minimal test-case, without success. Thus, I've attached > a lengthy source-file. Loading that file should trigger this bug and > may freeze your session. It does here, so I can provide further debugging information if needed. On first glance, it appears that xgselect returns abnormally with g_main_context acquired in one thread, and then other threads fail to acquire it and loop endlessly. Can you confirm that this very dirty patch avoids (it's not a fix by any means!) the problem?