[llvm-bugs] [Bug 44867] New: Assertion `!isNull() && "Cannot retrieve a NULL type pointer"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 10 21:38:54 PST 2020


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

            Bug ID: 44867
           Summary: Assertion `!isNull() && "Cannot retrieve a NULL type
                    pointer"
           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

The valid code can be compiled by gcc but triggered an ice in clang.

POC:
---
main() { **(int(*)[]) !8 / 0; }
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "tm" "./test1.c"
# Original command:  "/data/rxz226/llvm-project/bld/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"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/data/rxz226/llvm-project/bld/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/c_reduce"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-4936bf.o" "-x" "c" "./test1.c"
 "/data/rxz226/llvm-project/bld/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-195d79.c"
---

Stack dump:
---
clang: /home/rxz226/llvm-project/clang/include/clang/AST/Type.h:670: const
clang::ExtQualsTypeCommonBase* clang::QualType
::getCommonPtr() const: Assertion `!isNull() && "Cannot retrieve a NULL type
pointer"' failed.
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld/bin/clang -x c -o tm
./test1.c
1.      ./test1.c:1:31: current parser token '}'
2.      ./test1.c:1:8: parsing function body 'main'
3.      ./test1.c:1:8: in compound statement ('{}')
 #0 0x000000000511679b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Sig
nals.inc:564:0
 #1 0x000000000511682e PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:62
5:0
 #2 0x00000000051145b6 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000000005115fd7 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.
inc:361:0
 #4 0x000000000501be1f (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm
-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:0
 #5 0x000000000501c2fe CrashRecoverySignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cp
p:362:0
 #6 0x00007fdf1bcd6390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #7 0x00007fdf1a9e5428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #8 0x00007fdf1a9e702a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #9 0x00007fdf1a9ddbd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#10 0x00007fdf1a9ddc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#11 0x00000000053ea7d3 clang::QualType::getCommonPtr() const
/home/rxz226/llvm-project/clang/include/clang/AST/Type.h:671
:0
#12 0x00000000053ebdd8 clang::QualType::getTypePtr() const
/home/rxz226/llvm-project/clang/include/clang/AST/Type.h:6257:
0
...
---

-- 
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/20200211/5dd831b3/attachment-0001.html>


More information about the llvm-bugs mailing list