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

Calendar.current.dateComponents([.weekday], from: Date()).weekday segfaults

    XMLWordPrintable

    Details

      Description

      Thanks to Mikhail Isaev we were just able to reduce the crasher to something really basic. This simple Swift program

      Calendar.current.dateComponents([.weekday], from: Date()).weekday
      

      just crashes. The problem is that transitively CFLocaleGetIdentifier gets called with

        1> import Foundation
        2> Calendar.current.dateComponents([.weekday], from: Date()).weekday
      Execution interrupted. Enter code to recover and continue.
      Enter LLDB commands to investigate (type :help for assistance.)
      Process 481 stopped
      * thread #1, name = 'repl_swift', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
          frame #0: 0x00007ffff3df8c50 libFoundation.so`CFLocaleGetIdentifier
      libFoundation.so`CFLocaleGetIdentifier:
      ->  0x7ffff3df8c50 <+0>: movq   0x18(%rdi), %rax
          0x7ffff3df8c54 <+4>: retq   
          0x7ffff3df8c55:      nopw   %cs:(%rax,%rax)
          0x7ffff3df8c5f:      nop    
      Target 0: (repl_swift) stopped.
      

        Attachments

          Activity

            People

            • Assignee:
              spevans Simon Evans
              Reporter:
              jw Johannes Weiss
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: