You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benno Evers <be...@mesosphere.com> on 2018/05/31 15:47:07 UTC

Review Request 67401: Fixed segfault in libprocess due to order-of-evaluation bug.

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

Review request for mesos, Alexander Rukletsov and Benjamin Mahler.


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


Repository: mesos


Description
-------

Up to C++17, the only ordering constraint on the evaluation of
expressions between synchronization points was that function
arguments shall be evaluated before calling a function.

This could lead to the situation where `std::move(futures)` could be
called before `await(futures.values())`, leading to a function call
on a moved-from object and thus undefined behaviour.


Diffs
-----

  3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 


Diff: https://reviews.apache.org/r/67401/diff/1/


Testing
-------


Thanks,

Benno Evers


Re: Review Request 67401: Fixed segfault in libprocess due to order-of-evaluation bug.

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


Ship it!




Ship It!

- Benjamin Bannier


On May 31, 2018, 5:47 p.m., Benno Evers wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67401/
> -----------------------------------------------------------
> 
> (Updated May 31, 2018, 5:47 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Benjamin Mahler.
> 
> 
> Bugs: MESOS-8970
>     https://issues.apache.org/jira/browse/MESOS-8970
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Up to C++17, the only ordering constraint on the evaluation of
> expressions between synchronization points was that function
> arguments shall be evaluated before calling a function.
> 
> This could lead to the situation where `std::move(futures)` could be
> called before `await(futures.values())`, leading to a function call
> on a moved-from object and thus undefined behaviour.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 
> 
> 
> Diff: https://reviews.apache.org/r/67401/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Benno Evers
> 
>


Re: Review Request 67401: Removed undefined behaviour in libprocess due to order-of-evaluation bug.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67401/#review204125
-----------------------------------------------------------


Ship it!




Thanks for fixing this for me! I remember hearing about this once before.

Can you std::move the vector into await? That way when await is updated to take an rvalue reference it will not need an additional copy?

- Benjamin Mahler


On May 31, 2018, 4:11 p.m., Benno Evers wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67401/
> -----------------------------------------------------------
> 
> (Updated May 31, 2018, 4:11 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Benjamin Mahler.
> 
> 
> Bugs: MESOS-8970
>     https://issues.apache.org/jira/browse/MESOS-8970
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Up to C++17, the only ordering constraint on the evaluation of
> expressions between synchronization points was that function
> arguments shall be evaluated before calling a function.
> 
> This could lead to the situation where `std::move(futures)` could be
> called before `await(futures.values())`, leading to a function call
> on a moved-from object and thus undefined behaviour.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 
> 
> 
> Diff: https://reviews.apache.org/r/67401/diff/1/
> 
> 
> Testing
> -------
> 
> `./libprocess-tests`
> 
> Internal CI run including this fix w/o libprocess segfaults: https://jenkins.mesosphere.com/service/jenkins/job/mesos/job/Mesos_CI-build/3655
> 
> 
> Thanks,
> 
> Benno Evers
> 
>


Re: Review Request 67401: Removed undefined behaviour in libprocess due to order-of-evaluation bug.

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



PASS: Mesos patch 67401 was successfully built and tested.

All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/67401

- Mesos Reviewbot Windows


On May 31, 2018, 4:11 p.m., Benno Evers wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67401/
> -----------------------------------------------------------
> 
> (Updated May 31, 2018, 4:11 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Benjamin Mahler.
> 
> 
> Bugs: MESOS-8970
>     https://issues.apache.org/jira/browse/MESOS-8970
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Up to C++17, the only ordering constraint on the evaluation of
> expressions between synchronization points was that function
> arguments shall be evaluated before calling a function.
> 
> This could lead to the situation where `std::move(futures)` could be
> called before `await(futures.values())`, leading to a function call
> on a moved-from object and thus undefined behaviour.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 
> 
> 
> Diff: https://reviews.apache.org/r/67401/diff/1/
> 
> 
> Testing
> -------
> 
> `./libprocess-tests`
> 
> Internal CI run including this fix w/o libprocess segfaults: https://jenkins.mesosphere.com/service/jenkins/job/mesos/job/Mesos_CI-build/3655
> 
> 
> Thanks,
> 
> Benno Evers
> 
>


Re: Review Request 67401: Removed undefined behaviour in libprocess due to order-of-evaluation bug.

Posted by Benno Evers <be...@mesosphere.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67401/
-----------------------------------------------------------

(Updated May 31, 2018, 4:11 p.m.)


Review request for mesos, Alexander Rukletsov and Benjamin Mahler.


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

Removed undefined behaviour in libprocess due to order-of-evaluation bug.


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


Repository: mesos


Description
-------

Up to C++17, the only ordering constraint on the evaluation of
expressions between synchronization points was that function
arguments shall be evaluated before calling a function.

This could lead to the situation where `std::move(futures)` could be
called before `await(futures.values())`, leading to a function call
on a moved-from object and thus undefined behaviour.


Diffs
-----

  3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 


Diff: https://reviews.apache.org/r/67401/diff/1/


Testing (updated)
-------

`./libprocess-tests`

Internal CI run including this fix w/o libprocess segfaults: https://jenkins.mesosphere.com/service/jenkins/job/mesos/job/Mesos_CI-build/3655


Thanks,

Benno Evers


Re: Review Request 67401: Fixed segfault in libprocess due to order-of-evaluation bug.

Posted by Alexander Rukletsov <ru...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67401/#review204114
-----------------------------------------------------------


Ship it!




Ship It!

- Alexander Rukletsov


On May 31, 2018, 3:47 p.m., Benno Evers wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67401/
> -----------------------------------------------------------
> 
> (Updated May 31, 2018, 3:47 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Benjamin Mahler.
> 
> 
> Bugs: MESOS-8970
>     https://issues.apache.org/jira/browse/MESOS-8970
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Up to C++17, the only ordering constraint on the evaluation of
> expressions between synchronization points was that function
> arguments shall be evaluated before calling a function.
> 
> This could lead to the situation where `std::move(futures)` could be
> called before `await(futures.values())`, leading to a function call
> on a moved-from object and thus undefined behaviour.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/metrics/metrics.cpp e0d0ee4c8d0df66779c7ef296a1a18d988e889b8 
> 
> 
> Diff: https://reviews.apache.org/r/67401/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Benno Evers
> 
>