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-10269] Crash on AnyKeyPath.== infix(_:_:) only on 32-bit devices #52669

Open
swift-ci opened this issue Apr 2, 2019 · 5 comments
Open

[SR-10269] Crash on AnyKeyPath.== infix(_:_:) only on 32-bit devices #52669

swift-ci opened this issue Apr 2, 2019 · 5 comments
Labels
32 bit only bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software key paths Feature: key paths (both native and Objective-C) run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 2, 2019

Previous ID SR-10269
Radar None
Original Reporter Evilutiuoner (JIRA User)
Type Bug
Environment
  • only on iOS 10.x (32 bit devices) but it is 100% reproducible

  • only on prod or test-flight Apps, unable to reproduce on dev builds

  • Xcode 10.1 b10B61 (Swift 4.2.1)

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, 32BitOnly, KeyPaths, RunTimeCrash
Assignee None
Priority Medium

md5: ecd1b60c63f24ca82c43cc1192c6169f

Issue Description:

Crashed source code:

public enum NetModelFillingType<Model> {
    case selectedFields(keyPathes: [PartialKeyPath<Model>])
    case notSpecified
}

public protocol StandardNetModelFilling {
    associatedtype Model
    var fillMode: NetModelFillingType<Model> { get }
}

public struct UserNetModel: StandardNetModelFilling {
    public var fillMode = NetModelFillingType<UserNetModel>.notSpecified
    public var firstName: String?
    public var lastName: String?
}

var model = UserNetModel()
model.fillMode = .selectedFields(keyPathes: [\UserNetModel.firstName, \UserNetModel.lastName])


if case .selectedFields(let keyPathes) = model.fillMode {
    for keyPath in keyPathes {
        switch keyPath {
        case \UserNetModel.firstName: break
        case \UserNetModel.lastName: break // crash on accesss !!!!!!!
        default: break
        }
    }
}

Crashed stacktrace:

specialized closure #&#8203;1 in closure #&#8203;1 in static AnyKeyPath.== infix(_:_:) (<compiler-generated>)
partial apply for thunk for @callee_guaranteed (@unowned KeyPathBuffer) -> (@unowned Bool, @error @owned Error) (<compiler-genera
partial apply for thunk for @callee_guaranteed (@unowned KeyPathBuffer) -> (@unowned Bool, @error @owned Error) (<compiler-genera
thunk for @callee_guaranteed (@unowned KeyPathBuffer) -> (@unowned Bool, @error @owned Error)partial apply + 26990833
swift_errorInMain + 498610
UserEntity.updateDataFields(with:in:keyPathes:) (UserEntity.swift:115)
@belkadan
Copy link
Contributor

belkadan commented Apr 2, 2019

@mikeash, @jckarter, this is probably different from the alignment thing you were seeing in Swift 5, but does this sound familiar? Was it already fixed?

@belkadan
Copy link
Contributor

belkadan commented Apr 2, 2019

Oleg, when you say "only on prod or test-flight Apps, unable to reproduce on dev builds", is that a difference between Debug and Release builds?

@jckarter
Copy link
Member

jckarter commented Apr 2, 2019

It sounds likely to be related.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 2, 2019

Comment by Oleg Marchik (JIRA)

@belkadan Release builds (release scheme) distributed by Fabric didn't face this issue. I'm don't understand the difference between the AppStore/TestFlight build and Fabric/Xcode IPA file. Can be it connected with enabled bit code feature?

@belkadan
Copy link
Contributor

belkadan commented Apr 2, 2019

I wouldn't expect a difference either.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32 bit only bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software key paths Feature: key paths (both native and Objective-C) run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

4 participants