llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.48k stars 11.77k forks source link

[not-a-bug, powerpc-darwin8] bad_alloc during assembly of RecursiveASTVisitorTest.cpp #16197

Closed llvmbot closed 6 years ago

llvmbot commented 11 years ago
Bugzilla Link 15825
Resolution WONTFIX
Resolved on Aug 20, 2018 10:48
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @rnk

Extended Description

This is not a bug, but should be documented. On powerpc-darwin8, RecursiveASTVisitorTest causes the system assembler to bad_alloc/out-of-memory. System compiler is apple-gcc-4.0.1, and assembler is Apple's GNU as 1.38. This did not occur before r179583, and was first observed r180052.

[ 88%] Building CXX object tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/RecursiveASTVisitorTest.cpp.o cd /Users/fang/local/src/LLVM-svn/gcc40-cmake-build/tools/clang/unittests/Tooling && /Users/fang/local/bin/ccg++ -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-common -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-uninitialized -Wnon-virtual-dtor -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -g -I/Users/fang/local/src/LLVM-svn/gcc40-cmake-build/tools/clang/unittests/Tooling -I/Users/fang/local/src/LLVM-svn/llvm/tools/clang/unittests/Tooling -I/Users/fang/local/src/LLVM-svn/llvm/tools/clang/include -I/Users/fang/local/src/LLVM-svn/gcc40-cmake-build/tools/clang/include -I/Users/fang/local/src/LLVM-svn/gcc40-cmake-build/include -I/Users/fang/local/src/LLVM-svn/llvm/include -I/Users/fang/local/src/LLVM-svn/llvm/utils/unittest/googletest/include -fno-exceptions -fno-rtti -Wno-variadic-macros -o CMakeFiles/ToolingTests.dir/RecursiveASTVisitorTest.cpp.o -c /Users/fang/local/src/LLVM-svn/llvm/tools/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp as(20706) malloc: vm_allocate(size=2147487744) failed (error code=3) as(20706) malloc: error: can't allocate region as(20706) malloc: set a breakpoint in szone_error to debug /var/tmp//ccxE0lI4.s:34316:FATAL:virtual memory exceeded make[3]: [tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/RecursiveASTVisitorTest.cpp.o] Error 1

This will need to be diagnosed and worked around, I'm afraid. I cannot resume check-clang without a workaround or fix.

rnk commented 6 years ago

I don't think we need to track this anymore, essentially it was an OOM while compiling RecursiveASTVisitorTest, which is a very large TU.

llvmbot commented 11 years ago

Anyways, the workarounds (any of the following):

Not particularly motivated to debug /usr/bin/as.

Other things to try: use newer newer 'as' from opendarwin cctools.

llvmbot commented 11 years ago

Interestingly enough, if I copy and rename that translation unit into the build directory (where I was about to reduce the test case), the failure is no longer triggered. Here's a part of the diff between the two .s files:

--- asm-crash.s 2013-04-22 23:04:36.000000000 -0700 +++ RecursiveASTVisitorTest.s 2013-04-22 22:37:14.000000000 -0700 @@ -2,7 +2,7 @@ .section TEXT,picsymbolstub1,symbol_stubs,pure_instructions,32 .machine ppc .stabs "/Users/fang/local/src/LLVM-svn/gcc40-cmake-build/tools/clang/unittests/Tooling/",100,0,4,Ltext0

Something about these stabs debug directives is triggering the error.

At line 34316 in RecursiveASTVisitorTest.s: .stabs "TestVisitor:t(0,28707)=s8!1,020,(0,28708)=xsRecursiveASTVisitor:;_vptr$TestVisitor:(0,5),0,32;Context:/1(0,159),32,32;base_ctor ::(0,28709)=#(0,28707),(0,1),(0,28706),(0,28710),(0,1);:_ZN5clang11TestVisitorINS20ConstructExprVisitorEEC2ERKS2;2A.;comp_ctor ::(0,28709):_ZN5clang11TestVisitorINS20ConstructExprVisitorEEC1ERKS2;2A.;base_ctor ::(0,28711)=#(0,28707),(0,1),(0,28706),(0,1);:_ZN5clang11TestVisitorINS_20ConstructExprVisitorEEC2Ev;2A.;__comp_ctor ::(0,28711):_ZN5clang11TestVisitorINS_20ConstructExprVisitorEEC1Ev;2A.;base_dtor ::(0,28711):_ZN5clang11TestVisitorINS_20ConstructExprVisitorEED2Ev;2A.;__comp_dtor ::(0,28711):_ZN5clang11TestVisitorINS_20ConstructExprVisitorEED1Ev;2A0;(0,28707);;__deleting_dtor ::(0,28711):_ZN5clang11TestVisitorINS_20ConstructExprVisitorEED0Ev;2A1;(0,28707);;runOver::(0,28712)=#(0,28707),(0,6),(0,28706),(0,1957),(0,28713)=xeLanguage:,(0,1);:_ZN5clang11TestVisitorINS_20ConstructExprVisitorEE7runOverEN4llvm9StringRefENS2_8LanguageE;2A.;shouldVisitTemplateInstantiations::(0,28714)=#(0,28707),(0,6),(0,28715),(0,1);:_ZNK5clang11TestVisitorINS_20ConstructExprVisitorEE33shouldVisitTemplateInstantiationsEv;2B.;CreateTestAction::(0,28716)=#(0,28707),(0,18675),(0,28706),(0,1);:_ZN5clang11TestVisitorINS_20ConstructExprVisitorEE16CreateTestActionEv;1A*2;(0,28707);;;~%(0,28707);",128,0,0,0

The line that follows is so long that it wraps around my terminal window so many times, that it still doesn't fit on one screen. The ask-crash.s produced by the local copy looks similar in size.