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

async let causes a segmentation fault

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:
    • Environment:

      $ swiftc --version
      Swift version 5.5 (swift-5.5-RELEASE)
      Target: x86_64-unknown-linux-gnu

      Description

      the following test program suffers a segmentation fault, on both debug and release builds:

      @main 
      enum Main 
      {
          static 
          func foo() async -> [Void]
          {
              try? await Task.sleep(nanoseconds: 1)
              return []
          }
          static 
          func main() async
          {
              async let task:Void = 
              {
                  () async -> () in 
                  try? await Task.sleep(nanoseconds: 1)
              }()
              while true 
              {
                  let _:[Void] = await Self.foo()
              }
          }
      }

      This issue is present in the 5.5-RELEASE toolchain, and all of the recent nightlies.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            taylorswift taylor swift
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: