<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-family:"Courier New"'>First off, sorry if this is the wrong place to send this.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>I’m attempting to debug a crash in the Atom editor for users of Arch Linux on kernels before 4.6.0. We compile Atom with Clang, and users of old kernels are now reporting that the main native-code component, Electron, is getting SIGILLs. Hand-decompiling (so there might be mistakes) the area near the crash in the core dump, I found a function that looks like:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>void xyzzy(void* addr, size_t len) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>     if(madvise(addr, len, MADV_FREE) != 0)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>           __asm__("ud2"); // We’re crashing on the ud2.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>It doesn’t correspond to any code we’re compiling, however. In Electron and all its dependencies, madvise is only used once, in a completely separate context from the surrounding code. The code looks a lot more like it was generated by Clang than by GCC, though, so I’m suspecting it’s used in some sort of intrinsic or compiler support function?<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>For reference, Atom is structured like:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Atom -> Electron -> Chromium --\<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>            \-----> node.js ------> V8<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>The code surrounding the “xyzzy” function seems to be coming from a file in V8, https://github.com/electron/node/blob/ee8c429deaee0adeeef069c3ad34c0defe53a567/deps/v8/src/base/platform/platform-posix.cc<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>I’m wondering if either a) someone recognizes this off the bat as something Clang uses for some purpose, or b) if someone with more experience with Clang, or the V8 codebase could help with solving? The part where it’s related to the kernel version is what’s really throwing me off... </span></p></div></body></html>