port & root

Rainer Müller raimue at macports.org
Thu Apr 5 17:25:10 UTC 2018


On 2018-04-05 19:14, Joshua Root wrote:
> My guess is that this is a bug in Tcl's file command. Deleting a
> nonexistent file is not supposed to be considered an error. But by
> starting two instances of port(1) at the same time, a race condition
> arises. The 'file delete' command probably checks whether the file
> exists, returns TCL_OK if not, and then attempts to delete the file. If
> the file has been deleted by the other running instance (or indeed
> anything else) between these two steps, then the actual deletion fails,
> and it incorrectly returns an error.

You are right. We hit a race condition in the implementation of 'file
delete' in Tcl.

It is missing another check for ENOENT here, as done in line 381:

https://github.com/macports/macports-base/blob/4b13207d9f7f9aba1cc9eba266b3071318637a8c/vendor/tcl8.5.19/generic/tclFCmd.c#L415


@l2dy,
Is our Travis job executing multiple 'port lint' commands in parallel?
Then this is the same cause.

Rainer


More information about the macports-dev mailing list