From 29cde917fe6b8f2e669c8bf10b38f640045c83b8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Feb 2014 13:31:33 +0100 Subject: [PATCH] Fix deadlock in SubstitutionGoal We were relying on SubstitutionGoal's destructor releasing the lock, but if a goal is a top-level goal, the destructor won't run in a timely manner since its reference count won't drop to zero. So release it explicitly. Fixes #178. --- src/libstore/build.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index e2115bc80..cec03fee4 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2852,6 +2852,7 @@ void SubstitutionGoal::finished() worker.store.registerValidPath(info2); outputLock->setDeletion(true); + outputLock.reset(); worker.store.markContentsGood(storePath);