Benjamin Bannier created MESOS-6325:
---------------------------------------
Summary: Boolean member Executor::commandExecutor not always
properly initialized
Key: MESOS-6325
URL: https://issues.apache.org/jira/browse/MESOS-6325
Project: Mesos
Issue Type: Bug
Components: slave
Reporter: Benjamin Bannier
The constructor of {{Executor}} in {{src/slave/slave}} does not make sure that
the member variable {{commandExecutor}} is always set. The following logic is
used to determine its value,
{code}
Result<string> executorPath =
os::realpath(path::join(slave->flags.launcher_dir, MESOS_EXECUTOR));
if (executorPath.isSome()) {
commandExecutor =
strings::contains(info.command().value(), executorPath.get());
}
{code}
Should we fail to determine the realpath of the mesos executor,
{{commandExecutor}} will not be set. Since {{commandExecutor}} is a scalar
field, no default initialization happens and its value will be random memory
(which might often evaluate to {{true}}).
We need to make sure the member variable is set on all branches. Looking at the
code it seems we might be able to just explicitly assert some {{executorPath}}.
This was pointed out by coverity,
https://scan5.coverity.com/reports.htm#v10074/p10429/fileInstanceId=100298128&defectInstanceId=28784922&mergedDefectId=1373526.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)