On Fri, Jul 12, 2019 at 9:02 AM Pip Cet wrote: > > 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. Okay, I'm still not sure this is really the problem Andreas was seeing, but this code fails to work with xg_select: (let ((thread (make-thread (lambda () (sleep-for 3))))) (thread-yield) (thread-signal thread 'error nil)) Proposed patch attached.