You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by James Peach <jp...@apache.org> on 2017/02/08 23:34:55 UTC

Review Request 56466: Use the stout ELF parser to collect Linux rootfs files.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/
-----------------------------------------------------------

Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.


Bugs: MESOS-7060
    https://issues.apache.org/jira/browse/MESOS-7060


Repository: mesos


Description
-------

The dependencies for the programs we need in the Linux root
filesystem vary over time and across distributions. Since stout
has support for parsing the library dependencies of ELF binaries,
use this to collect the necessary dependencies when constructing
a root filesystem for the tests.


Diffs
-----

  src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 
  src/tests/containerizer/rootfs.hpp 9648638c1d4b1f1c49708e058e9b930c5ae32138 
  src/tests/containerizer/rootfs.cpp f11f126fa4f3130b6778bfe7e7d0f025a638f06e 

Diff: https://reviews.apache.org/r/56466/diff/


Testing
-------

make check (Fedora, Ubuntu)

```
vagrant@vagrant-ubuntu-trusty-64:~/mesos/build/src$ sudo ./mesos-tests --gtest_filter=*IsolatorTest.ROOT_*
...
[==========] 64 tests from 10 test cases ran. (85512 ms total)
[  PASSED  ] 64 tests.
```


Thanks,

James Peach


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by Jiang Yan Xu <ya...@jxu.me>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/#review164873
-----------------------------------------------------------


Fix it, then Ship it!





src/linux/ldd.cpp (lines 85 - 88)
<https://reviews.apache.org/r/56466/#comment236710>

    IIUC we always need the ELF interpreter. It just so happens that on RHEL ld cache resolves ld-linux-x86-64.so.2 to /lib64/ld-linux-x86-64.so.2 which by accident is also the interpret path. So it's not that Ubuntu is special but we were just lucky on RHEL?
    
    If so, I'd remove the statement about Ubuntu because there may be other distros that behave in like Ubuntu and not RHEL.


- Jiang Yan Xu


On Feb. 8, 2017, 3:51 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56466/
> -----------------------------------------------------------
> 
> (Updated Feb. 8, 2017, 3:51 p.m.)
> 
> 
> Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7060
>     https://issues.apache.org/jira/browse/MESOS-7060
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The ELF interpreter (ie. program loader) path is not necessarily
> specified in the ELF dependencies section but we still need
> to capture is as a dependency of an executable program.
> 
> 
> Diffs
> -----
> 
>   src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 
> 
> Diff: https://reviews.apache.org/r/56466/diff/
> 
> 
> Testing
> -------
> 
> make check (Fedora, Ubuntu)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/
-----------------------------------------------------------

(Updated Feb. 9, 2017, 8:03 p.m.)


Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.


Bugs: MESOS-7060
    https://issues.apache.org/jira/browse/MESOS-7060


Repository: mesos


Description
-------

The ELF interpreter (ie. program loader) path is not necessarily
specified in the ELF dependencies section but we still need
to capture is as a dependency of an executable program.


Diffs (updated)
-----

  src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 

Diff: https://reviews.apache.org/r/56466/diff/


Testing
-------

make check (Fedora, Ubuntu)


Thanks,

James Peach


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by James Peach <jp...@apache.org>.

> On Feb. 9, 2017, 7:21 p.m., Jiang Yan Xu wrote:
> > src/linux/ldd.cpp, lines 85-88
> > <https://reviews.apache.org/r/56466/diff/3/?file=1628611#file1628611line85>
> >
> >     I suggest the following and can do it while committing but let me know if there's an error in it.
> >     
> >     ```
> >           // If this ELF object has an interpreter (e.g. ld-linux-x86-64.so.2), 
> >           // inspect that too. We need both to be able to run an executable program.
> >           // NOTE: The same object may be specified as a dependency too but on some
> >           // systems (e.g. Ubuntu), the exact path of the two can differ even though
> >           // they link to the the same file (see MESOS-7060). We however need the
> >           // exact path specified in the interpreter section to run the executable.
> >     ```

I agree that this is an improvement. Thanks!


- James


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/#review164984
-----------------------------------------------------------


On Feb. 9, 2017, 5:21 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56466/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 5:21 p.m.)
> 
> 
> Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7060
>     https://issues.apache.org/jira/browse/MESOS-7060
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The ELF interpreter (ie. program loader) path is not necessarily
> specified in the ELF dependencies section but we still need
> to capture is as a dependency of an executable program.
> 
> 
> Diffs
> -----
> 
>   src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 
> 
> Diff: https://reviews.apache.org/r/56466/diff/
> 
> 
> Testing
> -------
> 
> make check (Fedora, Ubuntu)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by Jiang Yan Xu <ya...@jxu.me>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/#review164984
-----------------------------------------------------------


Ship it!





src/linux/ldd.cpp (lines 85 - 88)
<https://reviews.apache.org/r/56466/#comment236820>

    I suggest the following and can do it while committing but let me know if there's an error in it.
    
    ```
          // If this ELF object has an interpreter (e.g. ld-linux-x86-64.so.2), 
          // inspect that too. We need both to be able to run an executable program.
          // NOTE: The same object may be specified as a dependency too but on some
          // systems (e.g. Ubuntu), the exact path of the two can differ even though
          // they link to the the same file (see MESOS-7060). We however need the
          // exact path specified in the interpreter section to run the executable.
    ```


- Jiang Yan Xu


On Feb. 9, 2017, 9:21 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56466/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 9:21 a.m.)
> 
> 
> Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7060
>     https://issues.apache.org/jira/browse/MESOS-7060
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The ELF interpreter (ie. program loader) path is not necessarily
> specified in the ELF dependencies section but we still need
> to capture is as a dependency of an executable program.
> 
> 
> Diffs
> -----
> 
>   src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 
> 
> Diff: https://reviews.apache.org/r/56466/diff/
> 
> 
> Testing
> -------
> 
> make check (Fedora, Ubuntu)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/
-----------------------------------------------------------

(Updated Feb. 9, 2017, 5:21 p.m.)


Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.


Bugs: MESOS-7060
    https://issues.apache.org/jira/browse/MESOS-7060


Repository: mesos


Description
-------

The ELF interpreter (ie. program loader) path is not necessarily
specified in the ELF dependencies section but we still need
to capture is as a dependency of an executable program.


Diffs (updated)
-----

  src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 

Diff: https://reviews.apache.org/r/56466/diff/


Testing
-------

make check (Fedora, Ubuntu)


Thanks,

James Peach


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/
-----------------------------------------------------------

(Updated Feb. 8, 2017, 11:51 p.m.)


Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.


Bugs: MESOS-7060
    https://issues.apache.org/jira/browse/MESOS-7060


Repository: mesos


Description
-------

The ELF interpreter (ie. program loader) path is not necessarily
specified in the ELF dependencies section but we still need
to capture is as a dependency of an executable program.


Diffs
-----

  src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 

Diff: https://reviews.apache.org/r/56466/diff/


Testing (updated)
-------

make check (Fedora, Ubuntu)


Thanks,

James Peach


Re: Review Request 56466: Capture ELF interpreters in the ldd utility.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56466/
-----------------------------------------------------------

(Updated Feb. 8, 2017, 11:50 p.m.)


Review request for mesos, Jie Yu, Kevin Klues, and Jiang Yan Xu.


Changes
-------

Split patch.


Summary (updated)
-----------------

Capture ELF interpreters in the ldd utility.


Bugs: MESOS-7060
    https://issues.apache.org/jira/browse/MESOS-7060


Repository: mesos


Description (updated)
-------

The ELF interpreter (ie. program loader) path is not necessarily
specified in the ELF dependencies section but we still need
to capture is as a dependency of an executable program.


Diffs (updated)
-----

  src/linux/ldd.cpp dd5c9c55560dc2895763141393fdaf97be66a5a8 

Diff: https://reviews.apache.org/r/56466/diff/


Testing
-------

make check (Fedora, Ubuntu)

```
vagrant@vagrant-ubuntu-trusty-64:~/mesos/build/src$ sudo ./mesos-tests --gtest_filter=*IsolatorTest.ROOT_*
...
[==========] 64 tests from 10 test cases ran. (85512 ms total)
[  PASSED  ] 64 tests.
```


Thanks,

James Peach