[LLVMbugs] [Bug 16239] New: clang segmentation fault/consumes all memory

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 6 01:22:54 PDT 2013


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

            Bug ID: 16239
           Summary: clang segmentation fault/consumes all memory
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tmmikolajczyk at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10635
  --> http://llvm.org/bugs/attachment.cgi?id=10635&action=edit
the code and the requested compilation output

Clang crashes compiling the following code:

template<typename T>
struct Move
{
    Move(T t);
    T rsc;
};

class Foo
{
public:
    Foo() {}
    Foo(Move<Foo> m);

private:
    // NON-CONST ARGS. CLANG DOES NOT CRASH AND REPORTS PROPER DIAGNOSTICS WHEN
THEY ARE CONST
    Foo(Foo&);
    Foo& operator=(Foo&);
};

Foo create()
{
    return Foo();
}

int main()
{
    create();
    return 0;
}

Please note that when the copy constructor and assignment operator argument is
defined as const l-value ref the compiler generates proper diagnostic.

The semantic of this piece of code is irrelevant. It is a fragment of something
bigger. What is important that when compiling a wider piece I'm not able to
share, the compiler sometimes consumes all the available memory and makes the
system unresponsive eventually. It's not easy to reproduce this behavior with
an equivalent code but hopefully it concerns the same issue as observed when
compiling the attached one.

This behavior happens on clang 3.2 and also on the latest repo version (git
rev. d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf).

The attached package contains all the requested information.

My env:
OS: ArchLinux,
uname -a
Linux 3.9.4-1-ARCH #1 SMP PREEMPT Sat May 25 16:14:55 CEST 2013 x86_64
GNU/Linux
glibc: 2.17.6

-- 
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/20130606/abc1bd18/attachment.html>


More information about the llvm-bugs mailing list