[LLVMbugs] [Bug 13263] New: Segmentation fault compiling variadic function with many arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 3 11:11:45 PDT 2012


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

             Bug #: 13263
           Summary: Segmentation fault compiling variadic function with
                    many arguments
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rbock at eudoxos.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8822
  --> http://llvm.org/bugs/attachment.cgi?id=8822
Compile with clang -std=c++11

While experimenting with some c++11 trick by Eric Niebler, I crashed clang with
the attached source code

$ clang -std=c++11 test_eric2.cpp -O3 -v
clang version 3.2 (trunk 155315)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/usr/local/bin/clang-3.2" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-disable-free -disable-llvm-verifier -main-file-name test_eric2.cpp
-mrelocation-model static -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -momit-leaf-frame-pointer -v -resource-dir
/usr/local/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5
-internal-isystem
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5/x86_64-linux-gnu
-internal-isystem
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.2/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/rbock/temp/test -ferror-limit 19 -fmessage-length
159 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/test_eric2-ainULp.o -x c++ test_eric2.cpp
clang -cc1 version 3.2 based upon LLVM 3.2svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5/x86_64-linux-gnu

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../include/c++/4.5/backward
 /usr/local/include
 /usr/local/bin/../lib/clang/3.2/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
clang-3: error: unable to execute command: Segmentation fault
clang-3: error: clang frontend command failed due to signal (use -v to see
invocation)
clang-3: note: diagnostic msg: Please submit a bug report to  and include
command line arguments and all diagnostic information.
clang-3: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang-3: note: diagnostic msg: /tmp/test_eric2-2yLiNi.ii
clang-3: note: diagnostic msg: /tmp/test_eric2-2yLiNi.sh


The code compiles fine with a few parameters less (one row less, for instance).

The number of parameters does not seem to be the issue. I tried similar code
with many more parameters and experienced no crash. See also
http://boost.2283326.n4.nabble.com/offtopic-C-11-useful-trick-td4632327.html#a4632453

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list