Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang drains memory while compiling PHP (crypt_sha512.c) #11178

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR10973
Status NEW
Importance P normal
Reported by adam@NetBSD.org
Reported on 2011-09-21 03:36:32 -0700
Last modified on 2019-05-24 14:19:27 -0700
Version trunk
Hardware All All
CC anton@korobeynikov.info, efriedma@quicinc.com, evan.cheng@apple.com, jryans@gmail.com, kremenek@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments crypt_sha512-preprocessed.c (336470 bytes, text/plain)
Blocks
Blocked by
See also
While trying to compile PHP 5.3.8, the compilation stops at
ext/standard/crypt_sha512.c. 'clang' process increasingly allocates more and
more memory. I had to abort after about 3-4GB has been allocated.

This is llvm/clang rev 140239. The problem does not occur with "Apple clang
version 3.0 (tags/Apple/clang-211.9) (based on LLVM 3.0svn)" from Xcode 4.2
build 4D177b.

The problem only shows up when using optimisation (-O1 or above).

Output with -O1 -v:

===> Building for php-5.3.8
/bin/sh /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/libtool --silent --
preserve-dup-deps --mode=compile clang  -Iext/standard/ -
I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/standard/ -
DPHP_ATOM_INC -I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/include -
I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/main -
I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8 -
I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/date/lib -
I/usr/pkg/include/libxml2 -I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-
5.3.8/TSRM -I/Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/Zend  -
isysroot /Developer/SDKs/MacOSX10.7.sdk -I/usr/pkg/include -I/usr/include -no-
cpp-precomp -I/usr/pkg/include  -march=core2 -isysroot
/Developer/SDKs/MacOSX10.7.sdk -O1 -v    -I/usr/pkg/include -I/usr/include -
fvisibility=hidden  -c /Volumes/Data/dist/pkgsrc/lang/php53/work/php-
5.3.8/ext/standard/crypt_sha512.c -o ext/standard/crypt_sha512.lo
clang version 3.0 (trunk)
Target: x86_64-apple-darwin11.1.0
Thread model: posix
clang: warning: argument unused during compilation: '-no-cpp-precomp'
 "/usr/pkg/bin/clang" -cc1 -triple x86_64-apple-macosx10.7.1 -emit-obj -disable-free -disable-llvm-verifier -main-file-name crypt_sha512.c -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -v -coverage-file ext/standard/crypt_sha512.o -resource-dir /usr/pkg/bin/../lib/clang/3.0 -isysroot /Developer/SDKs/MacOSX10.7.sdk -isysroot /Developer/SDKs/MacOSX10.7.sdk -D PHP_ATOM_INC -I ext/standard/ -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/standard/ -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/include -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/main -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8 -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/date/lib -I /Volumes/Data/dist/pkgsrc/lang/php53/work/.buildlink/include/libxml2 -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/TSRM -I /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/Zend -I /Volumes/Data/dist/pkgsrc/lang/php53/work/.buildlink/include -fmodule-cache-path /var/folders/4v/d7vjg23d50n_q4q8lm2l37tc0000gn/T/clang-module-cache -O1 -ferror-limit 19 -fmessage-length 80 -fvisibility hidden -stack-protector 1 -fblocks -fdiagnostics-show-option -fcolor-diagnostics -o ext/standard/crypt_sha512.o -x c /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/standard/crypt_sha512.c
clang -cc1 version 3.0 based upon llvm 3.0svn hosted on x86_64-apple-
darwin11.1.0
ignoring duplicate directory "ext/standard/"
#include "..." search starts here:
#include <...> search starts here:
 ext/standard/
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/include
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/main
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/ext/date/lib
 /Volumes/Data/dist/pkgsrc/lang/php53/work/.buildlink/include/libxml2
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/TSRM
 /Volumes/Data/dist/pkgsrc/lang/php53/work/php-5.3.8/Zend
 /Volumes/Data/dist/pkgsrc/lang/php53/work/.buildlink/include
 /Developer/SDKs/MacOSX10.7.sdk/usr/local/include
 /usr/pkg/bin/../lib/clang/3.0/include
 /Developer/SDKs/MacOSX10.7.sdk/usr/include
 /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks (framework directory)
 /Developer/SDKs/MacOSX10.7.sdk/Library/Frameworks (framework directory)
End of search list.
Quuxplusone commented 12 years ago

Please attach preprocessed source for the file in question.

Quuxplusone commented 12 years ago

Attached crypt_sha512-preprocessed.c (336470 bytes, text/plain): preprocessed crypt_sha512.c

Quuxplusone commented 12 years ago

Cloned to rdar://problem/10170065

Quuxplusone commented 12 years ago

-fsyntax-only handles this just fine. Investigating -O1.

Quuxplusone commented 12 years ago

Instruments (both time profiler and allocations) points to SCEVExpander.