You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2016/12/16 23:11:19 UTC

Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

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

Review request for mesos and Benjamin Hindman.


Repository: mesos


Description
-------

process::Loop is a std::enable_shared_from_this. Using stack-allocated
instances of classes derived from std::enable_shared_from_this is
undefined behavior.

Prevent creation of stack-allocated process::Loop instances by hiding
the constructors and providing a factory method to be used instead.


Diffs
-----

  3rdparty/libprocess/include/process/loop.hpp b35f7e6cc2da9d1c840656f80410756ba80dbc48 

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


Testing
-------

Observed only known test failures with:

* `make check` (OS X, clang-trunk, w/optimizations, SSL)
* `make check` and `ROOT` tests on various Linux configurations in internal CI


Thanks,

Benjamin Bannier


Re: Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

Posted by Benjamin Hindman <be...@berkeley.edu>.

> On Jan. 8, 2017, 7:16 a.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/include/process/loop.hpp, line 132
> > <https://reviews.apache.org/r/54825/diff/1/?file=1588281#file1588281line132>
> >
> >     Why not use std::make_shared?

Never mind! `std::make_shared` won't have access to the constructor. Thanks Benjamin!


- Benjamin


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


On Dec. 16, 2016, 11:11 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54825/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2016, 11:11 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> process::Loop is a std::enable_shared_from_this. Using stack-allocated
> instances of classes derived from std::enable_shared_from_this is
> undefined behavior.
> 
> Prevent creation of stack-allocated process::Loop instances by hiding
> the constructors and providing a factory method to be used instead.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/loop.hpp b35f7e6cc2da9d1c840656f80410756ba80dbc48 
> 
> Diff: https://reviews.apache.org/r/54825/diff/
> 
> 
> Testing
> -------
> 
> Observed only known test failures with:
> 
> * `make check` (OS X, clang-trunk, w/optimizations, SSL)
> * `make check` and `ROOT` tests on various Linux configurations in internal CI
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54825/#review160826
-----------------------------------------------------------


Fix it, then Ship it!




I'll fix the issue and get it committed, thanks Benjamin!


3rdparty/libprocess/include/process/loop.hpp (line 132)
<https://reviews.apache.org/r/54825/#comment232055>

    Why not use std::make_shared?


- Benjamin Hindman


On Dec. 16, 2016, 11:11 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54825/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2016, 11:11 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> process::Loop is a std::enable_shared_from_this. Using stack-allocated
> instances of classes derived from std::enable_shared_from_this is
> undefined behavior.
> 
> Prevent creation of stack-allocated process::Loop instances by hiding
> the constructors and providing a factory method to be used instead.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/loop.hpp b35f7e6cc2da9d1c840656f80410756ba80dbc48 
> 
> Diff: https://reviews.apache.org/r/54825/diff/
> 
> 
> Testing
> -------
> 
> Observed only known test failures with:
> 
> * `make check` (OS X, clang-trunk, w/optimizations, SSL)
> * `make check` and `ROOT` tests on various Linux configurations in internal CI
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54825/#review159538
-----------------------------------------------------------



Patch looks great!

Reviews applied: [54825]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On Dec. 16, 2016, 11:11 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54825/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2016, 11:11 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> process::Loop is a std::enable_shared_from_this. Using stack-allocated
> instances of classes derived from std::enable_shared_from_this is
> undefined behavior.
> 
> Prevent creation of stack-allocated process::Loop instances by hiding
> the constructors and providing a factory method to be used instead.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/loop.hpp b35f7e6cc2da9d1c840656f80410756ba80dbc48 
> 
> Diff: https://reviews.apache.org/r/54825/diff/
> 
> 
> Testing
> -------
> 
> Observed only known test failures with:
> 
> * `make check` (OS X, clang-trunk, w/optimizations, SSL)
> * `make check` and `ROOT` tests on various Linux configurations in internal CI
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54825/#review160888
-----------------------------------------------------------



Patch looks great!

Reviews applied: [54825]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 9, 2017, 11:06 a.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54825/
> -----------------------------------------------------------
> 
> (Updated Jan. 9, 2017, 11:06 a.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> process::Loop is a std::enable_shared_from_this. Using stack-allocated
> instances of classes derived from std::enable_shared_from_this is
> undefined behavior.
> 
> Prevent creation of stack-allocated process::Loop instances by hiding
> the constructors and providing a factory method to be used instead.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/loop.hpp 53f62439752a6eb7cf870022e4965c9261fc3ba6 
> 
> Diff: https://reviews.apache.org/r/54825/diff/
> 
> 
> Testing
> -------
> 
> Observed only known test failures with:
> 
> * `make check` (OS X, clang-trunk, w/optimizations, SSL)
> * `make check` and `ROOT` tests on various Linux configurations in internal CI
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 54825: Made sure process::Loop instances can only be created as shared_ptrs.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54825/
-----------------------------------------------------------

(Updated Jan. 9, 2017, 12:06 p.m.)


Review request for mesos and Benjamin Hindman.


Changes
-------

Rebased.


Repository: mesos


Description
-------

process::Loop is a std::enable_shared_from_this. Using stack-allocated
instances of classes derived from std::enable_shared_from_this is
undefined behavior.

Prevent creation of stack-allocated process::Loop instances by hiding
the constructors and providing a factory method to be used instead.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/loop.hpp 53f62439752a6eb7cf870022e4965c9261fc3ba6 

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


Testing
-------

Observed only known test failures with:

* `make check` (OS X, clang-trunk, w/optimizations, SSL)
* `make check` and `ROOT` tests on various Linux configurations in internal CI


Thanks,

Benjamin Bannier