<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=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;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thank You for suggestion Adrian!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Generated reproducer for the crash using clang reproducer and CReduce.
<o:p></o:p></p>
<p class="MsoNormal">::Attachment:: C file.<o:p></o:p></p>
<p class="MsoNormal">NIT: some clean up is done on this file just to silent some compiler warnings(like implicit declaration etc.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Crash can be reproduced using above test case with following commandline:<o:p></o:p></p>
<p class="MsoNormal">$clang -g -O3 -mllvm –enable-partial-inlining creducegenerated-cleaned.c -c<o:p></o:p></p>
<p class="MsoNormal">---CRASH---<o:p></o:p></p>
<p class="MsoNormal">$clang -g -O3 creducegenerated-cleaned.c -c<o:p></o:p></p>
<p class="MsoNormal">Working fine.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Or you may also try as:<o:p></o:p></p>
<p class="MsoNormal">$opt -partial-inliner creduce-O3.ll -S | llc >/dev/null<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">Thank You,<o:p></o:p></p>
<p class="MsoNormal">Sourabh.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Adrian Prantl <aprantl@apple.com> <br>
<b>Sent:</b> Friday, November 13, 2020 6:18 AM<br>
<b>To:</b> Tomar, Sourabh Singh <SourabhSingh.Tomar@amd.com><br>
<b>Cc:</b> llvm-dev@lists.llvm.org; Vedant <vsk@apple.com><br>
<b>Subject:</b> Re: [DebugInfo]Crash during building openmpi4.0.0<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<p class="MsoNormal">A good way to start is to let Clang generate a crash reproducer, then you have a single file on which to run delta or creduce on. Once you have a reduced testcase, we can try and help you figure out what is triggering the assertion.
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- adrian<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Nov 12, 2020, at 9:02 AM, Tomar, Sourabh Singh <<a href="mailto:SourabhSingh.Tomar@amd.com">SourabhSingh.Tomar@amd.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi folks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<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>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Initially assertion seems trivial:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[…]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[…]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<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>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Reproducibility:<span class="apple-converted-space"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$ wget<span class="apple-converted-space"> </span><a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdownload.open-mpi.org%2Frelease%2Fopen-mpi%2Fv4.0%2Fopenmpi-4.0.0.tar.bz2&data=04%7C01%7CSourabhSingh.Tomar%40amd.com%7C599946b75b0e476fd93408d8876dbd74%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408252682837448%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=PLf5BzKSwoyMv2KqMIYFpzFksn%2FbR0F%2FUv9VhkMvHvA%3D&reserved=0"><span style="color:#0563C1">https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2</span></a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$ tar -xf openmpi-4.0.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$ cd openmpi-4.0.0<o:p></o:p></p>
</div>
<div>
<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>
</div>
<div>
<p class="MsoNormal">$ make -jN<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">----CRASH----<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Details of Narrowing:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$ cd ompi/mca/vprotocol/pessimist<o:p></o:p></p>
</div>
<div>
<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>
</div>
<div>
<p class="MsoNormal">--CRASH—<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Note: Entire application and above file compiling fine if we remove “—enable-partial-inlining”.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<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>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I’ll be filing a BUG, as soon as someone from community confirms this.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks You,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Sourabh.<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>