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

            Bug ID: 17520
           Summary: clang++ crashes when compiling c++ code, after eating
                    all available memory (with -O2 activated).
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

When trying to compile a minimal version of my project with clang++ (with
option -O2 specified), it eats all the available RAM (4Gb RAM + 4Gb Swap) to
compile a single .cpp file. Without '-O2', the compilation succeeds (in
seconds).

My project is using a lot of template functions, and I suspect this can be
related to this issue (I had similar issues with previous versions of g++ in
the past, that has been fixed, so g++ compiles it flawlessly now).

I attach a .zip file containing the sources to reproduce the problem, as well
as the two output files generated by clang++ (in subfolder 'clang-generated/').
This is what I get when typing 'make' on my machine (ASUS Zenbook 64bits, 4Gb
RAM, running Ubuntu 13.04) :

>  dtschump@xxxxx:/tmp/gmic_clang$ make
>  clang++ -o gmic gmic.cpp -O2 -Dgmic_build -Dcimg_display=0 -Dgmic_float_only 
> -Dgmic_main -lpthread
>  clang: error: unable to execute command: Killed
>  clang: error: clang frontend command failed due to signal (use -v to see 
> invocation)
>  Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on 
> LLVM 3.2)
>  Target: x86_64-pc-linux-gnu
>  Thread model: posix
>  clang: note: diagnostic msg: PLEASE submit a bug report to 
> http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, 
> and associated run script.
>  clang: note: diagnostic msg:
>  ********************

>  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
>  Preprocessed source(s) and associated run script(s) are located at:
>  clang: note: diagnostic msg: /tmp/gmic-XLlwLm.cpp
>  clang: note: diagnostic msg: /tmp/gmic-XLlwLm.sh
>  clang: note: diagnostic msg:

>  ********************
>  make: *** [all] Error 254

The memory usage increases drastically after one minute, until reaching more
than 8Gb. Then it crashes.

This is my first bug report to clang++, I hope all necessary files are here.
Just let me know if you need more information.

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to