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-12169] Using objc_runtime_name causes Swift 5.2 binary segmentation fault #54594

Closed
swift-ci opened this issue Feb 10, 2020 · 9 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12169
Radar rdar://59306590
Original Reporter SvyatoslavScherbina (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

swiftc -version

Apple Swift version 5.2 (swiftlang-1103.0.22 clang-1103.0.22)
Target: x86_64-apple-darwin19.2.0

xcodebuild -version

Xcode 11.4
Build version 11N111s
Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee SvyatoslavScherbina (JIRA)
Priority Medium

md5: edadb668b27a79468187db2779386dee

is duplicated by:

  • SR-12146 Swiift 5.2 bad access _allocateUninitializedArray

Issue Description:

test.h:

#import <Foundation/Foundation.h>

__attribute__((objc_runtime_name("Foo1")))
@interface Foo : NSObject
@end;

test.m

#import "test.h"

@implementation Foo
@end;

test.swift

let n: Foo? = nil
print(n)

Compiled and run with

clang test.m -c
swiftc test.o test.swift -o test -import-objc-header test.h
./test

produces segmentation fault.

Works properly without `objc_runtime_name` attribute.

@nikolaykasyanov
Copy link

Also submitted as FB7571694.

@nikolaykasyanov
Copy link

Hey folks,

is it realistic to expect this to be fixed before Xcode 11.4 GM? How hard is it for a beginner to look into it?

Thanks!

@jckarter
Copy link
Member

jckarter commented Mar 5, 2020

@swift-ci create

@jckarter
Copy link
Member

jckarter commented Mar 5, 2020

@nikolaykasyanov
Copy link

@jckarter thank you Joe!

@nikolaykasyanov
Copy link

Hey folks, it seems like the fix hasn't made it into 5.2, has it? Is there a chance that it lands in a 5.2 patch release?

@jckarter
Copy link
Member

Sorry, the 5.2 branch wasn't taking changes by the time I could get the fix in.

@jckarter
Copy link
Member

As a workaround, you can try avoiding use of objc_runtime_name for types defined in Objective-C.

@nikolaykasyanov
Copy link

@jckarter I see, thanks for the update!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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.
Projects
None yet
Development

No branches or pull requests

3 participants