Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5CE33200BDA for ; Tue, 13 Dec 2016 20:44:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5B6A2160B23; Tue, 13 Dec 2016 19:44:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A4554160B07 for ; Tue, 13 Dec 2016 20:43:59 +0100 (CET) Received: (qmail 85236 invoked by uid 500); 13 Dec 2016 19:43:58 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 85205 invoked by uid 99); 13 Dec 2016 19:43:58 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2016 19:43:58 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 49ADA2DA7B3; Tue, 13 Dec 2016 19:43:57 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3933018335619850384==" MIME-Version: 1.0 Subject: Re: Review Request 53791: Use the stout ELF parser to collect Linux rootfs files. From: Benjamin Bannier To: Jie Yu , Kevin Klues , Jiang Yan Xu , Gilbert Song Cc: Benjamin Bannier , Mesos ReviewBot , James Peach , mesos Date: Tue, 13 Dec 2016 19:43:57 -0000 Message-ID: <20161213194357.17251.20516@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Benjamin Bannier X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/53791/ X-Sender: Benjamin Bannier References: <20161213101336.17252.65775@reviews.apache.org> In-Reply-To: <20161213101336.17252.65775@reviews.apache.org> X-ReviewBoard-Diff-For: src/tests/containerizer/rootfs.cpp Reply-To: Benjamin Bannier X-ReviewRequest-Repository: mesos archived-at: Tue, 13 Dec 2016 19:44:00 -0000 --===============3933018335619850384== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Dec. 13, 2016, 11:13 a.m., Benjamin Bannier wrote: > > src/linux/ldd.cpp, lines 82-83 > > > > > > Let's move this up right after the check `needed.contains(path)`. > > > > Right now in pathological cases like e.g., a`libA` depending on `libB`, and `libB` depending on `libA`, we would recurse indefinitely. > > James Peach wrote: > Adding the path to the `needed` set means that we need the path and have already calculated the dependencies for that path. If we add a path before having all its dependencies, we would return early in the `needed.contains(path)` check. An entry in `needed` is the only indication on whether we have already visited a node in the dependency graph (which is not necessarily a tree). If you do not add `path` to `needed` before recursing into `collectDependencies`, `path` might be visited again as a dependency in pathological cases involving cyclic shared library dependencies (which the loader might be fine with). In such a case this code would recurse indefinitely. It looks like a fix might be to add `path` to `needed` after you have found that it currently is not in `needed`, but before you recurse. - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53791/#review158971 ----------------------------------------------------------- On Dec. 13, 2016, 7:34 p.m., James Peach wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/53791/ > ----------------------------------------------------------- > > (Updated Dec. 13, 2016, 7:34 p.m.) > > > Review request for mesos, Gilbert Song, Jie Yu, Kevin Klues, and Jiang Yan Xu. > > > Bugs: MESOS-6588 > https://issues.apache.org/jira/browse/MESOS-6588 > > > 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/Makefile.am a4c03c2b918816e6dd8872d37e5208f055619c47 > src/tests/containerizer/rootfs.hpp 6bc3835cbb62536ec933ef38c9e15138b8611e5f > src/tests/containerizer/rootfs.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/53791/diff/ > > > Testing > ------- > > sudo make check (Fedora 24) > > > Thanks, > > James Peach > > --===============3933018335619850384==--