mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Klues <>
Subject Re: Review Request 49559: Added ELFIO as bundled dependency in Mesos.
Date Sat, 02 Jul 2016 20:08:56 GMT

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

(Updated July 2, 2016, 8:08 p.m.)

Review request for mesos and Benjamin Mahler.


Uploaded binary diff for `elfio-3.1.tar.gz`

Bugs: MESOS-5767

Repository: mesos


This includes a patch file to ELFIO to fix 2 off-by-one errors in the
parsing of NOTE sections. Patches for these bugs have been submitted
upstream. Details of the patches are below:

1) Fixed off-by-one error in 'name' of add_note() function.

Previously, when assigning 'name' as a string, it's length was
specified using the full length of 'namesz'. However, this length
includes the trailing '\0' of the underlying char[]. This ultimately
causes the C++ string that is created to (incorrectly) contain the
'\0' character as well. This leads to problems where e.g. the
following will return false, even when 'name' itself contains the
string "GNU\0":

  if (name == "GNU") {
    return true;
  return false;

To fix this, we should only include the length of the string minus the
trailing '\0'.

2) Fixed alignment of 'desc' in add_note() function.

The ELF spec specifically lists the alignment of the namez char[] to
be 4 bytes. To quote it:

"Padding is present, if necessary, to ensure 4-byte alignment for the
descriptor. Such padding is not included in namesz."

However, the current implementation sets the alignment to either 4 or
8 bytes depending on the class of the ELF file (CLASS32 or CLASS64).
This commit fixes the alignment to only 4 bytes in all cases.

Diffs (updated)

  3rdparty/CMakeLists.txt 15f3171 
  3rdparty/ bd990cc 
  3rdparty/cmake/Versions.cmake 7b73f8f 
  3rdparty/elfio-3.1.patch PRE-CREATION 
  3rdparty/elfio-3.1.tar.gz PRE-CREATION 
  3rdparty/ 203656c 
  LICENSE eb39f6d 321436b 
  src/ 52d63f2 
  support/ ab9564b 



Made sure `elfio-3.1` appears in `/build` after running `../configure`, `make`.
Made sure `elfio` appears in `/include` of installation folder after `make install`.

This second one is necessary because `stout` relies on elfio in order to function (similar
to how we've done with `picojson.h` in the past).


Kevin Klues

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