Skip to content

Runtime memory corruption regression in Swift 5.8 #65757

Open
@anlaital

Description

@anlaital

Description

There is seemingly random runtime memory corruption happening in our iOS application when it's build with Swift 5.8 (Xcode 14.3). The corruption happens when the application is compiled with optimisations (-O) enabled and no longer occurs when optimisations are disabled (-Onone). I have not tested if similar corruption can be reproduced with -Osize.

There seems to be regression between Swift 5.7.2 (Xcode 14.2) and Swift 5.8 (Xcode 14.3) as the memory corruption started happening straight after updating.

Steps to reproduce

Unfortunately I am unable to provide steps to reproduce as the project where this issue manifests is quite large and complex, so I'm not able to isolate a repro case for it at this time.

Expected behavior

Runtime memory corruption should not happen when optimisations are enabled.

Environment

  • swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100) Target: arm64-apple-macosx13.0
  • Xcode 14.3 Build version 14E222b
  • iOS 14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.memory corruptionmissing infoResolution: Is missing crucial info such as a test case or a concise descriptionoptimized onlyFlag: An issue whose reproduction requires optimized compilationregressionswift 5.8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions