I got this weird failure:
error: Failed to start domain simple
error: internal error cannot mix caller fds with blocking execution
and tracked it down to a use-after-free - virCommandSetOutputFD
was storing the address of a stack-local variable, which then
went out of scope before the virCommandRun that dereferenced it.
Bug introduced in commit
451cfd05 (0.9.2).
* src/lxc/lxc_driver.c (lxcBuildControllerCmd): Move log fd
registration...
(lxcVmStart): ...to caller.
char **veths,
int *ttyFDs,
size_t nttyFDs,
- int logfile,
int handshakefd)
{
size_t i;
}
virCommandPreserveFD(cmd, handshakefd);
- virCommandSetOutputFD(cmd, &logfile);
- virCommandSetErrorFD(cmd, &logfile);
return cmd;
cleanup:
vm,
nveths, veths,
ttyFDs, nttyFDs,
- logfd, handshakefds[1])))
+ handshakefds[1])))
goto cleanup;
+ virCommandSetOutputFD(cmd, &logfd);
+ virCommandSetErrorFD(cmd, &logfd);
/* Log timestamp */
if ((timestamp = virTimestamp()) == NULL) {