You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a struct containing an array of values is present in a C header file that's imported via bridging header and that struct is referenced from a Swift source file, the Swift compiler takes progressively longer to complete (on the order of dozens of seconds) until it eventually segfaults. At particularly large array sizes it eventually just abort trap 6's.
We shouldn't be crashing, so this is certainly a bug. That said, based on the comments in SR-11763, we can't allow direct access, you will need to write a few helper functions in C to manipulate the array.
Thank you! As you suggested, I worked around this by not allowing this particular header to be imported via my project's bridging header, and instead providing a wrapper API that is imported via the bridging header.
Attachment: Download
Environment
Xcode: Version 12.3 (12C33)
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Additional Detail from JIRA
md5: c1f1b83cd9f3025eea068ecf2b4d7985
relates to:
Issue Description:
Repro project:
https://github.com/jverkoey/swift_compiler_bug_large_c_struct_arrays
Reproduces every time.
When a struct containing an array of values is present in a C header file that's imported via bridging header and that struct is referenced from a Swift source file, the Swift compiler takes progressively longer to complete (on the order of dozens of seconds) until it eventually segfaults. At particularly large array sizes it eventually just abort trap 6's.
Stack trace:
The text was updated successfully, but these errors were encountered: