[Aquamacs-devel] lock files cause Aquamacs to hang

Pete Siemsen siemsen at ucar.edu
Sun Oct 25 17:47:37 UTC 2009


David,

With gdb on "2.0preview2", here's the backtrace:

(gdb) bt
#0  0x94d5da76 in unlink ()
#1  0x000f864f in current_lock_owner ()
#2  0x000f86e7 in lock_if_free ()
#3  0x000f8926 in lock_file ()
#4  0x000fe2ad in prepare_to_modify_buffer ()
#5  0x000fd6be in del_range_1 ()
#6  0x000fd625 in del_range ()
#7  0x00116dfa in Fdelete_char ()
#8  0x00169c15 in Ffuncall ()
#9  0x00164532 in Fcall_interactively ()
#10 0x00169c48 in Ffuncall ()
#11 0x00169704 in call3 ()
#12 0x000daa38 in Fcommand_execute ()
#13 0x000c9e31 in command_loop_1 ()
#14 0x00167030 in internal_condition_case ()
#15 0x000c7ca2 in command_loop_2 ()
#16 0x001669c1 in internal_catch ()
#17 0x000c7c2b in command_loop ()
#18 0x000c71ff in recursive_edit_1 ()
#19 0x000c7408 in Frecursive_edit ()
#20 0x000c5710 in main ()
(gdb)


Yes, it also occurs with 1.9.  Using 1.9, here's the top part of a  
dump after a Force Quit:

Date/Time:      2009-10-21 08:49:09 -0600
OS Version:     10.5.8 (Build 9L30)
Architecture:   i386
Report Version: 4

Command:        Aquamacs
Path:           /Applications/Aquamacs Emacs.app/Contents/MacOS/ 
Aquamacs Emacs
Version:        Aquamacs 1.9, GNU Emacs 22 (1.9)
Parent:         launchd [125]

PID:            4883
Event:          hang
Time:           8.02s
Steps:          48


Process:        Aquamacs Emacs [4883]
Path:           /Applications/Aquamacs Emacs.app/Contents/MacOS/ 
Aquamacs Emacs

  ADDRESS         BINARY
  00001000        /Applications/Aquamacs Emacs.app/Contents/MacOS/ 
Aquamacs Emacs
  01781000        /System/Library/PrivateFrameworks/URLMount.framework/ 
URLMount
  020eb000        /System/Library/CoreServices/RawCamera.bundle/ 
Contents/MacOS/RawCamera
  02464000        /System/Library/Filesystems/URLMount/smb.URLMounter/ 
Contents/MacOS/smb

  Thread id:      8f16998
  User stack:
    48 _prepare_to_modify_buffer + 383 (in Aquamacs Emacs) [0xc525a]
      27 ___unlink + 10 (in libSystem.B.dylib) [0x94d5da76]
      11 ___symlink + 10 (in libSystem.B.dylib) [0x94d9879e]
      10 ___readlink + 10 (in libSystem.B.dylib) [0x94d55a0e]
  Kernel stack:
    48 _unix_syscall + 572 [0x3e3a7f]
      27 _unlink + 113 [0x1e55b1]
        27 _undelete + 665 [0x1e5403]
          16 _VNOP_REMOVE + 119 [0x1f5c53]
            16 com.apple.filesystems.smbfs (1.4.6) + 69064 [0x5b3bcdc8]
              16 com.apple.filesystems.smbfs (1.4.6) + 68698  
[0x5b3bcc5a]
                15 com.apple.filesystems.smbfs (1.4.6) + 34555  
[0x5b3b46fb]
                  15 com.apple.filesystems.smbfs (1.4.6) + 125137  
[0x5b3ca8d1]
                    15 com.apple.filesystems.smbfs (1.4.6) + 124651  
[0x5b3ca6eb]
                      15 com.apple.filesystems.smbfs (1.4.6) + 122984  
[0x5b3ca068]
                        15 _msleep + 157 [0x3863e8]
                          15 _uiomove + 608 [0x38600a]
                            15 _lck_mtx_sleep_deadline + 104 [0x130e26]
                              15 _thread_block + 33 [0x136f20]
                                12 _thread_continue + 1180 [0x136cb3]
                                3 _thread_block_reason + 135 [0x136e7c]
                                  3 _thread_setrun + 3597 [0x136217]
                                    3 _machine_idle + 271 [0x1ac3ec]
                1 com.apple.filesystems.smbfs (1.4.6) + 49907  
[0x5b3b82f3]
          11 _VNOP_REMOVE + 176 [0x1f5c8c]
            11 _VNOP_SETATTR + 1421 [0x1f588e]
              11 _namei + 1237 [0x1d745e]
                11 _lookup + 661 [0x1d66c7]
                  11 _VNOP_LOOKUP + 110 [0x1f4da4]
                    11 com.apple.filesystems.smbfs (1.4.6) + 77029  
[0x5b3bece5]
                      11 com.apple.filesystems.smbfs (1.4.6) + 49215  
[0x5b3b803f]
                        11 com.apple.filesystems.smbfs (1.4.6) + 46324  
[0x5b3b74f4]
                          11 com.apple.filesystems.smbfs (1.4.6) +  
128278 [0x5b3cb516]
                            11 com.apple.filesystems.smbfs (1.4.6) +  
124651 [0x5b3ca6eb]
                              11 com.apple.filesystems.smbfs (1.4.6) +  
122984 [0x5b3ca068]
                                11 _msleep + 157 [0x3863e8]
                                  11 _uiomove + 608 [0x38600a]
                                    11 _lck_mtx_sleep_deadline + 104  
[0x130e26]
                                      11 _thread_block + 33 [0x136f20]
                                        9 _thread_continue + 1180  
[0x136cb3]
                                        2 _thread_block_reason + 135  
[0x136e7c]
                                          2 _thread_setrun + 3597  
[0x136217]
                                            2 _machine_idle + 271  
[0x1ac3ec]
      11 _symlink + 222 [0x1e4ee7]
        11 _namei + 1237 [0x1d745e]
          11 _lookup + 661 [0x1d66c7]
            11 _VNOP_LOOKUP + 110 [0x1f4da4]
              10 com.apple.filesystems.smbfs (1.4.6) + 77029  
[0x5b3bece5]
                10 com.apple.filesystems.smbfs (1.4.6) + 49215  
[0x5b3b803f]
                  10 com.apple.filesystems.smbfs (1.4.6) + 46324  
[0x5b3b74f4]
                    10 com.apple.filesystems.smbfs (1.4.6) + 128278  
[0x5b3cb516]
                      10 com.apple.filesystems.smbfs (1.4.6) + 124651  
[0x5b3ca6eb]
                        10 com.apple.filesystems.smbfs (1.4.6) +  
122984 [0x5b3ca068]
                          10 _msleep + 157 [0x3863e8]
                            10 _uiomove + 608 [0x38600a]
                              10 _lck_mtx_sleep_deadline + 104  
[0x130e26]
                                10 _thread_block + 33 [0x136f20]
                                  10 _thread_continue + 1180 [0x136cb3]
              1 com.apple.filesystems.smbfs (1.4.6) + 77487 [0x5b3beeaf]
                1 com.apple.filesystems.smbfs (1.4.6) + 12335  
[0x5b3af02f]
                  1 com.apple.filesystems.smbfs (1.4.6) + 7036  
[0x5b3adb7c]
                    1 _kalloc + 25 [0x12fde1]
      10 _readlink + 381 [0x1e6aa0]
        10 _VNOP_READLINK + 104 [0x1f5ff1]
          10 com.apple.filesystems.smbfs (1.4.6) + 72823 [0x5b3bdc77]
            10 com.apple.filesystems.smbfs (1.4.6) + 21272 [0x5b3b1318]
              10 com.apple.filesystems.smbfs (1.4.6) + 128278  
[0x5b3cb516]
                10 com.apple.filesystems.smbfs (1.4.6) + 124651  
[0x5b3ca6eb]
                  10 com.apple.filesystems.smbfs (1.4.6) + 122984  
[0x5b3ca068]
                    10 _msleep + 157 [0x3863e8]
                      10 _uiomove + 608 [0x38600a]
                        10 _lck_mtx_sleep_deadline + 104 [0x130e26]
                          10 _thread_block + 33 [0x136f20]
                            8 _thread_continue + 1180 [0x136cb3]
                            2 _thread_block_reason + 135 [0x136e7c]
                              2 _thread_setrun + 3597 [0x136217]
                                2 _machine_idle + 271 [0x1ac3ec]


I have only tested this with SMB shares.

-- Pete


On Oct 20, 2009, at 9:31 PM, David Reitter wrote:

> Pete,
> that's a pretty good analysis so far.
> Yes, the dump would help.  You can also run Aquamacs under gdb and  
> interrupt the process when the hang occurs.  "bt" gives you a  
> backtrace.
> I would run it with "run -Q" from gdb.
>
> Also, does this not occur with 1.9?
>
> Have you tested it only on SMB shares, or also on normal AFP ones?
>
> - David
>
> On Oct 20, 2009, at 4:59 PM, siemsen at ucar.edu wrote:
>
>> I still have this problem, which I previously mistakenly referred  
>> to as a problem with auto-save files.  It's really a problem with  
>> lock files.  It happens in version "2.0preview2" and "2.0dev".
>>
>> The problem is: when editing network-mounted files, Aquamacs  
>> doesn't process lock files correctly.  If I open an existing  
>> network-mounted file named abc.txt, Aquamacs creates a lock file in  
>> the same directory as the source file, on the remote system.  The  
>> lock file is a symbolic link named ".#abc.txt".  An ls command shows
>>
>>   .#abc.txt -> siemsen at galway.scd.ucar.edu.12194
>>
>> As described in the "File Locks" section of the "GNU Emacs Lisp  
>> Reference Manual", the link points back to the Aquamacs process on  
>> my Mac, which is named galway.scd.ucar.edu.  The process is running  
>> as user siemsen, and the PID is 12194.
>>
>> So far, so good.  The problem is that when I finish editing the  
>> file, the lock file isn't deleted.  When I try to edit the file  
>> later, Aquamacs lets me open file, but hangs the instant I try to  
>> modify it.  Aquamacs locks up with the spinning wheel of death, and  
>> I have to Force Quit.  If I then go to the remote system and  
>> manually delete the lock file, Aquamacs can edit the file with no  
>> problems.
>>
>> I don't see lock files created when I edit files on my local system  
>> - only network-mounted files.  The manual says I should be able to  
>> test whether a file is locked with file-locked-p, but that function  
>> doesn't seem to be implemented in Aquamacs.  Could it be that  
>> Aquamacs doesn't implement file locks, but something different  
>> happens with network-mounted files?
>>
>> FWIW, I found the code for filelock.c, which implements file-locked- 
>> p and unlock-buffer.  I see that unlock-buffer calls the C function  
>> named unlock_file, which uses a call to unlink to delete lock  
>> files.  Perhaps unlock_file should check the status code returned  
>> by unlink.
>>
>> This is easily repeatable, and quite annoying.  I'd be happy to  
>> supply the dump from Force Quit if it would help.
>>
>> - Pete

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aquamacs.org/pipermail/aquamacs-devel/attachments/20091025/3394f51d/attachment-0009.htm>


More information about the Aquamacs-devel mailing list