----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54996/#review160279 -----------------------------------------------------------
3rdparty/stout/include/stout/os/linux.hpp (lines 76 - 77) <https://reviews.apache.org/r/54996/#comment231379> `Stack` is also used in src/linux/ns.hpp. We need to update there as well. Would you mind running a make check (or sudo make check) after applying this patch? That'll expose the error. I would probably move all the allocation/deallocation logic to `os::Stack` so that we don't have to impl this multiple times. ``` class Stack { public: // Allocate a stack. static Try<Stack> create(size_t size); // Explicitly free the stack. The destructor // won't free the allocated stack. void deallocate(); private: explicit Stack(size_t size); size_t size; char* address; }; ``` - Jie Yu On Dec. 22, 2016, 9:24 p.m., Aaron Wood wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54996/ > ----------------------------------------------------------- > > (Updated Dec. 22, 2016, 9:24 p.m.) > > > Review request for mesos and Jie Yu. > > > Bugs: MESOS-6835 > https://issues.apache.org/jira/browse/MESOS-6835 > > > Repository: mesos > > > Description > ------- > > Currently in the Linux launcher when the stack is allocated and prepared for > a call to clone() it is not properly aligned. This is not an issue for x86 or > x64 but for ARM64/AArch64 it is because of the requirement of having the > stack aligned to a 16 byte boundary. While x86 and x64 also expect the stack > to have a 16 byte aligned stack, it is not enforced. An explanation of the > stack and requirements for ARM64 can be found here > http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf > (specifically section 5.2.2.1 that says SP mod 16 = 0. The stack must be > quad-word aligned.) > > Additionally, the way that the stack is currently allocated and passed to > clone() accidentally chops off one entry, making a stack overflow using those > missing 8 bytes a possibility. Fixing this while aligning the memory will fix > both the issue of the stack overflow issue as well as the SIGBUS crash. > > > Diffs > ----- > > 3rdparty/stout/include/stout/os/linux.hpp 530f1a55b > > Diff: https://reviews.apache.org/r/54996/diff/ > > > Testing > ------- > > Built Mesos from source and am currently running it in a test cluster. > Launched both Docker and Mesos tasks via Marathon without any resulting crash > (initial crash only happened with Mesos containerizer + linux_launcher, not > with the posix_launcher). > > > Thanks, > > Aaron Wood > >
