Tomar, Sourabh Singh via llvm-dev
2020-Nov-12 17:02 UTC
[llvm-dev] [DebugInfo]Crash during building openmpi4.0.0
Hi folks, While building openmpi.4.0.0(Optimized debug build), using trunk clang we encountered a crash(assertion failure). Initially assertion seems trivial: [...] void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed. [...] But, narrowing to RC. We discovered "-O3 -enable-partial-inlining" pass which is doing some DebugInfo manipulation, later triggering this. Reproducibility: $ wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2 $ tar -xf openmpi-4.0.0 $ cd openmpi-4.0.0 $ ./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 $ make -jN ----CRASH---- Details of Narrowing: $ cd ompi/mca/vprotocol/pessimist $ 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 --CRASH- Note: Entire application and above file compiling fine if we remove "-enable-partial-inlining". 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. I'll be filing a BUG, as soon as someone from community confirms this. Thanks You, Sourabh. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201112/19b39b65/attachment.html>
Adrian Prantl via llvm-dev
2020-Nov-13 00:47 UTC
[llvm-dev] [DebugInfo]Crash during building openmpi4.0.0
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. -- adrian> On Nov 12, 2020, at 9:02 AM, Tomar, Sourabh Singh <SourabhSingh.Tomar at amd.com> wrote: > > Hi folks, > > While building openmpi.4.0.0(Optimized debug build), using trunk clang we encountered a crash(assertion failure). > > Initially assertion seems trivial: > […] > void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed. > […] > > But, narrowing to RC. We discovered “-O3 -enable-partial-inlining” pass which is doing some DebugInfo manipulation, later triggering this. > > Reproducibility: > $ wget 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> > $ tar -xf openmpi-4.0.0 > $ cd openmpi-4.0.0 > $ ./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 > $ make -jN > ----CRASH---- > > Details of Narrowing: > $ cd ompi/mca/vprotocol/pessimist > $ 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 > --CRASH— > > Note: Entire application and above file compiling fine if we remove “—enable-partial-inlining”. > > 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. > > I’ll be filing a BUG, as soon as someone from community confirms this. > > Thanks You, > Sourabh.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201112/02d91e8d/attachment.html>
Tomar, Sourabh Singh via llvm-dev
2020-Nov-13 08:34 UTC
[llvm-dev] [DebugInfo]Crash during building openmpi4.0.0
Thank You for suggestion Adrian! Generated reproducer for the crash using clang reproducer and CReduce. ::Attachment:: C file. NIT: some clean up is done on this file just to silent some compiler warnings(like implicit declaration etc.) Crash can be reproduced using above test case with following commandline: $clang -g -O3 -mllvm –enable-partial-inlining creducegenerated-cleaned.c -c ---CRASH--- $clang -g -O3 creducegenerated-cleaned.c -c Working fine. Or you may also try as: $opt -partial-inliner creduce-O3.ll -S | llc >/dev/null ---CRASH--- Thank You, Sourabh. From: Adrian Prantl <aprantl at apple.com> Sent: Friday, November 13, 2020 6:18 AM To: Tomar, Sourabh Singh <SourabhSingh.Tomar at amd.com> Cc: llvm-dev at lists.llvm.org; Vedant <vsk at apple.com> Subject: Re: [DebugInfo]Crash during building openmpi4.0.0 [CAUTION: External Email] 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. -- adrian On Nov 12, 2020, at 9:02 AM, Tomar, Sourabh Singh <SourabhSingh.Tomar at amd.com<mailto:SourabhSingh.Tomar at amd.com>> wrote: Hi folks, While building openmpi.4.0.0(Optimized debug build), using trunk clang we encountered a crash(assertion failure). Initially assertion seems trivial: […] void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed. […] But, narrowing to RC. We discovered “-O3 -enable-partial-inlining” pass which is doing some DebugInfo manipulation, later triggering this. Reproducibility: $ wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2<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> $ tar -xf openmpi-4.0.0 $ cd openmpi-4.0.0 $ ./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 $ make -jN ----CRASH---- Details of Narrowing: $ cd ompi/mca/vprotocol/pessimist $ 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 --CRASH— Note: Entire application and above file compiling fine if we remove “—enable-partial-inlining”. 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. I’ll be filing a BUG, as soon as someone from community confirms this. Thanks You, Sourabh. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201113/2ae03012/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: creducegenerated-cleaned.c URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201113/2ae03012/attachment.c>