[llvm-bugs] [Bug 44741] New: Crash on release. Second assertion `Val & & "isa<> used on a null pointer"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 31 11:43:11 PST 2020


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

            Bug ID: 44741
           Summary: Crash on release. Second assertion `Val & & "isa<>
                    used on a null pointer"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: changochen1 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

POC:
---
# 1 "<built-in>"
# 1 "test1.c"
union {
  union {
    struct b *c
  } a[]
} d = {3}
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "test" "test1.c"
# Original command:  "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/fuzz_clang2/hangs/test"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-f5fc33.o" "-x" "c" "test1.c"
 "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-67c28b.c"
---

Stack dump:

---
 #0 0x000000000681faf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:560:7
 #1 0x000000000681ac5e llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 0x000000000681dd30 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:3
 #3 0x000000000662a5aa (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:5
 #4 0x000000000662a9e6
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:361:51
 #5 0x00007f54dd186390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #6 0x00007f54dbcf0428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #7 0x00007f54dbcf202a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #8 0x00007f54dbce8bd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
 #9 0x00007f54dbce8c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#10 0x0000000007095d9e
(/home/rxz226/llvm-project/bld_instru/bin/clang+0x7095d9e)
#11 0x000000000bf76b5b llvm::isa_impl_wrap<clang::BinaryOperator, clang::Expr*
const, clang::Expr const*>::doit(clang::Expr* const&)
/home/rxz226/llvm-project/llvm/include/llvm/Support/Casting.h:122:12
#12 0x000000000bf76b5b bool llvm::isa<clang::BinaryOperator,
clang::Expr*>(clang::Expr* const&)
/home/rxz226/llvm-project/llvm/include/llvm/Support/Casting.h:142:0
#13 0x000000000bf76b5b clang::Sema::CheckForIntOverflow(clang::Expr*)
/home/rxz226/llvm-project/clang/lib/Sema/SemaChecking.cpp:11970:0
#14 0x000000000bf780b1 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
/home/rxz226/llvm-project/clang/lib/Sema/SemaChecking.cpp:12696:3
#15 0x000000000c927527 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
/home/rxz226/llvm-project/clang/lib/Sema/SemaExprCXX.cpp:8264:7
#16 0x000000000c1752d1 clang::ActionResult<clang::Expr*, true>::isInvalid()
const /home/rxz226/llvm-project/clang/include/clang/Sema/Ownership.h:0:0
#17 0x000000000c1752d1 clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool)
/home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:11920:0
#18 0x000000000bc15c12
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.c
pp:0:17
#19 0x000000000bc10989 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.cpp:2128:9
#20 0x000000000bbbe8b9
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:0:10
#21 0x000000000bbbcfe9
clang::Parser::ObjCDeclContextSwitch::~ObjCDeclContextSwitch()
/home/rxz226/llvm-project/clang/include/clang/Parse/Parser.h:0:0
#22 0x000000000bbbcfe9
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:1126:0
#23 0x000000000bbbae53
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:945:12
#24 0x000000000bbb658c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:696:10
#25 0x000000000bbb537c
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:564:26
...
---

-- 
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/20200131/88383376/attachment-0001.html>


More information about the llvm-bugs mailing list