[llvm-bugs] [Bug 51198] New: ICE: llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = clang::ParenExpr; From = clang::Expr]: Assertion `Val && "isa<> used on a null pointer"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 23 17:50:50 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51198

            Bug ID: 51198
           Summary: ICE: llvm::isa_impl_cl<To, const From*>::doit(const
                    From*) [with To = clang::ParenExpr; From =
                    clang::Expr]: Assertion `Val && "isa<> used on a null
                    pointer"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnsun at uwaterloo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
ab5ac659c81a453a3f58df94f39fe8ba3cd35918)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat mutant.c
union {
  int block[];
} u17_017 = {17.17};

$ clang-trunk -w mutant.c
mutant.c:2:7: error: flexible array member 'block' in a union is not allowed
  int block[];
      ^
clang-13:
/tmp/tmp.Gcp8nSn9Hr-clang-builder/llvm-project/llvm/include/llvm/Support/Casting.h:104:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::ParenExpr; From = clang::Expr]: Assertion `Val && "isa<> used on a null
pointer"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /scratch/software/clang-trunk/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name mutant.c -mrelocation-model static
-mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/temp_testing_campaigns/default_finding_folder_c/crash_20210706_130053_129a/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -w
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/temp_testing_campaigns/default_finding_folder_c/crash_20210706_130053_129a/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-6b948a.o -x c mutant.c
1.      mutant.c:3:20: current parser token ';'
 #0 0x0000560280b99754 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000560280b96e6e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fcc119733c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007fcc1141218b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007fcc113f1859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007fcc113f1729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007fcc113f1729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007fcc11402f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x0000560283c8d315 (/scratch/software/clang-trunk/bin/clang-13+0x6c19315)
 #9 0x0000560283c9ac6c (/scratch/software/clang-trunk/bin/clang-13+0x6c26c6c)
#10 0x0000560283c9c5d8 clang::Expr::IgnoreParenCasts()
(/scratch/software/clang-trunk/bin/clang-13+0x6c285d8)
#11 0x0000560282f7be95 clang::Sema::CheckForIntOverflow(clang::Expr*)
(/scratch/software/clang-trunk/bin/clang-13+0x5f07e95)
#12 0x0000560282fcbea1 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5f57ea1)
#13 0x000056028336fc52 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x62fbc52)
#14 0x00005602830c153d clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool) (/scratch/software/clang-trunk/bin/clang-13+0x604d53d)
#15 0x0000560282e16256
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/scratch/software/clang-trunk/bin/clang-13+0x5da2256)
#16 0x0000560282e2913b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/scratch/software/clang-trunk/bin/clang-13+0x5db513b)
#17 0x0000560282df7176
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/scratch/software/clang-trunk/bin/clang-13+0x5d83176)
#18 0x0000560282df7761
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#19 0x0000560282dfdf87
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/scratch/software/clang-trunk/bin/clang-13+0x5d89f87)
#20 0x0000560282dff51e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5d8b51e)
#21 0x0000560282dff8c9
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/scratch/software/clang-trunk/bin/clang-13+0x5d8b8c9)
#22 0x0000560282df1d1a clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5d7dd1a)
#23 0x0000560281d2c2f8 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4cb82f8)
#24 0x00005602815ca419 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x4556419)
#25 0x000056028156007e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x44ec07e)
#26 0x00005602816a8710
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x4634710)
#27 0x000056027e41415d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x13a015d)
#28 0x000056027e4104a8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#29 0x000056027e33b126 main
(/scratch/software/clang-trunk/bin/clang-13+0x12c7126)
#30 0x00007fcc113f30b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#31 0x000056027e41001e _start
(/scratch/software/clang-trunk/bin/clang-13+0x139c01e)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
ab5ac659c81a453a3f58df94f39fe8ba3cd35918)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/mutant-9c1959.c
clang-13: note: diagnostic msg: /tmp/mutant-9c1959.sh
clang-13: note: diagnostic msg:

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210724/c6d16133/attachment-0001.html>


More information about the llvm-bugs mailing list