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-5428] New compiler crash introduced in Xcode 9 beta 3 #3835

Closed
CharlesJS opened this issue Jul 11, 2017 · 6 comments
Closed

[SR-5428] New compiler crash introduced in Xcode 9 beta 3 #3835

CharlesJS opened this issue Jul 11, 2017 · 6 comments

Comments

@CharlesJS
Copy link

Previous ID SR-5428
Radar None
Original Reporter @CharlesJS
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 9 beta 3
Can't verify against trunk, as it is currently failing to compile

Additional Detail from JIRA
Votes 0
Component/s Compiler, Foundation
Labels Bug, 4.0Regression, CompilerCrash
Assignee @xedin
Priority Medium

md5: 2cd1d034823942311113b26acfef3307

Issue Description:

Passing a block to OperationQueue.addOperation() as an anonymous closure argument results in a compiler crash:

import Foundation

let block: (() -> ())? = { 
    print("Hello World")
    exit(0)
}

let queue = OperationQueue()

block.map { queue.addOperation($0) } // compiler crash!

CFRunLoopRun()

As this crash did not occur in Xcode 9 beta 2, it may be considered as a regression.

@belkadan
Copy link

I'm seeing

<stdin>:10:11: error: cannot convert value of type '(() -> Void) -> Void' to expected argument type '(_) -> _'
block.map { queue.addOperation($0) } // compiler crash!
          ^~~~~~~~~~~~~~~~~~~~~~~~~~

on master, which still seems wrong. @xedin, does this look familiar?

@xedin
Copy link
Member

xedin commented Jul 18, 2017

Compiles just fine now after PR apple/swift#10887 went in. CharlesS (JIRA User) Could you please try it out with the nightly build to verify?

@CharlesJS
Copy link
Author

Unfortunately, the trunk is still failing to compile for me:

[29/860] Building CXX object lib/Clang...tClangImporter.dir/ClangImporter.cpp.o
FAILED: lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/ClangImporter.cpp.o 
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++  -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/ClangImporter -I/Users/##redacted##/Development/swift/swift/lib/ClangImporter -Iinclude -I/Users/##redacted##/Development/swift/swift/include -I/Users/##redacted##/Development/swift/llvm/include -I/Users/##redacted##/Development/swift/build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/include -I/Users/##redacted##/Development/swift/build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/tools/clang/include -I/Users/##redacted##/Development/swift/llvm/tools/clang/include -I/Users/##redacted##/Development/swift/cmark/src -I/Users/##redacted##/Development/swift/build/Ninja-RelWithDebInfoAssert/cmark-macosx-x86_64/src -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fcolor-diagnostics -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2  -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk   -UNDEBUG  -fno-exceptions -fno-rtti -target x86_64-apple-macosx10.9 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -arch x86_64 -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/../../../Developer/Library/Frameworks -mmacosx-version-min=10.9 -O2 -g -UNDEBUG -MD -MT lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/ClangImporter.cpp.o -MF lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/ClangImporter.cpp.o.d -o lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/ClangImporter.cpp.o -c /Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1335:39: error: no member named 'IndexStorePath' in 'clang::FrontendOptions'
  if (!emitInstance.getFrontendOpts().IndexStorePath.empty()) {
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1337:7: error: no member named 'createIndexDataRecordingAction' in namespace 'clang::index'
      createIndexDataRecordingAction(emitInstance.getFrontendOpts(),
      ^
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1430:22: error: no member named 'IndexStorePath' in 'clang::FrontendOptions'
    if (!clangFEOpts.IndexStorePath.empty()) {
         ~~~~~~~~~~~ ^
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1434:53: error: no member named 'IndexStorePath' in 'clang::FrontendOptions'
        preservedIndexStorePathOption = clangFEOpts.IndexStorePath;
                                        ~~~~~~~~~~~ ^
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1435:21: error: no member named 'IndexStorePath' in 'clang::FrontendOptions'
        clangFEOpts.IndexStorePath.clear();
        ~~~~~~~~~~~ ^
/Users/##redacted##/Development/swift/swift/lib/ClangImporter/ClangImporter.cpp:1462:19: error: no member named 'IndexStorePath' in 'clang::FrontendOptions'
      clangFEOpts.IndexStorePath = preservedIndexStorePathOption;
      ~~~~~~~~~~~ ^
6 errors generated.
[36/860] Building CXX object lib/Front...iftFrontendTool.dir/FrontendTool.cpp.o
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

@belkadan
Copy link

That means you need to update your LLVM and Clang checkouts as well.

@CharlesJS
Copy link
Author

Git pull on both isn't sufficient?

@belkadan
Copy link

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants