[llvm-bugs] [Bug 38727] New: clang-format consumes all available memory formatting Doug Lea`s malloc

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 27 13:04:33 PDT 2018


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

            Bug ID: 38727
           Summary: clang-format consumes all available memory formatting
                    Doug Lea`s malloc
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vlad.bespalov at jetstreamsoft.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

clang version:
$ clang --version
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/clang/bin

source file : Doug Lea's malloc
ftp://g.oswego.edu/pub/misc/malloc.c

command line:
$ ls -hs
total 220K
220K malloc.c
$ ulimit -m -v
max memory size         (kbytes, -m) 4096000
virtual memory          (kbytes, -v) 4096000
$ clang-format malloc.c
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
terminate called recursively
Aborted (core dumped)

If not constrained to 4 GB via ulimit, formatter claims all available memory
and my system becomes totally unusable.

-- 
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/20180827/b82f5a80/attachment.html>


More information about the llvm-bugs mailing list