mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bannier (JIRA)" <>
Subject [jira] [Created] (MESOS-6325) Boolean member Executor::commandExecutor not always properly initialized
Date Fri, 07 Oct 2016 06:16:21 GMT
Benjamin Bannier created MESOS-6325:

             Summary: Boolean member Executor::commandExecutor not always properly initialized
                 Key: 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,

Result<string> executorPath =
  os::realpath(path::join(slave->flags.launcher_dir, MESOS_EXECUTOR));

if (executorPath.isSome()) {
  commandExecutor =
    strings::contains(info.command().value(), executorPath.get());

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,

This message was sent by Atlassian JIRA

View raw message