[llvm-bugs] [Bug 27093] New: clang-format.exe format big file out of 2G memory even when /* clang-format off */ is first line

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 28 00:58:38 PDT 2016


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

            Bug ID: 27093
           Summary: clang-format.exe format big file out of 2G  memory
                    even when /* clang-format off */ is first line
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: akkaa at 139.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

When I use Windows 8 64 bit with 8G RAM, it fail immediately:
d:\>clang-format.exe -style=llvm -i sqlite3.c
0x00B03AF2 (0x0168EE97 0x02B1052E 0x00000000 0x0193C058)
0x00B0355D (0x839EB699 0x00000058 0x00000050 0x01930000)
0x77C7EE41 (0x00000030 0x00000002 0x01930000 0x00000010)
0x77C7E3A0 (0x01930000 0x00000002 0x01939740 0x839EB781)
0x77C674F9 (0xFFFFFFFE 0x00000050 0x00000004 0x01940588)
0x77C7EAB4 (0x00000000 0x01930260 0x00000004 0x0168E678)
0x77C7F9AE (0x0168E670 0x0193A264 0x0193C058 0x0168EE64)
0x00BDA951 (0x0168EEBC 0x0168F31C 0x0168E6F8 0x00000001)
0x00B02C69 (0x0168EEBC 0x0168F31C 0x02736020 0x003DA50E)
0x00AB247B (0x01939AB8 0x00000009 0x00BED821 0x00000000)
0x00AB1C3B (0x7F756000 0x0168FBA4 0x77C88F8B 0x7F756000)
0x777EA534 (0x7F756000 0x839EA965 0x00000000 0x00000000)
0x77C88F8B (0xFFFFFFFF 0x77C7DACF 0x00000000 0x00000000)
0x77C88F61 (0x00BDA92D 0x7F756000 0x00000000 0x00000000)


But when I use Windows 7 32 bit with 2G RAM, The system is very slow, and
clang-format.exe use near 2G ram, then fail:
0x0103AEA0 (0x0A4CDA70 0x00000000 0x06CA3E3C 0x00100000) <unknown module>



I add /* clang-format off */ as the first line, and NO /* clang-format on */,
and want to skip this error, but it dumps too.
Please only copy data between /* clang-format off */ and /* clang-format on */
to output, and do NOT parse it, thanks.

We find many large file will dump. This is a public file:
    sqlite3.c, 3.85 MB (4,039,926 bytes):
** This file is an amalgamation of many separate C source files from SQLite
** version 3.6.23.

-- 
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/20160328/96f3587e/attachment.html>


More information about the llvm-bugs mailing list