New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 605570 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocked on:
issue 604993

Blocking:
issue 82385



Sign in to add a comment

Assertion failed: Layout && "Unable to find record layout information for type" on clang/tot win component bots

Project Member Reported by thakis@chromium.org, Apr 21 2016

Issue description

e.g. here https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dll%29/builds/4886

FAILED: ninja -t msvc -e environment.x86 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\net\quic\net.quic_connection.obj.rsp /c ..\..\net\quic\quic_connection.cc /Foobj\net\quic\net.quic_connection.obj /Fdobj\net\net.cc.pdb 
Assertion failed: Layout && "Unable to find record layout information for type", file C:\b\build\slave\ClangToTWin_dll_\build\src\third_party\llvm\tools\clang\lib\CodeGen\CodeGenTypes.cpp, line 734
#0 0x0000000140031915 (C:\b\build\slave\ClangToTWin_dll_\build\src\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe+0xfe1915)


Always for quick_connection.obj.

The pinned waterfall is happy, so I figured it's a clang revision. I filed https://llvm.org/bugs/show_bug.cgi?id=27445 -- but while trying to make a repro, I was able to repro this with the pinned clang too (even though the pinned bots look happy). I at first wasn't able to repro at all which was due to me having a fairly old chrome checkout. So maybe it's triggered by a chrome change too (but then why are the pinned bots happy)? Very mysterious. Also seems to only happen if precompiled headers are used.

rnk fixed something with the same assert text a while back (http://llvm.org/PR18962).

Unless one of you knows what's happening here, I'll poke at this a bit, at least until I have a reliable repro and understand why the pinned bots look happy.
 

Comment 1 by thakis@chromium.org, Apr 21 2016

Cc: scottmg@chromium.org brucedaw...@chromium.org
Theory: Since this is related to precompiled headers, and precompiled headers currently only include system headers:

1. The toolchain got updated. This changes the INCLUDE env var, which ninja doesn't know about. The precompile.obj file's deps point to the .h files in the old toolchain folder, but since we now include the toolchain hash in the include path, these files just don't exist any more, which I think doesn't mark the .obj dirty. So I'm guessing .pch files don't get rebuilt after toolchain updates. (For clang-cl, https://codereview.chromium.org/1724533002/ will fix this as it adds the include path to the build compile line, and then ninja's command-line tracking will notice. Maybe we should add the include paths as /I flags for cl.exe too for that reason, and maybe stop writing INCLUDE to the env file.)

If that's the case, then the pinned bots never saw a reason to rebuild the pch files since the last toolchain update (which was like 3 weeks ago). And then a net change loaded that uses the standard library just wrong to trigger the crash.
Unfortunately I don't think that the theory in #2 is correct. The toolchain change forces a clobber through landmines. If it didn't then the new VC++ compiler would complain about some of the build output files being from the old version - it wouldn't use the PCH files, it would just fail to build.

Now, clang's rules about using PCH files across versions may be different, but there should still have been a clobber due to the landmines.

This is the latest toolchain update - notice the landmine change:

https://codereview.chromium.org/1851573002

Comment 3 by thakis@chromium.org, Apr 21 2016

landmines shouldn't be used for things that regularly change (see the comment in the file). This does disprove my theory, but going forward we should have a better story than landmines for forcing rebuilds on toolchain updates :-)

Comment 4 by thakis@chromium.org, Apr 21 2016

stack:

[330/330] CXX obj\net\quic\net.quic_connection.obj
FAILED: ninja -t msvc -e environment.x86 -- "..\..\..\..\llvm-build-relsym/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\net\quic\net.quic_connection.obj.rsp /c ..\..\net\quic\quic_connection.cc /Foobj\net\quic\net.quic_connection.obj /Fdobj\net\net.cc.pdb
Assertion failed: Layout && "Unable to find record layout information for type", file tools\clang\lib\Cod
eGen\CodeGenTypes.cpp, line 734
HandleAbort() + 0x5 bytes(s), lib\support\windows\signals.inc, line 390
raise() + 0x1E9 bytes(s)
abort() + 0x18 bytes(s)
_wassert() + 0x94F bytes(s)
clang::CodeGen::CodeGenTypes::getCGRecordLayout() + 0xE6 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 735
emitAddrOfFieldStorage() + 0x87 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 3242 + 0xF byte(s)
clang::CodeGen::CodeGenFunction::EmitLValueForField() + 0x5A5 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 3301 + 0x1F byte(s)
clang::CodeGen::CodeGenFunction::EmitMemberExpr() + 0x240 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 3209
clang::CodeGen::CodeGenFunction::EmitLValue() + 0x4E8 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 1030 + 0x16 byte(s)
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr() + 0x2FE bytes(s), tools\clang\lib\codegen\cgexprcxx.cpp, line 173 + 0x9 byte(s)
clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr() + 0x291 bytes(s), tools\clang\lib\codegen\cgexprcxx.cpp, line 129 + 0x3F byte(s)
clang::CodeGen::CodeGenFunction::EmitCallExpr() + 0x142 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 3686 + 0x1D byte(s)
clang::CodeGen::CodeGenFunction::EmitCallExprLValue() + 0x35 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 3808
clang::CodeGen::CodeGenFunction::EmitLValue() + 0x178 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 970 + 0x16 byte(s)
clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr() + 0x29 bytes(s), tools\clang\lib\codegen\cgexpr.cpp, line 462
clang::CodeGen::CodeGenFunction::EmitReturnStmt() + 0x380 bytes(s), tools\clang\lib\codegen\cgstmt.cpp, line 997
clang::CodeGen::CodeGenFunction::EmitStmt() + 0x257 bytes(s), tools\clang\lib\codegen\cgstmt.cpp, line 139 + 0x13 byte(s)
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope() + 0x6B bytes(s), tools\clang\lib\codegen\cgstmt.cpp, line 324 + 0xB byte(s)
clang::CodeGen::CodeGenFunction::EmitFunctionBody() + 0x7E bytes(s), tools\clang\lib\codegen\codegenfunction.cpp, line 893
clang::CodeGen::CodeGenFunction::GenerateCode() + 0x7AE bytes(s), tools\clang\lib\codegen\codegenfunction.cpp, line 1028
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition() + 0x26C bytes(s), tools\clang\lib\codegen\codegenmodule.cpp, line 2885 + 0x39 byte(s)
clang::CodeGen::CodeGenModule::EmitGlobalDefinition() + 0x177 bytes(s), tools\clang\lib\codegen\codegenmodule.cpp, line 1793
clang::CodeGen::CodeGenModule::EmitGlobal() + 0x377 bytes(s), tools\clang\lib\codegen\codegenmodule.cpp, line 1618
clang::CodeGen::CodeGenModule::EmitTopLevelDecl() + 0xED bytes(s), tools\clang\lib\codegen\codegenmodule.cpp, line 3716
`anonymous namespace'::CodeGeneratorImpl::EmitDeferredDecls() + 0x98 bytes(s), tools\clang\lib\codegen\modulebuilder.cpp, line 141
`anonymous namespace'::CodeGeneratorImpl::HandleTopLevelDecl() + 0xF5 bytes(s), tools\clang\lib\codegen\modulebuilder.cpp, line 130 + 0x1A byte(s)
clang::BackendConsumer::HandleTopLevelDecl() + 0xE4 bytes(s), tools\clang\lib\codegen\codegenaction.cpp, line 120
clang::ASTConsumer::HandleInterestingDecl() + 0xA bytes(s), tools\clang\lib\ast\astconsumer.cpp, line 25
clang::ASTReader::PassInterestingDeclsToConsumer() + 0x12A bytes(s), tools\clang\lib\serialization\astreader.cpp, line 6720
clang::ASTReader::FinishedDeserializing() + 0x365 bytes(s), tools\clang\lib\serialization\astreader.cpp, line 8607 + 0x9 byte(s)
clang::DeclContext::LoadLexicalDeclsFromExternalStorage() + 0x21E bytes(s), tools\clang\lib\ast\declbase.cpp, line 1133 + 0x23 byte(s)
clang::DeclContext::decls_begin() + 0x1B bytes(s), tools\clang\lib\ast\declbase.cpp, line 1203
`anonymous namespace'::MicrosoftRecordLayoutBuilder::layoutNonVirtualBases() + 0x2C1 bytes(s), tools\clang\lib\ast\recordlayoutbuilder.cpp, line 2509 + 0x11 byte(s)
`anonymous namespace'::MicrosoftRecordLayoutBuilder::cxxLayout() + 0x33 bytes(s), tools\clang\lib\ast\recordlayoutbuilder.cpp, line 2405
clang::ASTContext::getASTRecordLayout() + 0x1DE bytes(s), tools\clang\lib\ast\recordlayoutbuilder.cpp, line 2927
`anonymous namespace'::CGRecordLowering::CGRecordLowering() + 0x48 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 222 + 0x48 byte(s)
clang::CodeGen::CodeGenTypes::ComputeRecordLayout() + 0x56 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 689
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType() + 0x3BB bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 699
clang::CodeGen::CodeGenTypes::ConvertType() + 0x9E bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 646
clang::CodeGen::CodeGenTypes::ConvertTypeForMem() + 0x17 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 87
clang::CodeGen::CodeGenTypes::ConvertType() + 0x3BE bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 507 + 0x8 byte(s)
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo() + 0x3E8 bytes(s), tools\clang\lib\codegen\cgcall.cpp, line 698 + 0xC byte(s)
arrangeLLVMFunctionInfo() + 0x1AD bytes(s), tools\clang\lib\codegen\cgcall.cpp, line 152 + 0x8F byte(s)
clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType() + 0x50 bytes(s), tools\clang\lib\codegen\cgcall.cpp, line 162 + 0x5 byte(s)
clang::CodeGen::CodeGenTypes::ConvertFunctionType() + 0x2A4 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 348
clang::CodeGen::CodeGenTypes::ConvertType() + 0x57D bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 561 + 0xF byte(s)
clang::CodeGen::CodeGenTypes::ConvertTypeForMem() + 0x17 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 87
clang::CodeGen::CodeGenTypes::ConvertType() + 0x3BE bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 507 + 0x8 byte(s)
clang::CodeGen::CodeGenTypes::ConvertTypeForMem() + 0x17 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 87
`anonymous namespace'::CGRecordLowering::getStorageType() + 0x1B bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 137
`anonymous namespace'::CGRecordLowering::accumulateFields() + 0x2AF bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 361 + 0x138 byte(s)
`anonymous namespace'::CGRecordLowering::lower() + 0x83 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 268
clang::CodeGen::CodeGenTypes::ComputeRecordLayout() + 0x62 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 692
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType() + 0x3BB bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 699
clang::CodeGen::CodeGenTypes::ConvertType() + 0x9E bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 646
clang::CodeGen::CodeGenTypes::ConvertTypeForMem() + 0x17 bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 87
`anonymous namespace'::CGRecordLowering::getStorageType() + 0x1B bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 137 
`anonymous namespace'::CGRecordLowering::accumulateFields() + 0x2AF bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 361 + 0x138 byte(s)
`anonymous namespace'::CGRecordLowering::lower() + 0x83 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 268
clang::CodeGen::CodeGenTypes::ComputeRecordLayout() + 0x62 bytes(s), tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 692
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType() + 0x3BB bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 699
clang::CodeGen::CodeGenTypes::UpdateCompletedType() + 0x15A bytes(s), tools\clang\lib\codegen\codegentypes.cpp, line 271
`anonymous namespace'::CodeGeneratorImpl::HandleTagDeclDefinition() + 0x37 bytes(s), tools\clang\lib\codegen\modulebuilder.cpp, line 192
clang::BackendConsumer::HandleTagDeclDefinition() + 0x64 bytes(s), tools\clang\lib\codegen\codegenaction.cpp, line 189 + 0x9 byte(s)
clang::Sema::ActOnTagFinishDefinition() + 0x16F bytes(s), tools\clang\lib\sema\semadecl.cpp, line 13027
clang::Parser::ParseCXXMemberSpecification() + 0x985 bytes(s), tools\clang\lib\parse\parsedeclcxx.cpp, line 3142
clang::Parser::ParseClassSpecifier() + 0x14DE bytes(s), tools\clang\lib\parse\parsedeclcxx.cpp, line 1769
clang::Parser::ParseDeclarationSpecifiers() + 0x1FCD bytes(s), tools\clang\lib\parse\parsedecl.cpp, line 3394
clang::Parser::ParseDeclOrFunctionDefInternal() + 0x53 bytes(s), tools\clang\lib\parse\parser.cpp, line 882
clang::Parser::ParseDeclarationOrFunctionDefinition() + 0x191 bytes(s), tools\clang\lib\parse\parser.cpp, line 956 + 0x1D byte(s)
clang::Parser::ParseExternalDeclaration() + 0x875 bytes(s), tools\clang\lib\parse\parser.cpp, line 808 + 0x1A byte(s)
clang::Parser::ParseInnerNamespace() + 0xF7 bytes(s), tools\clang\lib\parse\parsedeclcxx.cpp, line 222
clang::Parser::ParseNamespace() + 0x13D2 bytes(s), tools\clang\lib\parse\parsedeclcxx.cpp, line 199
clang::Parser::ParseDeclaration() + 0x213 bytes(s), tools\clang\lib\parse\parsedecl.cpp, line 1498 + 0x19 byte(s)
clang::Parser::ParseExternalDeclaration() + 0x48A bytes(s), tools\clang\lib\parse\parser.cpp, line 750 + 0x13 byte(s)
clang::Parser::ParseTopLevelDecl() + 0xF8 bytes(s), tools\clang\lib\parse\parser.cpp, line 596
clang::ParseAST() + 0x1FE bytes(s), tools\clang\lib\parse\parseast.cpp, line 161 + 0x10 byte(s)
clang::ASTFrontendAction::ExecuteAction() + 0xE5 bytes(s), tools\clang\lib\frontend\frontendaction.cpp, line 558
clang::CodeGenAction::ExecuteAction() + 0x5B0 bytes(s), tools\clang\lib\codegen\codegenaction.cpp, line 844 + 0x8 byte(s)
clang::FrontendAction::Execute() + 0x69 bytes(s), tools\clang\lib\frontend\frontendaction.cpp, line 462
clang::CompilerInstance::ExecuteAction() + 0x3F0 bytes(s), tools\clang\lib\frontend\compilerinstance.cpp, line 874
clang::ExecuteCompilerInvocation() + 0x485 bytes(s), tools\clang\lib\frontendtool\executecompilerinvocation.cpp, line 241 + 0xB byte(s)
cc1_main() + 0x43C bytes(s), tools\clang\tools\driver\cc1_main.cpp, line 116 + 0x8 byte(s)
ExecuteCC1Tool() + 0x9A bytes(s), tools\clang\tools\driver\driver.cpp, line 308
main() + 0x73F bytes(s), tools\clang\tools\driver\driver.cpp, line 374 + 0x7C byte(s)
__tmainCRTStartup() + 0x10F bytes(s), f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c, line 626 + 0x19 byte(s)
BaseThreadInitThunk() + 0xD bytes(s)
RtlUserThreadStart() + 0x21 bytes(s)

Comment 5 by thakis@chromium.org, Apr 21 2016

Cc: xyzzyz@chromium.org
This is a reduced version of quic_connection.cc that still triggers the crash:

#include "net/quic/quic_connection.h"
#include "net/quic/proto/cached_network_parameters.pb.h"

So the trigger is probably the protobuf change https://codereview.chromium.org/1842653006

Comment 6 by thakis@chromium.org, Apr 21 2016

smaller:

#include "net/base/net_export.h"
namespace net {
class CachedNetworkParameters;
struct NET_EXPORT_PRIVATE QuicConnectionDebugVisitor {
  virtual void OnReceiveConnectionState(
      const CachedNetworkParameters& cached_network_params) {}
};
}  // namespace net
#include "net/quic/proto/cached_network_parameters.pb.h"

Comment 7 by xyzzyz@chromium.org, Apr 21 2016

The protobuf change is getting reverted, and I'm looking into why it caused the this problem.

Comment 8 by xyzzyz@chromium.org, Apr 21 2016

Cc: manisca...@chromium.org

Comment 9 by thakis@chromium.org, Apr 21 2016

xyzzyz: This bug here is a compiler crash, and for some reason only on our trunk clang bots. I don't think you need to worry about this bug too much, but maybe you can ping me before you reland.
thakis: will do, thanks.
Smaller, now only standard library headers:

#define NET_EXPORT_PRIVATE __declspec(dllexport)
class CachedNetworkParameters;
struct NET_EXPORT_PRIVATE QuicConnectionDebugVisitor {
  virtual void OnReceiveConnectionState(
      const CachedNetworkParameters& cached_network_params) {}
};
// Work around bugs in MSVC <typeinfo> header when _HAS_EXCEPTIONS=0.
#include <exception>
#include <typeinfo>
namespace std {
using type_info = ::type_info;
}
namespace google {
namespace protobuf {
class Arena {
public:
  void (*on_arena_allocation)(const std::type_info* allocated_type);
};

#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)    \
  TypeName(const TypeName&);                           \
  void operator=(const TypeName&)

}  // namespace protobuf
}  // namespace google

class NET_EXPORT_PRIVATE CachedNetworkParameters {
  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CachedNetworkParameters);
  ::google::protobuf::Arena* MaybeArenaPtr() const { return _arena_ptr_; }
  ::google::protobuf::Arena* _arena_ptr_;
};




(Replacing the weird type_info stuff with just `#include <typeinfo>` lets things still repro)
Smaller (no includes needed for type_info since the precompile header is injected):

class CachedNetworkParameters;
struct __declspec(dllexport) QuicConnectionDebugVisitor {
  virtual void OnReceiveConnectionState(
      const CachedNetworkParameters& cached_network_params) {}
};
class __declspec(dllexport) CachedNetworkParameters {
  void operator=(const CachedNetworkParameters&);
  void (*on_arena_allocation)(const std::type_info* allocated_type);
  int MaybeArenaPtr() const { return _arena_ptr_; }
  int _arena_ptr_;
};

Oh, I know why the pinned bots don't see this: They use goma, and goma disables pch.
Summary: Assertion failed: Layout && "Unable to find record layout information for type" on clang/tot win component bots (was: Assertion failed: Layout && "Unable to find record layout information for type" on clang/tot win component bots)
The story here is: Protobuf roll triggers existing bug that only happens with precompiled headers enabled, and only the tot bots build with precompiled headers enabled.
command-line that goes with comment 12:

 "..\..\..\..\llvm-build-relsym\bin\clang-cl" -m32 /c ..\..\net\quic\quic_connection.cc /Foobj\net\quic\net.quic_connection.obj /GR- -fmsc-version=1900 /Yubuild/precompile.h /FIbuild/precompile.h /Fpnet.precompile.h.pch

From chromium's src/, with repro.cc as in comment 12:

..\..\llvm-build-relsym\bin\clang-cl -m32 /c build\precompile.cc /FIbuild/precompile.h /Ycbuild/precompile.h /GR- -fmsc-version=1900 /Fpfoo.pch /I.
..\..\llvm-build-relsym\bin\clang-cl -m32 /c repro.cc /FIbuild/precompile.h /Yubuild/precompile.h /GR- -fmsc-version=1900 /Fpfoo.pch

-m32 /GR- flags are not necessary to repro
..\..\llvm-build-relsym\bin\clang-cl /c empty.cc /FItypeinfo /Yctypeinfo -fmsc-version=1900 /Fpfoo.pch
..\..\llvm-build-relsym\bin\clang-cl /c repro.cc /FItypeinfo /Yutypeinfo -fmsc-version=1900 /Fpfoo.pch
Standalone:

C:\src\chrome\src>type header.h
namespace std {
struct type_info {
  size_t hash_code() const { return 0; }
  virtual ~type_info();
};
}

C:\src\chrome\src>type empty.cc

C:\src\chrome\src>type repro.cc
class Params;
struct __declspec(dllexport) Visitor {
  void OnReceiveConnectionState(const Params& params) {}
};
class __declspec(dllexport) Params {
  void operator=(const Params&);
  void (*on_arena_allocation)(const std::type_info* allocated_type);
  int field() const { return field_; }
  int field_;
};

C:\src\chrome\src>..\..\llvm-build-relsym\bin\clang-cl /c empty.cc /FIheader.h /Ycheader.h -fmsc-version=1900 /Fpfoo.pch
C:\src\chrome\src>..\..\llvm-build-relsym\bin\clang-cl /c repro.cc /FIheader.h /Yuheader.h -fmsc-version=1900 /Fpfoo.pch

Assertion failed: Layout && "Unable to find record layout information for type", file C:\src\llvm-rw\tools\clang\lib\Cod
eGen\CodeGenTypes.cpp, line 734
Simpler:

C:\src\chrome\src>type header.h
struct Info {
  virtual ~Info();
  void hash() {}
};

C:\src\chrome\src>type repro.cc
class Params;
void __declspec(dllexport) use(const Params& params) {}
class __declspec(dllexport) Params {
  void operator=(const Params&);
  int field() const { return field_; }
  void (*on_arena_allocation_)(const Info* info);
  int field_;
};
creduced (couldn't figure out how to creduce the header; for creducing things with multiple input files make sure everything except the thing you want to minimize has an absolute path):

class A;
void fn1(A &) {}

class __declspec(dllexport) A {
  void operator=(A) { field_; }
  void (*on_arena_allocation_)(Info);
  int field_;
}

thakis: I just wanted to let you know that protobuf is actually not getting reverted, as the issue that was thought to be caused by protobuf roll is actually caused by something else (protobuf roll just made it harded to match with the older issue).
Labels: -Pri-3 Pri-1
That means that building with clang on Windows is currently broken unless you use goma :-/

Comment 24 by r...@chromium.org, Apr 21 2016

Maybe we should disable PCH as a quick workaround until the next clang roll?
Yes, that's a good idea. Hans just suggested that too.
Project Member

Comment 27 by bugdroid1@chromium.org, Apr 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/589ef6b6a9d60b21d6c78b92887de1b9d04b7e0f

commit 589ef6b6a9d60b21d6c78b92887de1b9d04b7e0f
Author: Nico Weber <thakis@chromium.org>
Date: Thu Apr 21 20:39:01 2016

clang/win: Disable precompiled headers.

The protobuf3 roll triggered a compiler crash in the pch codepath.

BUG= 605570 
R=hans@chromium.org

Review URL: https://codereview.chromium.org/1904193002 .

Cr-Commit-Position: refs/heads/master@{#388887}

[modify] https://crrev.com/589ef6b6a9d60b21d6c78b92887de1b9d04b7e0f/build/config/BUILD.gn
[modify] https://crrev.com/589ef6b6a9d60b21d6c78b92887de1b9d04b7e0f/build/win_precompile.gypi

Comment 28 by r...@chromium.org, Apr 21 2016

This is some amazing unexpected CodeGen re-entrancy, here's the giant stack trace:
Assertion failed: Layout && "Unable to find record layout information for type", file ..\tools\clang\lib\CodeGen\CodeGenTypes.cpp, line 748
#0 0x0000000140ca3786 HandleAbort (D:\src\llvm\build\bin\clang-cl.exe+0x12c3786)
#1 0x000007fef2364a68 raise (C:\Windows\system32\ucrtbase.DLL+0x64a68)
#2 0x000007fef2365a31 abort (C:\Windows\system32\ucrtbase.DLL+0x65a31)
#3 0x000007fef2367b3a _get_wide_winmain_command_line (C:\Windows\system32\ucrtbase.DLL+0x67b3a)
#4 0x000007fef2367a31 _get_wide_winmain_command_line (C:\Windows\system32\ucrtbase.DLL+0x67a31)
#5 0x000007fef2367d8f _wassert (C:\Windows\system32\ucrtbase.DLL+0x67d8f)
#6 0x00000001423f3fd2 clang::CodeGen::CodeGenTypes::getCGRecordLayout(class clang::RecordDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2a13fd2)
#7 0x00000001424fb400 emitAddrOfFieldStorage(class clang::CodeGen::CodeGenFunction &,class clang::CodeGen::Address,class clang::FieldDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2b1b400)
#8 0x00000001424e1945 clang::CodeGen::CodeGenFunction::EmitLValueForField(class clang::CodeGen::LValue,class clang::FieldDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2b01945)
#9 0x00000001424ee7a9 clang::CodeGen::CodeGenFunction::EmitMemberExpr(class clang::MemberExpr const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2b0e7a9)
#10 0x00000001424deaf0 clang::CodeGen::CodeGenFunction::EmitLValue(class clang::Expr const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2afeaf0)
#11 0x00000001424e7c8a clang::CodeGen::CodeGenFunction::EmitCheckedLValue(class clang::Expr const *,enum clang::CodeGen::CodeGenFunction::TypeCheckKind) (D:\src\llvm\build\bin\clang-cl.exe+0x2b07c8a)
#12 0x0000000142f25cf3 `anonymous namespace'::ScalarExprEmitter::EmitLoadOfLValue(class clang::Expr const *) (D:\src\llvm\build\bin\clang-cl.exe+0x3545cf3)
#13 0x0000000142f1e8f4 clang::StmtVisitorBase<struct clang::make_ptr,class `anonymous namespace'::ScalarExprEmitter,class llvm::Value *>::Visit(class clang::Stmt *) (D:\src\llvm\build\bin\clang-cl.exe+0x353e8f4)
#14 0x0000000142f2982a `anonymous namespace'::ScalarExprEmitter::VisitCastExpr(class clang::CastExpr *) (D:\src\llvm\build\bin\clang-cl.exe+0x354982a)
#15 0x0000000142f13671 clang::CodeGen::CodeGenFunction::EmitScalarExpr(class clang::Expr const *,bool) (D:\src\llvm\build\bin\clang-cl.exe+0x3533671)
#16 0x0000000142eb9ccb clang::CodeGen::CodeGenFunction::EmitReturnStmt(class clang::ReturnStmt const &) (D:\src\llvm\build\bin\clang-cl.exe+0x34d9ccb)
#17 0x0000000142eb7815 clang::CodeGen::CodeGenFunction::EmitStmt(class clang::Stmt const *) (D:\src\llvm\build\bin\clang-cl.exe+0x34d7815)
#18 0x0000000142ebfe7c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(class clang::CompoundStmt const &,bool,class clang::CodeGen::AggValueSlot) (D:\src\llvm\build\bin\clang-cl.exe+0x34dfe7c)
#19 0x00000001424d67d2 clang::CodeGen::CodeGenFunction::EmitFunctionBody(class clang::CodeGen::FunctionArgList &,class clang::Stmt const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2af67d2)
#20 0x00000001424d70a2 clang::CodeGen::CodeGenFunction::GenerateCode(class clang::GlobalDecl,class llvm::Function *,class clang::CodeGen::CGFunctionInfo const &) (D:\src\llvm\build\bin\clang-cl.exe+0x2af70a2)
#21 0x00000001419a0a8c clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(class clang::GlobalDecl,class llvm::GlobalValue *) (D:\src\llvm\build\bin\clang-cl.exe+0x1fc0a8c)
#22 0x000000014199bc6c clang::CodeGen::CodeGenModule::EmitGlobalDefinition(class clang::GlobalDecl,class llvm::GlobalValue *) (D:\src\llvm\build\bin\clang-cl.exe+0x1fbbc6c)
#23 0x00000001419a3045 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(class clang::Decl *) (D:\src\llvm\build\bin\clang-cl.exe+0x1fc3045)
#24 0x0000000142b9c9f1 `anonymous namespace'::CodeGeneratorImpl::EmitDeferredDecls(void) (D:\src\llvm\build\bin\clang-cl.exe+0x31bc9f1)
#25 0x0000000142b9c2e8 `anonymous namespace'::CodeGeneratorImpl::HandleTopLevelDecl(class clang::DeclGroupRef) (D:\src\llvm\build\bin\clang-cl.exe+0x31bc2e8)
#26 0x0000000141d24155 clang::BackendConsumer::HandleTopLevelDecl(class clang::DeclGroupRef) (D:\src\llvm\build\bin\clang-cl.exe+0x2344155)
#27 0x0000000141bccec2 clang::ASTReader::PassInterestingDeclsToConsumer(void) (D:\src\llvm\build\bin\clang-cl.exe+0x21ecec2)
#28 0x0000000141bd61d1 clang::ASTReader::FinishedDeserializing(void) (D:\src\llvm\build\bin\clang-cl.exe+0x21f61d1)
#29 0x00000001419fd406 clang::DeclContext::LoadLexicalDeclsFromExternalStorage(void)const  (D:\src\llvm\build\bin\clang-cl.exe+0x201d406)
#30 0x00000001419fdd3a clang::DeclContext::decls_begin(void)const  (D:\src\llvm\build\bin\clang-cl.exe+0x201dd3a)
#31 0x00000001425ec242 clang::ASTContext::getASTRecordLayout(class clang::RecordDecl const *)const  (D:\src\llvm\build\bin\clang-cl.exe+0x2c0c242)
#32 0x0000000141a42311 clang::ASTContext::getTypeInfoImpl(class clang::Type const *)const  (D:\src\llvm\build\bin\clang-cl.exe+0x2062311)
#33 0x0000000141a415d4 clang::ASTContext::getTypeInfo(class clang::Type const *)const  (D:\src\llvm\build\bin\clang-cl.exe+0x20615d4)
#34 0x0000000142416777 `anonymous namespace'::WinX86_64ABIInfo::classify(class CodeGen::QualType,unsigned int &,bool)const  (D:\src\llvm\build\bin\clang-cl.exe+0x2a36777)
#35 0x0000000142416539 `anonymous namespace'::WinX86_64ABIInfo::computeInfo(class clang::CodeGen::CGFunctionInfo &)const  (D:\src\llvm\build\bin\clang-cl.exe+0x2a36539)
#36 0x00000001425214c3 clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(class clang::CanQual<class clang::Type>,bool,bool,class llvm::ArrayRef<class clang::CanQual<class clang::Type> >,class clang::FunctionType::ExtInfo,class llvm::ArrayRef<class clang::FunctionProtoType::ExtParameterInfo>,class clang::CodeGen::RequiredArgs) (D:\src\llvm\build\bin\clang-cl.exe+0x2b414c3)
#37 0x00000001425218d3 arrangeLLVMFunctionInfo(class clang::CodeGen::CodeGenTypes &,bool,class llvm::SmallVectorImpl<class clang::CanQual<class clang::Type> > &,class clang::CanQual<class clang::FunctionProtoType>,class clang::FunctionDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2b418d3)
#38 0x000000014252165c clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType(class clang::CanQual<class clang::FunctionProtoType>,class clang::FunctionDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2b4165c)
#39 0x00000001423f364a clang::CodeGen::CodeGenTypes::ConvertFunctionType(class clang::QualType,class clang::FunctionDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2a1364a)
#40 0x00000001423f1746 clang::CodeGen::CodeGenTypes::ConvertType(class clang::QualType) (D:\src\llvm\build\bin\clang-cl.exe+0x2a11746)
#41 0x00000001423f13f2 clang::CodeGen::CodeGenTypes::ConvertTypeForMem(class clang::QualType) (D:\src\llvm\build\bin\clang-cl.exe+0x2a113f2)
#42 0x00000001423f18a8 clang::CodeGen::CodeGenTypes::ConvertType(class clang::QualType) (D:\src\llvm\build\bin\clang-cl.exe+0x2a118a8)
#43 0x00000001423f13f2 clang::CodeGen::CodeGenTypes::ConvertTypeForMem(class clang::QualType) (D:\src\llvm\build\bin\clang-cl.exe+0x2a113f2)
#44 0x0000000142f0ffdf `anonymous namespace'::CGRecordLowering::getStorageType(class clang::FieldDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x352ffdf)
#45 0x0000000142f0d422 `anonymous namespace'::CGRecordLowering::lower(bool) (D:\src\llvm\build\bin\clang-cl.exe+0x352d422)
#46 0x0000000142f0bfac clang::CodeGen::CodeGenTypes::ComputeRecordLayout(class clang::RecordDecl const *,class llvm::StructType *) (D:\src\llvm\build\bin\clang-cl.exe+0x352bfac)
#47 0x00000001423f2eba clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(class clang::RecordDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2a12eba)
#48 0x00000001423f2868 clang::CodeGen::CodeGenTypes::UpdateCompletedType(class clang::TagDecl const *) (D:\src\llvm\build\bin\clang-cl.exe+0x2a12868)
#49 0x0000000142b9c581 `anonymous namespace'::CodeGeneratorImpl::HandleTagDeclDefinition(class clang::TagDecl *) (D:\src\llvm\build\bin\clang-cl.exe+0x31bc581)
#50 0x0000000141d244a1 clang::BackendConsumer::HandleTagDeclDefinition(class clang::TagDecl *) (D:\src\llvm\build\bin\clang-cl.exe+0x23444a1)
#51 0x00000001428054f6 clang::Sema::ActOnTagFinishDefinition(class clang::Scope *,class clang::Decl *,class clang::SourceLocation) (D:\src\llvm\build\bin\clang-cl.exe+0x2e254f6)
#52 0x00000001436635bf clang::Parser::ParseCXXMemberSpecification(class clang::SourceLocation,class clang::SourceLocation,struct clang::Parser::ParsedAttributesWithRange &,unsigned int,class clang::Decl *) (D:\src\llvm\build\bin\clang-cl.exe+0x3c835bf)
#53 0x00000001436615c8 clang::Parser::ParseClassSpecifier(enum clang::tok::TokenKind,class clang::SourceLocation,class clang::DeclSpec &,struct clang::Parser::ParsedTemplateInfo const &,enum clang::AccessSpecifier,bool,enum clang::Parser::DeclSpecContext,struct clang::Parser::ParsedAttributesWithRange &) (D:\src\llvm\build\bin\clang-cl.exe+0x3c815c8)
#54 0x000000014367f4cc clang::Parser::ParseDeclarationSpecifiers(class clang::DeclSpec &,struct clang::Parser::ParsedTemplateInfo const &,enum clang::AccessSpecifier,enum clang::Parser::DeclSpecContext,class clang::Parser::LateParsedAttrList *) (D:\src\llvm\build\bin\clang-cl.exe+0x3c9f4cc)
#55 0x00000001432e9cb7 clang::Parser::ParseDeclOrFunctionDefInternal(struct clang::Parser::ParsedAttributesWithRange &,class clang::ParsingDeclSpec &,enum clang::AccessSpecifier) (D:\src\llvm\build\bin\clang-cl.exe+0x3909cb7)
#56 0x00000001432e9921 clang::Parser::ParseDeclarationOrFunctionDefinition(struct clang::Parser::ParsedAttributesWithRange &,class clang::ParsingDeclSpec *,enum clang::AccessSpecifier) (D:\src\llvm\build\bin\clang-cl.exe+0x3909921)
#57 0x00000001432e889e clang::Parser::ParseExternalDeclaration(struct clang::Parser::ParsedAttributesWithRange &,class clang::ParsingDeclSpec *) (D:\src\llvm\build\bin\clang-cl.exe+0x390889e)
#58 0x00000001432e7ae5 clang::Parser::ParseTopLevelDecl(class clang::OpaquePtr<class clang::DeclGroupRef> &) (D:\src\llvm\build\bin\clang-cl.exe+0x3907ae5)
#59 0x0000000142b1ef36 clang::ParseAST(class clang::Sema &,bool,bool) (D:\src\llvm\build\bin\clang-cl.exe+0x313ef36)
#60 0x0000000141ca971e clang::FrontendAction::Execute(void) (D:\src\llvm\build\bin\clang-cl.exe+0x22c971e)
#61 0x0000000140d6a792 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) (D:\src\llvm\build\bin\clang-cl.exe+0x138a792)
#62 0x0000000140dad56c clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) (D:\src\llvm\build\bin\clang-cl.exe+0x13cd56c)
#63 0x0000000140741bd1 cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) (D:\src\llvm\build\bin\clang-cl.exe+0xd61bd1)

I think there's a one-line fix. I'm testing it now.
Project Member

Comment 29 by bugdroid1@chromium.org, Apr 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b6d787f07401e9c72a5858a00a396981bbc018d

commit 8b6d787f07401e9c72a5858a00a396981bbc018d
Author: thakis <thakis@chromium.org>
Date: Fri Apr 22 19:42:01 2016

Revert of clang/win: Disable precompiled headers. (patchset #1 id:1 of https://codereview.chromium.org/1904193002/ )

Reason for revert:
rnk might have fixed this upstream, let's give it a try :-)

Original issue's description:
> clang/win: Disable precompiled headers.
>
> The protobuf3 roll triggered a compiler crash in the pch codepath.
>
> BUG= 605570 
> R=hans@chromium.org
>
> Committed: https://crrev.com/589ef6b6a9d60b21d6c78b92887de1b9d04b7e0f
> Cr-Commit-Position: refs/heads/master@{#388887}

TBR=hans@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 605570 

Review URL: https://codereview.chromium.org/1914673002

Cr-Commit-Position: refs/heads/master@{#389213}

[modify] https://crrev.com/8b6d787f07401e9c72a5858a00a396981bbc018d/build/config/BUILD.gn
[modify] https://crrev.com/8b6d787f07401e9c72a5858a00a396981bbc018d/build/win_precompile.gypi

Comment 30 by h...@chromium.org, Apr 22 2016

rnk's fix is Clang r267186
nice!
Blockedon: 604993
Status: ExternalDependency (was: Untriaged)
Owner: r...@chromium.org
Status: Fixed (was: ExternalDependency)

Sign in to add a comment