bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21965: 24.5; Emacs freezes when canceling at open file


From: John Wiegley
Subject: bug#21965: 24.5; Emacs freezes when canceling at open file
Date: Tue, 24 Nov 2015 17:38:06 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

>>>>> Maneesh Yadav <maneeshkyadav@gmail.com> writes:

> I still am uncomfortable with my comprehension of the lldb output but here
> is 'backtrace all' after triggering the condition

Ok! Now we know what the deadlock situation is:

Thread #2:

>     frame #3: 0x00000001009dd716 libglib-2.0.0.dylib`g_main_context_iteration 
> + 55
...
>     frame #0: 0x00007fff8a8613fa libsystem_kernel.dylib`__select + 10

Thread #1:

>     frame #3: 0x00000001009db284 libglib-2.0.0.dylib`g_main_context_acquire + 
> 42

It turns out that both g_main_context_acquire and g_main_context_iteration
(when called with NULL) call LOCK_CONTEXT on the "default context".

Now, I *think* the context should be different between these two threads: one
should be the default context, and one should be the worker context. But it
_looks_ like Thread #1 is being locked out by Thread #2.

In fact, reading the glib code, if the call to g_once_init_enter returns FALSE
within g_get_worker_context, then the worker context will be NULL! Which seems
like a subtle bug waiting to happen, and might be what's biting us.

To go deeper, we may need to build a separate copy of glib and start putting
some print statements in to find out why there is lock contention. Would you
be up for that? I'd like to know if this is happening in g_get_worker_context.

John





reply via email to

[Prev in Thread] Current Thread [Next in Thread]