Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-12950] Compiler crash while merging swiftmodule in DeclSerializer, Illegal instruction: 4 #55396

Open
swift-ci opened this issue Jun 7, 2020 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 7, 2020

Previous ID SR-12950
Radar None
Original Reporter steipete (JIRA User)
Type Bug

Attachment: Download

Environment

Version 11.5 (11E608c)

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 3110cbb9eac436970856de5ffb35f4c3

Issue Description:

Compiling attached project causes error: Illegal instruction: 4 (in target 'InterposeKit' from project 'InterposeKit')

The changes that moved the project from compiling to triggering the crash are here:

steipete/InterposeKit@1fb6c6c

When I use the latest master toolchain I get an Abort trap: 6 instead with better diagnostics

1. Apple Swift version 5.3-dev (LLVM 84c026a, Swift 6bda828)

2. While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Combines, Serialization, Rest of Onone } on SIL for InterposeKit.InterposeKit)

3. While running pass #260 SILModuleTransform "SerializeSILPass".

4. While serializing type '@convention(c) (UnsafePointer<objc_super>, Selector, va_list) -> Unmanaged<AnyObject>'

5. While staging a serialized reference to PointerType 0x7fa26d0a02f0 'id *⭐(const struct objc_super *, SEL *, struct __va_list_tag)'

`-FunctionProtoType 0x7fa26d0a02b0 'id *(const struct objc_super *, SEL *, struct __va_list_tag)' cdecl

|-PointerType 0x7fa26d0a0250 'id *'

| `-ObjCObjectPointerType 0x7fa28e81b640 'id' imported

| `-ObjCObjectType 0x7fa28e81b610 'id' imported

|-PointerType 0x7fa26d0a0280 'const struct objc_super *'

| `-QualType 0x7fa26d09fc41 'const struct objc_super' const

| `-RecordType 0x7fa26d09fc40 'struct objc_super' imported

| `-Record 0x7fa26d09fba8 'objc_super'

|-PointerType 0x7fa28e81b570 'SEL *' imported

| `-BuiltinType 0x7fa28e81b400 'SEL'

`-RecordType 0x7fa28e85c4f0 'struct __va_list_tag' imported

\`-Record 0x7fa28e85c458 '\_\_va_list_tag'

0 swift 0x000000010adaaed8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40

1 swift 0x000000010adaa125 llvm::sys::RunSignalHandlers() + 85

2 swift 0x000000010adab4a6 SignalHandler(int) + 262

3 libsystem_platform.dylib 0x00007fff708ff5fd _sigtramp + 29

4 swift 0x000000010d5b3760 _dyld_private + 0

5 libsystem_c.dylib 0x00007fff707d5808 abort + 120

6 swift 0x0000000106c29697 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$1::invoke(void*, std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> > const&, bool) + 711

7 swift 0x000000010ad1e2eb llvm::report_fatal_error(llvm::Twine const&, bool) + 251

8 swift 0x000000010ad1e1e2 llvm::report_fatal_error(char const*, bool) + 50

9 swift 0x000000010752e50e swift::serialization::Serializer::addClangTypeRef(clang::Type const*) + 238

10 swift 0x0000000107569584 swift::serialization::Serializer::TypeSerializer::visitFunctionType(swift::FunctionType const*) + 84

11 swift 0x0000000107536027 swift::serialization::Serializer::writeASTBlockEntity(swift::Type) + 263

12 swift 0x00000001075372b5 bool swift::serialization::Serializer::writeASTBlockEntitiesIfNeeded<swift::serialization::Serializer::ASTBlockRecordKeeper<swift::Type, llvm::PointerEmbeddedInt<unsigned int, 31>, 1u> >(swift::serialization::Serializer::ASTBlockRecordKeeper<swift::Type, llvm::PointerEmbeddedInt<unsigned int, 31>, 1u>&) + 69

13 swift 0x000000010753715b swift::serialization::Serializer::writeAllDeclsAndTypes() + 2747

14 swift 0x0000000107538812 swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>) + 4146

15 swift 0x00000001075412e9 swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const*, swift::SerializationOptions const&) + 137

16 swift 0x000000010758c858 bool llvm::function_ref<bool (llvm::raw_pwrite_stream&)>::callback_fn<swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*)::$_10>(long, llvm::raw_pwrite_stream&) + 88

17 swift 0x0000000106c35153 void llvm::function_ref<void (llvm::raw_pwrite_stream&)>::callback_fn<swift::withOutputFile(swift::DiagnosticEngine&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>)::'lambda'(llvm::raw_pwrite_stream&)>(long, llvm::raw_pwrite_stream&) + 19

18 swift 0x0000000107d46bf0 swift::atomicallyWritingToFile(llvm::StringRef, llvm::function_ref<void (llvm::raw_pwrite_stream&)>) + 1504

19 swift 0x0000000106c35093 swift::withOutputFile(swift::DiagnosticEngine&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>) + 83

20 swift 0x0000000107541955 swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*) + 213

21 swift 0x0000000106c363e3 std::_1::function::func<performCompileStepsPostSILGen(swift::CompilerInstance&, std::1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*)::$14, std::1::allocator<performCompileStepsPostSILGen(swift::CompilerInstance&, std::1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*)::$_14>, void ()>::operator()() + 115

22 swift 0x0000000107627b54 swift::SILModule::serialize() + 36

23 swift 0x00000001073c0824 SerializeSILPass::run() + 212

24 swift 0x0000000107289b3e swift::SILPassManager::runModulePass(unsigned int) + 558

25 swift 0x000000010728e2fa swift::SILPassManager::execute() + 666

26 swift 0x0000000107286b88 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 72

27 swift 0x0000000107286b23 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 51

28 swift 0x000000010729decd swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 29

29 swift 0x000000010728ff39 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 473

30 swift 0x0000000107286cf4 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 68

31 swift 0x00000001072933b8 swift::runSILPassesForOnone(swift::SILModule&) + 72

32 swift 0x0000000106d02496 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 278

33 swift 0x0000000106c35670 performCompileStepsPostSILGen(swift::CompilerInstance&, std::_1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 912

34 swift 0x0000000106c28eb5 performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 7285

35 swift 0x0000000106c2628d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3533

36 swift 0x0000000106bc2acd main + 861

37 libdyld.dylib 0x00007fff70706cc9 start + 1

error: Abort trap: 6 (in target 'InterposeKit' from project 'InterposeKit')

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 7, 2020

Comment by Peter Steinberger (JIRA)

This might be related to SR-12945

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant