Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-22 Thread Alexander Rukletsov

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

(Updated Dec. 22, 2017, 6:41 p.m.)


Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.


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


Repository: mesos


Description (updated)
---

Dereferencing a pointer cast from a different type of pointer
violates the so-called "strict aliasing" rule, which is undefined
behaviour and might lead to bugs when compiler optimizations are
enabled.

For more information on this topic, see
https://blog.regehr.org/archives/959
http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html


Diffs
-

  src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 


Diff: https://reviews.apache.org/r/64686/diff/3/


Testing
---

make check on Mac OS 10.11.6 and various Linux distros


Thanks,

Alexander Rukletsov



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-22 Thread Michael Park

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


Ship it!




Ship It!

- Michael Park


On Dec. 22, 2017, 5:42 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 22, 2017, 5:42 a.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Dereferencing a pointer cast from a different type of pointer
> violates the so-called “strict aliasing” rule, which is undefined
> behaviour and might lead to bugs when compiler optimizations are
> enabled.
> 
> For more information on this topic, see
> https://blog.regehr.org/archives/959
> http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/3/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-22 Thread Alexander Rukletsov

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

(Updated Dec. 22, 2017, 1:42 p.m.)


Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.


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


Repository: mesos


Description
---

Dereferencing a pointer cast from a different type of pointer
violates the so-called “strict aliasing” rule, which is undefined
behaviour and might lead to bugs when compiler optimizations are
enabled.

For more information on this topic, see
https://blog.regehr.org/archives/959
http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html


Diffs (updated)
-

  src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 


Diff: https://reviews.apache.org/r/64686/diff/3/

Changes: https://reviews.apache.org/r/64686/diff/2-3/


Testing
---

make check on Mac OS 10.11.6 and various Linux distros


Thanks,

Alexander Rukletsov



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-22 Thread Alexander Rukletsov


> On Dec. 21, 2017, 8 p.m., Benjamin Bannier wrote:
> > src/linux/ns.cpp
> > Line 397 (original), 397-399 (patched)
> > 
> >
> > Why do we put `struct` here? This is C++ (and the `memcpy` fits on a 
> > single line w/o it).
> > 
> > Not yours, but we should probably also include `sys/socket.h` for 
> > `ucred` in this file.

See https://reviews.apache.org/r/64807/


> On Dec. 21, 2017, 8 p.m., Benjamin Bannier wrote:
> > src/linux/ns.cpp
> > Line 455 (original), 459 (patched)
> > 
> >
> > `struct`?

See https://reviews.apache.org/r/64807/


> On Dec. 21, 2017, 8 p.m., Benjamin Bannier wrote:
> > src/linux/ns.cpp
> > Lines 472 (patched)
> > 
> >
> > `struct`?

See https://reviews.apache.org/r/64807/


- Alexander


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


On Dec. 22, 2017, 1:39 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 22, 2017, 1:39 p.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Dereferencing a pointer cast from a different type of pointer
> violates the so-called “strict aliasing” rule, which is undefined
> behaviour and might lead to bugs when compiler optimizations are
> enabled.
> 
> For more information on this topic, see
> https://blog.regehr.org/archives/959
> http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/2/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-22 Thread Alexander Rukletsov

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

(Updated Dec. 22, 2017, 1:39 p.m.)


Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.


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


Repository: mesos


Description (updated)
---

Dereferencing a pointer cast from a different type of pointer
violates the so-called “strict aliasing” rule, which is undefined
behaviour and might lead to bugs when compiler optimizations are
enabled.

For more information on this topic, see
https://blog.regehr.org/archives/959
http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html


Diffs
-

  src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 


Diff: https://reviews.apache.org/r/64686/diff/2/


Testing
---

make check on Mac OS 10.11.6 and various Linux distros


Thanks,

Alexander Rukletsov



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-21 Thread Mesos Reviewbot Windows

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



PASS: Mesos patch 64686 was successfully built and tested.

Reviews applied: `['64685', '64686']`

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

- Mesos Reviewbot Windows


On Dec. 21, 2017, 7:42 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 21, 2017, 7:42 p.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/2/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-21 Thread Benjamin Bannier

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


Fix it, then Ship it!




Thanks for the updated patch Alex, for me this version is much clearer.


src/linux/ns.cpp
Line 397 (original), 397-399 (patched)


Why do we put `struct` here? This is C++ (and the `memcpy` fits on a single 
line w/o it).

Not yours, but we should probably also include `sys/socket.h` for `ucred` 
in this file.



src/linux/ns.cpp
Line 455 (original), 459 (patched)


`struct`?



src/linux/ns.cpp
Lines 472 (patched)


`struct`?


- Benjamin Bannier


On Dec. 21, 2017, 8:42 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 21, 2017, 8:42 p.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/2/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-21 Thread Alexander Rukletsov

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

(Updated Dec. 21, 2017, 7:42 p.m.)


Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.


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


Repository: mesos


Description
---

See summary.


Diffs (updated)
-

  src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 


Diff: https://reviews.apache.org/r/64686/diff/2/

Changes: https://reviews.apache.org/r/64686/diff/1-2/


Testing
---

make check on Mac OS 10.11.6 and various Linux distros


Thanks,

Alexander Rukletsov



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-19 Thread Armand Grillet

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


Ship it!




Ship It!

- Armand Grillet


On Dec. 18, 2017, 7:06 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 18, 2017, 7:06 p.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/1/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-18 Thread Mesos Reviewbot Windows

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



PASS: Mesos patch 64686 was successfully built and tested.

Reviews applied: `['64685', '64686']`

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

- Mesos Reviewbot Windows


On Dec. 18, 2017, 7:06 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64686/
> ---
> 
> (Updated Dec. 18, 2017, 7:06 p.m.)
> 
> 
> Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.
> 
> 
> Bugs: MESOS-6616
> https://issues.apache.org/jira/browse/MESOS-6616
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
> 
> 
> Diff: https://reviews.apache.org/r/64686/diff/1/
> 
> 
> Testing
> ---
> 
> make check on Mac OS 10.11.6 and various Linux distros
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Review Request 64686: Fixed the type-punned pointer and strict aliasing issue.

2017-12-18 Thread Alexander Rukletsov

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

Review request for mesos, Armand Grillet, Benjamin Bannier, and Michael Park.


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


Repository: mesos


Description
---

See summary.


Diffs
-

  src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 


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


Testing
---

make check on Mac OS 10.11.6 and various Linux distros


Thanks,

Alexander Rukletsov