Skip to content

Commit c3b6e7b

Browse files
delrothmweinelt
authored andcommitted
queue runner: fix nullptr deref on build exception after releasing a machine reservation
1 parent c60e795 commit c3b6e7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hydra-queue-runner/builder.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ void State::builder(MachineReservation::ptr reservation)
3737

3838
try {
3939
auto destStore = getDestStore();
40+
// Might release the reservation.
4041
res = doBuildStep(destStore, reservation, activeStep);
4142
} catch (std::exception & e) {
4243
printMsg(lvlError, "uncaught exception building ‘%s’ on ‘%s’: %s",
43-
localStore->printStorePath(reservation->step->drvPath),
44-
reservation->machine->sshName,
44+
localStore->printStorePath(activeStep->step->drvPath),
45+
reservation ? reservation->machine->sshName : std::string("(no machine)"),
4546
e.what());
4647
}
4748
}

0 commit comments

Comments
 (0)