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-1901] Linker error "hidden symbol" on subclassing Thread #4133
Comments
Thanks for linking https://bugs.swift.org/browse/SR-1129 to this report. I'd love to see this issue resolved – swift-corelibs-xctest is unable to deliver on its promise of API parity with Apple XCTest due to this. Be sure to check out apple/swift#2039 for a failing test demonstrating the problem. |
Looks like some code is getting the SIL linkage wrong for the getters and setters in the v-table. |
Another example of this affecting corelibs API: #651 |
@rjmccall At least some of those symbols include private discriminators. It looks like we try to directly reference inherited private/internal vtable entries from the parent class in the subclass's vtable, which is of course totally unworkable. Foundation might be able to work around this by making the affected properties final, if possible. |
Thanks for the workaround suggestion! I tried using it for XCTest here (still waiting on CI results): apple/swift-corelibs-xctest#173 The workaround doesn't cover all cases, unfortunately. For example, XCTest has properties that have public getters, private setters, and (for the sake of API parity of Objective-C XCTest) can be overridden: https://github.com/apple/swift-corelibs-xctest/blob/3b6c476eccee86b92f215257147a5f8d0aed3ba4/Sources/XCTest/Public/XCAbstractTest.swift#L37-L42. Since these are |
I'm working on it. |
fixed in fd61338444ac42d8715fd9e637b238e035f17f8d |
Awesome![]( Thanks for the quick turnaround) Submitting a fix for the public symbols in XCTest now. |
Thanks Erik! |
Comment by David Grove (JIRA) Hi Erik Can we get this fix into the Swift3 branch as well? I just tried against swift-3.0.1-PREVIEW-3-ubuntu16.04 and the bug is still there. |
I cherry picked it into swift 3 a few days ago, so it should be on the way. |
Comment by David Grove (JIRA) Great, thanks! Sorry for not looking more closely at the Swift3 branch; missed that it was done already. |
Environment
Linux
Additional Detail from JIRA
md5: b317e664abb519336896529a6617e8d9
relates to:
Issue Description:
This code produces a linker error on Linux:
However no error if ran as a script:
$ swift Thread.swift
<no error>
The text was updated successfully, but these errors were encountered: