C++ interop crash adding Strings of > 15 bytes to Swift Array. #69372
Labels
Array
Area → standard library: The `Array` type
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
c++ interop
Feature: Interoperability with C++
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
ownership
Feature: Ownership modifiers and semantics
swift to c++
Feature → c++ interop: swift to c++
swift 5.10
Description
When creating a Swift Array of Strings from C++ code (as described in the guide), adding strings with a size greater than 15 bytes causes a crash.
Steps to reproduce
The following steps reproduce the crash for me using XCode 15.0.1 (15A507) on an M1 Max MBP running Sonoma 14.1:
As per the discussion of this crash on the swift forums, it appears that the threshold for causing a crash is strings > 15 characters which corresponds to String's inline storage size.
Environment
Swift compiler version info: swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Xcode version info: Xcode 15.0.1 Build version 15A507
Deployment target: macOS Sonoma 14.1 (23B73)
The text was updated successfully, but these errors were encountered: