[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31981: Fix 'flymake-proc-legacy-flymake' temporary file deletion bug
From: |
Joel Rosdahl |
Subject: |
bug#31981: Fix 'flymake-proc-legacy-flymake' temporary file deletion bug |
Date: |
Tue, 27 Aug 2019 22:35:04 +0200 |
I can reproduce this bug on latest master.
The problem is that if a check command takes a long time, the
following can happen:
1. The user modifies the buffer, making flymake-proc start a process A
which reads from a temporary file T containing the buffer content.
2. Before process A has finished, the user modifies the buffer again,
making flymake-proc start a new process B reading from the same
temporary file T.
3. A is marked as obsolete.
4. When A's sentinel detects that A has died, it runs A's cleanup
function which deletes T.
5. B may fail since T is gone.
Attached is a patch which solves the issue, at least for me: simply
don't run the cleanup function for an obsolete process. This should
work well for checks that use flymake-proc-simple-cleanup or one of
the other cleanup functions defined in flymake-proc.el.
I'm not sure if the fix is appropriate for the general case with a
user-supplied custom cleanup function, though. But I see no other
quick fix for the issue since the name of the temporary file is kept
in a single buffer-local variable and there is no way for the cleanup
function to know that it's being called for an obsolete process.
-- Joel
0001-Fix-flymake-proc-temporary-file-deletion-bug.patch
Description: Text Data
- bug#31981: Fix 'flymake-proc-legacy-flymake' temporary file deletion bug,
Joel Rosdahl <=