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-8901] Stored value type does not match pointer operand type! #51407

Closed
swift-ci opened this issue Oct 3, 2018 · 3 comments
Closed

[SR-8901] Stored value type does not match pointer operand type! #51407

swift-ci opened this issue Oct 3, 2018 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 3, 2018

Previous ID SR-8901
Radar rdar://problem/44975408
Original Reporter obbut (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10, Swift 4.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, OptimizedOnly
Assignee None
Priority Medium

md5: 44cbf1c1728fe78de219c77b74186ede

Issue Description:

Compiling this code with a release configuration causes a compiler crash. No issues on debug. The attached project has the same code.

public protocol QueryableModel {}


protocol _DocumentKeyConvertible {
    func makeDocumentKey() -> String
}


typealias DocumentKeyConvertible<M> = _DocumentKeyConvertible & PartialKeyPath<M>


extension KeyPath: _DocumentKeyConvertible where Root: QueryableModel, Value: Codable {
    func makeDocumentKey() -> String {
        return ""
    }
}


func somethingWithDocumentKeyConvertible<M>(_ something: DocumentKeyConvertible<M>) {
    print(something.makeDocumentKey())
}


struct SomeModel: QueryableModel {
    var someProperty: Int
}


somethingWithDocumentKeyConvertible(\SomeModel.someProperty)

Output from swift build --configuration release on the attached project:

Compile Swift Module 'StoredValueTypeDoesNotMatchPointerOperandTypeError' (1 sources)
Stored value type does not match pointer operand type!
  store %Ts14PartialKeyPathCy041StoredValueTypeDoesNotMatchPointerOperandF5Error9SomeModelVG* %7, %Ts14PartialKeyPathC** %3, align 8
 %Ts14PartialKeyPathC*<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken function found, compilation aborted!
0  swift                    0x000000010d43464a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010d433dfe SignalHandler(int) + 302
2  libsystem_platform.dylib 0x00007fff61069b3d _sigtramp + 29
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 2667144416
4  libsystem_c.dylib        0x00007fff60f281c9 abort + 127
5  swift                    0x00000001096bbaf7 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) + 519
6  swift                    0x000000010d3e8278 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7  swift                    0x000000010d3e815b llvm::report_fatal_error(char const*, bool) + 43
8  swift                    0x000000010d3af7e6 (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) + 54
9  swift                    0x000000010d35604e llvm::FPPassManager::runOnFunction(llvm::Function&) + 446
10 swift                    0x000000010d35e363 llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 115
11 swift                    0x000000010d35e258 llvm::legacy::FunctionPassManager::run(llvm::Function&) + 392
12 swift                    0x0000000109882228 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 4504
13 swift                    0x0000000109886e0e ThreadEntryPoint(swift::irgen::IRGenerator*, llvm::sys::SmartMutex<false>*, int) + 206
14 swift                    0x0000000109885d1e swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 7598
15 swift                    0x00000001096c7982 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 46786
16 swift                    0x00000001096b8dc5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717
17 swift                    0x000000010965ea35 main + 1349
18 libdyld.dylib            0x00007fff60e80085 start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/Sources/StoredValueTypeDoesNotMatchPointerOperandTypeError/main.swift -emit-module-path /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release/StoredValueTypeDoesNotMatchPointerOperandTypeError.swiftmodule -emit-module-doc-path /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release/StoredValueTypeDoesNotMatchPointerOperandTypeError.swiftdoc -emit-dependencies-path /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release/StoredValueTypeDoesNotMatchPointerOperandTypeError.build/StoredValueTypeDoesNotMatchPointerOperandTypeError.d -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -module-cache-path /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release/ModuleCache -swift-version 4.2 -O -D SWIFT_PACKAGE -color-diagnostics -module-name StoredValueTypeDoesNotMatchPointerOperandTypeError -num-threads 4 -o /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/x86_64-apple-macosx10.10/release/StoredValueTypeDoesNotMatchPointerOperandTypeError.build/main.swift.o 
1.  Running pass 'Module Verifier' on function '@main'
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/robbertbrandsma/Workingcopies/Speelsels/StoredValueTypeDoesNotMatchPointerOperandTypeError/.build/release.yaml main output:

@swift-ci
Copy link
Collaborator Author

swift-ci commented Oct 3, 2018

Comment by Robbert Brandsma (JIRA)

I thought this is related to SR-3204, but filed separately as requested by @belkadan

@belkadan
Copy link
Contributor

belkadan commented Oct 3, 2018

Thanks!

@swift-ci create

@aschwaighofer
Copy link
Member

Fixed by #19783

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
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 crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation
Projects
None yet
Development

No branches or pull requests

4 participants