[LLVMbugs] [Bug 18628] New: Crash during compilation of union-like class with template method which has auto return value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 27 05:07:59 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18628

            Bug ID: 18628
           Summary: Crash during compilation of union-like class with
                    template method which has auto return value
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: christian at kellner.me
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11948
  --> http://llvm.org/bugs/attachment.cgi?id=11948&action=edit
Sample program that crashes clang

I reliably can get clang to crash when compiling a union-like class that has a
member function template where the return type is auto and inferred via
decltype. The crash seems only to happen when one of the members of the
anonymous union is accessed inside the decltype() operator, i.e. line 21 in the
attached sample program source. Changing the decltype parameter from 'val_bool'
to a integer literal or another regular member variable leads to no crash.

clang output:

% clang -v -o test -stdlib=libc++ -Wall -pedantic -std=c++11 ../main.cpp
Apple LLVM version 5.0 (clang-500.2.78) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
0  clang                    0x00000001017babef main + 24873855
1  clang                    0x00000001017baf14 main + 24874660
2  libsystem_platform.dylib 0x00007fff8ec855aa _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000003 _sigtramp + 1899473523
4  clang                    0x00000001008bb551 main + 9147617
5  clang                    0x00000001008bb52a main + 9147578
6  clang                    0x00000001008b9941 main + 9140433
7  clang                    0x000000010078ee06 main + 7916950
8  clang                    0x000000010078df8b main + 7913243
9  clang                    0x000000010078c151 main + 7905505
10 clang                    0x000000010016e190 main + 1491232
11 clang                    0x00000001008a1067 main + 9039863
12 clang                    0x00000001002014fe main + 2094222
13 clang                    0x000000010020120b main + 2093467
14 clang                    0x00000001001f0c27 main + 2026423
15 clang                    0x00000001001f7e8a main + 2055706
16 clang                    0x00000001001ea479 main + 1999881
17 clang                    0x00000001001cc80b main + 1877915
18 clang                    0x000000010019edb3 main + 1690947
19 clang                    0x000000010019e258 main + 1688040
20 clang                    0x00000001000be5ac main + 771388
21 clang                    0x00000001000946c9 main + 599641
22 clang                    0x00000001000944ff main + 599183
23 clang                    0x00000001000943b4 main + 598852
24 clang                    0x000000010005ec02 main + 379794
25 clang                    0x000000010005ba14 main + 367012
26 clang                    0x000000010005a8c5 main + 362581
27 clang                    0x0000000100026c9d main + 150573
28 clang                    0x0000000100007cc0 main + 23632
29 libdyld.dylib            0x00007fff869d55fd start + 1
Stack dump:
0.    Program arguments:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name main.cpp -mrelocation-model pic
-pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 224.1 -v -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0
-stdlib=libc++ -Wall -pedantic -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /Users/gicmo/Coding/G-Node/nix/build -ferror-limit 19
-fmessage-length 202 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.9.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/92/wg8lbvx97jg53h4pmbt6kby40000gn/T/main-Ycs5pz.o -x c++
../main.cpp
1.    <eof> parser at end of file
2.    ../main.cpp:31:1: LLVM IR generation of declaration 'main'
3.    ../main.cpp:31:1: Generating code for declaration 'main'
4.    ../main.cpp:19:10: Mangling declaration 'dummy::visit'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Apple LLVM version 5.0 (clang-500.2.78) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.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/20140127/7bb24135/attachment.html>


More information about the llvm-bugs mailing list