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

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

Re: Lockup


From: Jan Djärv
Subject: Re: Lockup
Date: Thu, 10 Aug 2006 10:11:55 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060808)



YAMAMOTO Mitsuharu skrev:
On Thu, 10 Aug 2006 08:20:24 +0200, Jan Djärv <address@hidden> said:

Hi, I just had a lockup occuring.  Here is a backtrace:

I've checked in a fix, but I beleive the race condition still exists
on multiprocessor machines.  I can't see a way to fix that except
move to SYNC_INPUT.

Maybe I'm missing something, but doesn't adding BLOCK_INPUT around
closedir (and opendir) help?


In this particular case it would help, but in general the problem is that the signal handler gets called when the main thread is executing in the mutex code (pthread_mutex_unlock). Later when the signal handler tries to get the mutex, it locks up, it is actually not allowed to call mutex functions from a signal handler. The mutex is there to protect from other (Gnome) threads that also call malloc/free.

But if a Gnome thread has the mutex and before it has blocked signals, the signal handler is run in parallell on another processor, there will be problems. If we move to SYNC_INPUT there will be no malloc/free called in the signal handler and we only need the mutex to hamdle concurrent access.

        Jan D.


#22 0x080cac12 in XTread_socket (sd=0, expected=1, hold_quit=0xbfabf5ac)
    at /home/tmp/emacs/src/xterm.c:7067
#23 0x080f90dc in read_avail_input (expected=1)
    at /home/tmp/emacs/src/keyboard.c:6737
#24 0x080f9283 in handle_async_input () at /home/tmp/emacs/src/keyboard.c:6883
#25 0x080f9317 in input_available_signal (signo=29)
    at /home/tmp/emacs/src/keyboard.c:6925
#26 <signal handler called>
#27 0xb795d27d in pthread_mutex_unlock ()
   from /lib/tls/i686/cmov/libpthread.so.0
#28 0xb77a62f5 in free () from /lib/tls/i686/cmov/libc.so.6
#29 0xb77caa08 in closedir () from /lib/tls/i686/cmov/libc.so.6
#30 0x08122c57 in directory_files_internal_unwind (dh=161026626)
    at /home/tmp/emacs/src/dired.c:137





reply via email to

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