Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12406

[SwiftPM?] lldb <uninitialized> object?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
      None

      Description

      Hi all!
      I have the following piece of code (to be put in a Swift executable `main.swift` file) that used to work fine in previous versions of Xcode but doesn't work correctly on 11.4.

      import GameplayKit
      
      if #available(OSX 10.12, *) {
        let quad = GKQuad(quadMin: .zero, quadMax: .one)
        let tree = GKQuadtree(boundingQuad: quad, minimumCellSize: 1)
        let valuePosition = SIMD2<Float>.one / 2 
        tree.add(1 as NSObject, at: valuePosition)
        print(tree.elements(at: valuePosition))
      }
      

      It uses GameplayKit to add an element at one position and ask for all the elements in that same position:

      with older Xcode versions this works fine and return the element that was just added, in 11.4 it returns an empty array instead.

      Interesting parts:

      • if I use Xcode 11.4 with an old Swift 5.2 snapshot (I've tried with swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-15-a), it works correctly (aka return the element).
      • If I run the same code in a iOS app (in Xcode 11.4 with the Xcode toolchain) it works fine as well.

      This seems to be an issue when running a Swift Executable, the same issue can be repeated by running the tests of this repository. Which fail on Xcode 11.4, but pass in earlier Xcode versions, or Xcode 11.4 with an old toolchain.

      While trying to figure out what has changed I've noticed that if I try to print the `tree` object in lldb it returns `<uninitialized>`, I'm not entirely sure what it means but could this be the issue?

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            zntfdr Federico Zanetello
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: