[Aquamacs-devel] lock files cause Aquamacs to hang
siemsen at ucar.edu
siemsen at ucar.edu
Tue Oct 20 20:59:02 UTC 2009
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
Begin forwarded message:
> From: siemsen at ucar.edu
> Date: September 30, 2009 3:56:27 PM MDT
> To: Aquamacs Developers <aquamacs-devel at aquamacs.org>
> Subject: Re: [Aquamacs-devel] auta-save files cause Aquamacs to hang
> Reply-To: siemsen at ucar.edu, Aquamacs Developers <aquamacs-devel at aquamacs.org
> >
>
> I'm using version "2.0preview2".
>
> My attempt to turn off auto-save didn't work. Given an existing
> large (453789 bytes) file named abc.txt on a remote system, I did
> this:
>
> 1. On my Mac, exited Aquamacs, just to set up state for the test
> 2. On the remote system, manually deleted the leftover auto-save
> file named .#abc.txt, just to set up state for the test
> 3. On my Mac, started Aquamacs
> 4. Did C-x C-f to open the remote file named /Volumes/xxx/abc.txt
> 5. Did M-x auto-save-mode to toggle auto-save off. Aquamacs said
> "Auto-save off (in this buffer)"
> 6. Modified the buffer.
> 7. On the remote system, did "ls -alt" and found
>
> lrwxrwxrwx 1 siemsen datacomm 33 Sep 30 15:19 .#abc.txt -> siemsen at galway.scd.ucar.edu.12194
>
> My Mac is named "galway". So Aquamacs created the auto-save file,
> despite what I did in step 5. This seems to be a bug.
>
> 8. On my Mac, did C-x C-s
> 9. On the remote system, did "ls -alt" and found a newly written
> abc.txt and also .#abc.txt
>
> So Aquamacs didn't delete the auto-save file. This seems to be a
> bug. My delete-auto-save-files variable has the default value of 't'.
>
> 10. On my Mac, restarted Aquamacs.
> 11. Opened the remote file again.
> 12. Tried to modify the buffer. Aquamacs hung with the spinning
> ball of death. I had to use Force Quit to kill it.
>
> I get different behavior if I replace step 10 with "C-x k". If I do
> that, Aquamacs behaves normally in step 12.
>
> BTW, I tried to figure this out, with no luck. The GNU Emacs manual
> says that the names of auto-save files are constructed using the
> contents of auto-save-file-name-transforms. In Aquamacs, that
> variable seems to want to put auto-save files in a directory named /
> var/folders, which doesn't exist on my Mac. I can only assume that
> Aquamacs has it's own mechanism for creating auto-save files, and
> ignores auto-save-file-name-transforms.
>
> -- Pete
>
>
> On Sep 28, 2009, at 5:18 PM, David Reitter wrote:
>
>> What version?
>> Have you tried to turn off auto-save?
>>
>> On Sep 28, 2009, at 5:31 PM, Pete Siemsen wrote:
>>
>>> In my group at work, we share a Linux server that contains
>>> hundreds of files. We have many Windows users in the group, so we
>>> use SAMBA to share the filesystems on the server. I SAMBA-mount
>>> the server's filesystems on my Mac. I have no trouble accessing
>>> the files on the server, using paths that start with '/Volumes/'.
>>>
>>> No problem, it's worked for years, except now I'm trying to stop
>>> using TextMate and start using Aquamacs.
>>>
>>> Aquamacs wants to write auto-save files, with names that start
>>> with '.#', in the same directory as each file being edited.
>>> Aquamacs is supposed to delete the auto-save files whenever I
>>> close the real file. For some reason, it's not happening. The
>>> auto-save files aren't being deleted. When I try to re-edit a
>>> file that has an auto-save file, Aquamacs lets me open it, but as
>>> soon as I try to modify the buffer, Aquamacs hangs. I get the
>>> spinning ball of death and end up having to 'Force Quit'
>>> Aquamacs. I can manually delete the auto-save file, restart
>>> Aquamacs, and edit the real file again.
>>>
>>> -- Pete
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aquamacs.org/pipermail/aquamacs-devel/attachments/20091020/2dddc0b7/attachment-0009.htm>
More information about the Aquamacs-devel
mailing list