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

CharacterSet.isSubset() crash on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Component/s: Foundation
    • Environment:

      I'm using swift-DEVELOPMENT-SNAPSHOT-2017-05-16-a-ubuntu16.04 on Ubuntu 16.04.

      Description

      Following code will cause crash on Linux:

      import Foundation
      let set = CharacterSet()
      print(set.isSubset(of: set))
      

      From backtrace of the core dump, it seems that it is caused by a stack overflow:

          frame #80562: 0x00007f5bb17562be libFoundation.so`Foundation.NSCharacterSet.isEqual(Swift.Optional<Any>) -> Swift.Bool + 414
          frame #80563: 0x00007f5bb192c152 libFoundation.so`@objc Foundation._CFSwiftIsEqual(Swift.AnyObject, cf2: Swift.AnyObject) -> Swift.Bool + 114
          frame #80564: 0x00007f5bb17562be libFoundation.so`Foundation.NSCharacterSet.isEqual(Swift.Optional<Any>) -> Swift.Bool + 414
          frame #80565: 0x00007f5bb192c152 libFoundation.so`@objc Foundation._CFSwiftIsEqual(Swift.AnyObject, cf2: Swift.AnyObject) -> Swift.Bool + 114
          frame #80566: 0x00007f5bb17562be libFoundation.so`Foundation.NSCharacterSet.isEqual(Swift.Optional<Any>) -> Swift.Bool + 414
          frame #80567: 0x00007f5bb19ec126 libFoundation.so`(extension in Foundation):Foundation._SwiftNativeFoundationType.isEqual(Swift.AnyObject) -> Swift.Bool + 118
          frame #80568: 0x00007f5bb1a27228 libFoundation.so`static Foundation.CharacterSet.== infix(Foundation.CharacterSet, Foundation.CharacterSet) -> Swift.Bool + 72
          frame #80569: 0x00007f5bb1a2727f libFoundation.so`protocol witness for static Swift.Equatable.== infix(A, A) -> Swift.Bool in conformance Foundation.CharacterSet : Swift.Equatable in Foundation + 15
          frame #80570: 0x00007f5bb2060460 libswiftCore.so`(extension in Swift):Swift.SetAlgebra.isSubset(of: A) -> Swift.Bool + 112
          frame #80571: 0x00007ffc303c7e79 foo`main + 153
          frame #80572: 0x00007f5bb013f830 libc.so.6`__libc_start_main(main=(foo`main), argc=1, argv=0x00007ffc303c2c88, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007ffc303c2c78) at libc-start.c:291
          frame #80573: 0x00007ffc303c7cf9 foo`_start + 41

        Attachments

          Activity

            People

            Assignee:
            mattrajca Matt Rajca
            Reporter:
            dram Xin Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: