<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii">
<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;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi folks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">While building openmpi.4.0.0(Optimized debug build), using trunk clang we encountered a crash(assertion failure).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Initially assertion seems trivial:<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal">void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But, narrowing to RC. We discovered “-O3 -enable-partial-inlining” pass which is doing some DebugInfo manipulation, later triggering this.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Reproducibility: <o:p></o:p></p>
<p class="MsoNormal">$ wget <a href="https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2">
https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2</a><o:p></o:p></p>
<p class="MsoNormal">$ tar -xf openmpi-4.0.0<o:p></o:p></p>
<p class="MsoNormal">$ cd openmpi-4.0.0<o:p></o:p></p>
<p class="MsoNormal">$ ./configure --enable-mpi-fortran=no OMPI_CC=/home/sourabh/mirror-upstream/build/release/bin/clang OMPI_CXX=clang++ CXX=clang++ CC=clang CFLAGS="="-g -O3 -mllvm -enable-partial-inlining " CXXFLAGS="-g -O3 -mllvm -enable-partial-inlining"
AR=llvm-ar RANLIB=llvm-ranlib NM=llvm-nm<o:p></o:p></p>
<p class="MsoNormal">$ make -jN<o:p></o:p></p>
<p class="MsoNormal">----CRASH----<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Details of Narrowing:<o:p></o:p></p>
<p class="MsoNormal">$ cd ompi/mca/vprotocol/pessimist<o:p></o:p></p>
<p class="MsoNormal">$ clang -DHAVE_CONFIG_H -I. -I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/private/autogen -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/hwloc/autogen
-I../../../../ompi/mpiext/cuda/c -I../../../.. -I../../../../orte/include -I/home/regressions/openmpi-4.0.0/opal/mca/event/libevent2022/libevent -I/home/regressions/openmpi-4.0.0/opal/mca/event/libevent2022/libevent/include -I/home/regressions/openmpi-4.0.0/opal/mca/hwloc/hwloc201/hwloc/include
-DNDEBUG -g -O3 -mllvm -enable-partial-inlining -finline-functions -fno-strict-aliasing -mcx16 -pthread -MT vprotocol_pessimist_recv.lo -MD -MP -MF .deps/vprotocol_pessimist_recv.Tpo -c vprotocol_pessimist_recv.c -S<o:p></o:p></p>
<p class="MsoNormal">--CRASH—<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Note: Entire application and above file compiling fine if we remove “—enable-partial-inlining”.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I attempted to come-up with a more reduced case but that was in vain. This pass “-partial-inliner” is disabled by default(even at O3) and not much of content or sample test cases as to what this transformation actually do.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ll be filing a BUG, as soon as someone from community confirms this.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks You,<o:p></o:p></p>
<p class="MsoNormal">Sourabh.<o:p></o:p></p>
</div>
</body>
</html>