1.9.2

Joshua Root jmr at macports.org
Thu Aug 5 07:25:35 PDT 2010


On 2010-8-5 23:24 , Rainer Müller wrote:
> What Ryan describes is also something I am doing sometimes.
> 
> As I see it the problem is not about general modifications to the
> registry, as sqlite is able to use locking for that itself.

Well, it kind of is. It's all about looking at what ports are active or
installed, and then having some other process change that state before
you act on it. Classic TOCTOU error.

> The problem with activate/deactivate was introduced by the fact that
> activation/deactivation is now being run from the registry Portfile
> making the statefile lock ineffective for another instance working on
> the Portfile in the tree.

That may have made the problem more noticeable in some situations, but
it didn't cause it.

> I don't think the solution for this is a general lock so only one port
> instance can run.

It's the only simple, correct solution that I can see.

> So in my opinion the problem is that upgrade releases the lock on the
> statefile too early before the version swap is finished. Either it needs
> to keep that lock until after that is done or we need a per-port locking
> mechanism for the registry.

This is the finer-grained approach I referred to, with all the usual fun
of avoiding deadlocks and so forth.

- Josh


More information about the macports-dev mailing list