[llvm-bugs] [Bug 46303] New: Frontend crash when calling free() on array initialization example

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 12 06:54:21 PDT 2020


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

            Bug ID: 46303
           Summary: Frontend crash when calling free() on array
                    initialization example
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lea at reservoir.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 23607
  --> https://bugs.llvm.org/attachment.cgi?id=23607&action=edit
Reproducer and ii file

LLVM version: 
clang version 9.0.1 (git at github.com:llvm/llvm-project.git
c1a0a213378a458fbea1a5c77b315c7dce08fd05)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Linux version:
CentOS Linux release 7.7.1908 (Core)
Note, I am not able to reproduce this on Ubuntu 18.04.4 LTS (Bionic Beaver)

Command:
$ /opt/llvm-9.0.1/bin/clang++ llvm_crash.cpp -v
clang version 9.0.1 (git at github.com:llvm/llvm-project.git
c1a0a213378a458fbea1a5c77b315c7dce08fd05)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm-9.0.1/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/opt/llvm-9.0.1/bin/clang-9" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name llvm_crash.cpp -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -v -resource-dir /opt/llvm-9.0.1/lib/clang/9.0.1
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/llvm-9.0.1/lib/clang/9.0.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/lea/reservoir/mg/tmp -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o
/tmp/llvm_crash-42ea4b.o -x c++ llvm_crash.cpp
clang -cc1 version 9.0.1 based upon LLVM 9.0.1 default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward
 /usr/local/include
 /opt/llvm-9.0.1/lib/clang/9.0.1/include
 /usr/include
End of search list.


Crash:
*** Error in `/opt/llvm-9.0.1/bin/clang-9': free(): corrupted unsorted chunks:
0x000000000636d9e0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81679)[0x7fdeb3965679]
/opt/llvm-9.0.1/bin/clang-9[0x3383477]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang12Preprocessor15HandleEndOfFileERNS_5TokenEb+0x1129)[0x3fe6e09]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang5Lexer12LexEndOfFileERNS_5TokenEPKc+0x18a)[0x3fa9f9a]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang5Lexer16LexTokenInternalERNS_5TokenEb+0x21b1)[0x3faef31]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang12Preprocessor3LexERNS_5TokenE+0x51)[0x4004871]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser20ExpectAndConsumeSemiEj+0x283)[0x360f0f3]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser14ParseDeclGroupERNS_15ParsingDeclSpecENS_17DeclaratorContextEPNS_14SourceLocationEPNS0_12ForRangeInitE+0x5e9)[0x362f8f9]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser30ParseDeclOrFunctionDefInternalERNS0_25ParsedAttributesWithRangeERNS_15ParsingDeclSpecENS_15AccessSpecifierE+0xea)[0x360be5a]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser36ParseDeclarationOrFunctionDefinitionERNS0_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecENS_15AccessSpecifierE+0x3c6)[0x360d996]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser24ParseExternalDeclarationERNS0_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0x148)[0x360fdf8]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser17ParseTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEEb+0x112)[0x3610a12]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang6Parser22ParseFirstTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEE+0x25)[0x3610df5]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang8ParseASTERNS_4SemaEbb+0x1d0)[0x3608290]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang13CodeGenAction13ExecuteActionEv+0x24)[0x2e7ef14]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang14FrontendAction7ExecuteEv+0x121)[0x29a87c1]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x348)[0x297c518]
/opt/llvm-9.0.1/bin/clang-9(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x889)[0x2a44dc9]
/opt/llvm-9.0.1/bin/clang-9(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x8bd)[0xbf796d]
/opt/llvm-9.0.1/bin/clang-9(main+0x2525)[0xb74845]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fdeb3906505]
/opt/llvm-9.0.1/bin/clang-9[0xbf3f59]

-- 
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/20200612/d1f64ace/attachment.html>


More information about the llvm-bugs mailing list