swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.6k stars 10.37k forks source link

Assertion failed: false && "Missing required conformance", file S:\SourceCache\swift\lib\AST\ASTContext.cpp, line 1317 #68380

Open brianmichel opened 1 year ago

brianmichel commented 1 year ago

Description

S:\b\1\bin\swift-ide-test.exe -print-module -module-to-print WinSDK.WinNT --source-filename=NUL -print-interface -enable-experimental-cxx-interop
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\intsafe.h:227:64: error: invalid suffix 'i128' on integer constant
#define INT128_MAX      170141183460469231731687303715884105727i128
                                                               ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\intsafe.h:228:59: error: invalid suffix 'ui128' on integer constant
#define UINT128_MAX     0xffffffffffffffffffffffffffffffffui128
                                                          ^
Assertion failed: false && "Missing required conformance", file S:\SourceCache\swift\lib\AST\ASTContext.cpp, line 1317
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: S:\\b\\1\\bin\\swift-ide-test.exe -print-module -module-to-print WinSDK.WinNT --source-filename=NUL -print-interface -enable-experimental-cxx-interop
1.      While importing macro "UNICODE_NULL"
Exception Code: 0x80000003
 #0 0x00007ff7934027b5 (S:\b\1\bin\swift-ide-test.exe+0x55927b5)
 #1 0x00007ffa636ae5f5 (C:\Windows\System32\ucrtbase.dll+0x7e5f5)
 #2 0x00007ffa636af601 (C:\Windows\System32\ucrtbase.dll+0x7f601)
 #3 0x00007ffa636b106a (C:\Windows\System32\ucrtbase.dll+0x8106a)
 #4 0x00007ffa636b0f5d (C:\Windows\System32\ucrtbase.dll+0x80f5d)
 #5 0x00007ffa636b11f1 (C:\Windows\System32\ucrtbase.dll+0x811f1)
 #6 0x00007ff78df74a8a (S:\b\1\bin\swift-ide-test.exe+0x104a8a)
 #7 0x00007ff78df7be91 (S:\b\1\bin\swift-ide-test.exe+0x10be91)
 #8 0x00007ff78f6b4dab (S:\b\1\bin\swift-ide-test.exe+0x1844dab)
 #9 0x00007ff78f6761a9 (S:\b\1\bin\swift-ide-test.exe+0x18061a9)
#10 0x00007ff78f679e37 (S:\b\1\bin\swift-ide-test.exe+0x1809e37)
#11 0x00007ff78f677028 (S:\b\1\bin\swift-ide-test.exe+0x1807028)
#12 0x00007ff78f679163 (S:\b\1\bin\swift-ide-test.exe+0x1809163)
#13 0x00007ff78f679734 (S:\b\1\bin\swift-ide-test.exe+0x1809734)
#14 0x00007ff78f62e655 (S:\b\1\bin\swift-ide-test.exe+0x17be655)
#15 0x00007ff78f62efa6 (S:\b\1\bin\swift-ide-test.exe+0x17befa6)
#16 0x00007ff78f622943 (S:\b\1\bin\swift-ide-test.exe+0x17b2943)
#17 0x00007ff78e173a65 (S:\b\1\bin\swift-ide-test.exe+0x303a65)
#18 0x00007ff78e410d57 (S:\b\1\bin\swift-ide-test.exe+0x5a0d57)
#19 0x00007ff78e439fe0 (S:\b\1\bin\swift-ide-test.exe+0x5c9fe0)
#20 0x00007ff78df23c31 (S:\b\1\bin\swift-ide-test.exe+0xb3c31)
#21 0x00007ff78df3909e (S:\b\1\bin\swift-ide-test.exe+0xc909e)
#22 0x00007ff793494550 (S:\b\1\bin\swift-ide-test.exe+0x5624550)
#23 0x00007ffa649e26ad (C:\Windows\System32\KERNEL32.DLL+0x126ad)
#24 0x00007ffa662aaa68 (C:\Windows\SYSTEM32\ntdll.dll+0x5aa68)

Steps to reproduce

Expected behavior

Environment

compnerd commented 1 year ago

CC: @hyp @egorzhdan

compnerd commented 1 year ago

This might be related to https://github.com/apple/swift/issues/62792

#define UNICODE_NULL ((WCHAR)0)

WCHAR is likely mapped to wchar_t in C++ mode.

compnerd commented 1 year ago
Assertion failed: false && "Missing required conformance", file S:\SourceCache\swift-project\swift\lib\AST\ASTContext.cpp, line 1317
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: S:\\b\\1\\bin\\swift-ide-test.exe -print-module -module-to-print WinSDK.WinNT -print-interface -source-filename NUL -enable-experimental-cxx-interop
1.      While importing macro "UNICODE_NULL"
Exception Code: 0x80000003
 #0 0x00007ff70cb7b515 HandleAbort S:\SourceCache\swift-project\llvm-project\llvm\lib\Support\Windows\Signals.inc:414:0 #1 0x00007ffbd17ee5f5 (C:\Windows\System32\ucrtbase.dll+0x7e5f5)
 #2 0x00007ffbd17ef601 (C:\Windows\System32\ucrtbase.dll+0x7f601)
 #3 0x00007ffbd17f106a (C:\Windows\System32\ucrtbase.dll+0x8106a)
 #4 0x00007ffbd17f0f5d (C:\Windows\System32\ucrtbase.dll+0x80f5d)
 #5 0x00007ffbd17f11f1 (C:\Windows\System32\ucrtbase.dll+0x811f1)
 #6 0x00007ff7076e69aa swift::ASTContext::getBuiltinInitDecl(class swift::NominalTypeDecl *, enum swift::KnownProtocolKind, class llvm::function_ref<(class swift::ASTContext &)>) const S:\SourceCache\swift-project\swift\lib\AST\ASTContext.cpp:1331:0
 #7 0x00007ff7076eddb1 swift::ASTContext::getIntBuiltinInitDecl(class swift::NominalTypeDecl *) const S:\SourceCache\swift-project\swift\lib\AST\ASTContext.cpp:1275:0
 #8 0x00007ff708e2826b swift::SwiftDeclSynthesizer::createConstant(class swift::Identifier, class swift::DeclContext *, class swift::Type, class clang::APValue const &, enum swift::ConstantConvertKind, bool, class swift::ClangNode) S:\SourceCache\swift-project\swift\lib\ClangImporter\SwiftDeclSynthesizer.cpp:265:0
 #9 0x00007ff708de9669 createMacroConstant S:\SourceCache\swift-project\swift\lib\ClangImporter\ImportMacro.cpp:79:0
#10 0x00007ff708ded2f7 clang::APValue::{dtor} S:\SourceCache\swift-project\llvm-project\clang\include\clang\AST\APValue.h:368:0
#11 0x00007ff708ded2f7 importNumericLiteral S:\SourceCache\swift-project\swift\lib\ClangImporter\ImportMacro.cpp:139:0
#12 0x00007ff708dea4e8 importLiteral S:\SourceCache\swift-project\swift\lib\ClangImporter\ImportMacro.cpp:219:0
#13 0x00007ff708dec623 importMacro S:\SourceCache\swift-project\swift\lib\ClangImporter\ImportMacro.cpp:470:0
#14 0x00007ff708decbf4 swift::ClangImporter::Implementation::importMacro(class swift::Identifier, class swift::ClangNode) S:\SourceCache\swift-project\swift\lib\ClangImporter\ImportMacro.cpp:823:0
#15 0x00007ff708da1b15 swift::ClangImporter::Implementation::lookupValue(class swift::SwiftLookupTable &, class swift::DeclName, class swift::VisibleDeclConsumer &) S:\SourceCache\swift-project\swift\lib\ClangImporter\ClangImporter.cpp:4290:0
#16 0x00007ff708da2466 swift::ClangImporter::Implementation::lookupVisibleDecls(class swift::SwiftLookupTable &, class swift::VisibleDeclConsumer &) S:\SourceCache\swift-project\swift\lib\ClangImporter\ClangImporter.cpp:4383:0
#17 0x00007ff708d95e03 swift::ClangModuleUnit::getTopLevelDecls(class llvm::SmallVectorImpl<class swift::Decl *> &) const S:\SourceCache\swift-project\swift\lib\ClangImporter\ClangImporter.cpp:3323:0
#18 0x00007ff7078e7d55 llvm::PointerIntPairInfo<swift::FileUnit *,3,llvm::PointerLikeTypeTraits<swift::FileUnit *> >::getPointer S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\PointerIntPair.h:155:0
#19 0x00007ff7078e7d55 llvm::PointerIntPair<swift::FileUnit *,3,enum swift::FileUnitKind,llvm::PointerLikeTypeTraits<swift::FileUnit *>,llvm::PointerIntPairInfo<swift::FileUnit *,3,llvm::PointerLikeTypeTraits<swift::FileUnit *> > >::getPointer S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\PointerIntPair.h:60:0
#20 0x00007ff7078e7d55 swift::FileUnit::getSynthesizedFile S:\SourceCache\swift-project\swift\lib\AST\Module.cpp:3977:0#21 0x00007ff7078e7d55 swift::ModuleDecl::getDisplayDecls(class llvm::SmallVectorImpl<class swift::Decl *> &, bool) const S:\SourceCache\swift-project\swift\lib\AST\Module.cpp:1556:0
#22 0x00007ff707b81367 swift::getTopLevelDeclsForDisplay(class swift::ModuleDecl *, class llvm::SmallVectorImpl<class swift::Decl *> &, bool) S:\SourceCache\swift-project\swift\lib\IDE\IDETypeChecking.cpp:45:0
#23 0x00007ff707baa5f0 llvm::SmallVectorBase<unsigned int>::{ctor} S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\SmallVector.h:64:0
#24 0x00007ff707baa5f0 llvm::SmallVectorTemplateCommon<swift::ImportDecl *,void>::{ctor} S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\SmallVector.h:138:0
#25 0x00007ff707baa5f0 llvm::SmallVectorTemplateBase<swift::ImportDecl *,1>::{ctor} S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\SmallVector.h:491:0
#26 0x00007ff707baa5f0 llvm::SmallVectorImpl<swift::ImportDecl *>::{ctor} S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\SmallVector.h:592:0
#27 0x00007ff707baa5f0 llvm::SmallVector<swift::ImportDecl *,1>::{ctor} S:\SourceCache\swift-project\llvm-project\llvm\include\llvm\ADT\SmallVector.h:1202:0
#28 0x00007ff707baa5f0 swift::ide::printModuleInterface(class swift::ModuleDecl *, class llvm::ArrayRef<class llvm::StringRef>, class swift::OptionSet<enum swift::ide::ModuleTraversal, unsigned int>, class swift::ASTPrinter &, struct swift::PrintOptions const &, bool) S:\SourceCache\swift-project\swift\lib\IDE\ModuleInterfacePrinting.cpp:555:0
#29 0x00007ff707695b51 std::vector<llvm::StringRef,std::allocator<llvm::StringRef> >::{dtor} C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\vector:767:0
#30 0x00007ff707695b51 doPrintModules S:\SourceCache\swift-project\swift\tools\swift-ide-test\swift-ide-test.cpp:3100:0#31 0x00007ff7076aafbe main S:\SourceCache\swift-project\swift\tools\swift-ide-test\swift-ide-test.cpp:4735:0
#32 0x00007ff70cc0d2b0 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#33 0x00007ff70cc0d2b0 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0#34 0x00007ffbd37e26ad (C:\Windows\System32\KERNEL32.DLL+0x126ad)
#35 0x00007ffbd43eaa68 (C:\Windows\SYSTEM32\ntdll.dll+0x5aa68)

Symbolicated stack trace