GNU bug report logs - #10470
MSYS: race in directory access?

Previous Next

Package: automake;

Reported by: Peter Rosin <peda <at> lysator.liu.se>

Date: Mon, 9 Jan 2012 23:09:01 UTC

Severity: minor

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 10470 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: Peter Rosin <peda <at> lysator.liu.se>, 10470 <at> debbugs.gnu.org
Subject: Re: bug#10470: MSYS: race in directory access?
Date: Tue, 10 Jan 2012 06:02:11 -0700
[Message part 1 (text/plain, inline)]
On 01/10/2012 05:44 AM, Stefano Lattarini wrote:
> On 01/10/2012 12:35 PM, Peter Rosin wrote:
>> Peter Rosin skrev 2012-01-10 11:12:
>>> Stefano Lattarini skrev 2012-01-10 10:50:
>>>> [2] Now that I think of it, my knee-jerk guess is that the "( sleep 1 ) &"
>>>>     put in configure by AM_SANITY_CHECK is the likely culprit.

It IS the culprit.  Use of a directory as the cwd _IS_ what prevents
removal of said directory.

> Thanks for tracking this down.  So the question now becomes: why doesn't
> the trick with background processes work on MSYS?  Does maybe MSYS lack
> proper emulation of POSIX-ish PIDs?  If that is the case, can we easily
> work around that in our situation?

Background processes _do_ work, the problem here is that you cannot
rmdir an in-use directory.  So as long as the background process still
exists, the directory is still in use.

But that analysis points out what should be a valid workaround: instead
of doing '(sleep 1)&', do '(cd somewhere/safe; sleep 1)&'.  Then the cwd
of the sleep process is no longer tied to a directory that you plan on
removing, so you no longer have to wait for that sleep process to exit.
 As for what somewhere/safe should be, $(abs_builddir) is probably
reasonable.

> As a last resort, we might enable this suboptimal-but-safer behaviour
> only when the build system is recognized to be MinGW/MSYS...

Nah, doing a cd to somewhere safe before sleeping in the background
should be non-invasive and appropriate for all platforms.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 13 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.