mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Conway" <>
Subject Review Request 40435: Fixed pointer alignment error in IP::create().
Date Wed, 18 Nov 2015 09:39:54 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for mesos, Benjamin Bannier, Ben Mahler, and Niklas Nielsen.

Bugs: MESOS-3939

Repository: mesos


The previous code took the address of a "struct sockaddr", and then cast the
resulting pointer to "struct sockaddr_storage *". The alignment requirements for
"struct sockaddr_storage *" are more strict than for "struct sockaddr *", and
hence this code produced undefined behavior per ubsan in GCC 5.2.

Along the way, tweak the code to use reinterpret_cast rather than a C-style
cast, and not to unnecessarily cast-away constness.



  3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp 6709f5e7f6233983f389203278a0e42694591230



"make check" on Linux/AMD64 + GCC 5.2 + ubsan; without fix, ubsan reports an error. With fix,
ubsan does not report (this) error.


Neil Conway

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message