[LLVMbugs] [Bug 22958] New: AST Parser fails to completely parse large c files

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 19 14:22:43 PDT 2015


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

            Bug ID: 22958
           Summary: AST Parser fails to completely parse large c files
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haxmeadroom at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I've noticed this for several large single c files.  Basically, the AST parser
will fail in the middle, returning 1....

$ clang -Xclang -ast-dump -fsyntax-only -w  -fno-spell-checking -ferror-limit=0
repro.c > stdout.txt  2> stderr.txt ; echo $?
1

$ tail  stderr.txt
repro.c:56:10: fatal error: 'mac_internal.h' file not found
#include "mac_internal.h"
         ^
1 error generated.
$ grep FunctionDecl stdout.txt  | tail
|-FunctionDecl 0xf468c30 <OSUnserialize.y:953883:1, line:954172:1>
line:953884:1 hfs_vnop_link 'int (struct vnop_link_args *)'
`-FunctionDecl 0xf46f7a0 prev 0xf176490 <line:954180:1, line:954406:1>
line:954181:1 used hfs_unlink 'int (struct hfsmount *, struct vnode *, struct
vnode *, struct componentname *, int)'


$ wc repro.c
 1062747  3486534 29442234 repro.c

You can see it stopped on line 953883 of 1062747 in hfs_vnop_link(), or about
89% way through the file.  We realize there are fatal errors, but the intent
isn't to compile this file, just to parse the AST, so not being able to find
the mac_internal.h file isn't a concern.  

$ uname -a
Linux x 3.13.0-46-generic #79-Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64
x86_64 x86_64 GNU/Linux

$ clang -v
clang version 3.7.0 (http://llvm.org/git/clang.git
0c3cbccf0e435b1bf954eb1aab57cf622242667c) (http://llvm.org/git/llvm.git
5e868040895fe25a361fd588b2aa6bf1360cbb9b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

-- 
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/20150319/526c1874/attachment.html>


More information about the llvm-bugs mailing list