Attempts to use dispatch_semaphore_create() in a Swift playground lead to an unrecoverable error
| Originator: | kristopherdjohnson | ||
| Number: | rdar://17275287 | Date Originated: | 11-Jun-2014 04:59 PM |
| Status: | Duplicate/17214589 | Resolved: | |
| Product: | Developer Tools | Product Version: | Version 6.0 (6A215l) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
Attempts to use dispatch_semaphore_create() in a Swift playground lead to an unrecoverable error.
Steps to Reproduce:
Paste this code into a new Swift playground:
import Foundation
let sem = dispatch_semaphore_create(0)
Expected Results:
Playground should display some sort of value for the sem variable, and allow additional code to use that value.
Actual Results:
Console Output contains the following text:
fatal error: Can't unwrap Optional.None
Playground execution failed: error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
* thread #1: tid = 0x1bd9b3, 0x000000010dfd802d libswift_stdlib_core.dylib`Swift._StringCore._growBuffer (@inout Swift._StringCore)(Swift.Int, minElementWidth : Swift.Int) -> Swift.COpaquePointer + 813, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
* frame #0: 0x000000010dfd802d libswift_stdlib_core.dylib`Swift._StringCore._growBuffer (@inout Swift._StringCore)(Swift.Int, minElementWidth : Swift.Int) -> Swift.COpaquePointer + 813
frame #1: 0x000000010dfd343f libswift_stdlib_core.dylib`Swift._StringCore.append (@inout Swift._StringCore)(Swift._StringCore) -> () + 607
frame #2: 0x000000010dfd3fa5 libswift_stdlib_core.dylib`Swift.+ @infix (Swift.String, Swift.String) -> Swift.String + 117
frame #3: 0x000000010e195a97 PlaygroundLogger`Swift.String._workaround17041741 (Swift.String)() -> Swift.String + 87
frame #4: 0x000000010e1948e2 PlaygroundLogger`Swift.String.byteLength (Swift.String)() -> Swift.Int + 82
frame #5: 0x000000010e18617f PlaygroundLogger`PlaygroundLogger.BytesStream.write (PlaygroundLogger.BytesStream)(Swift.String) -> PlaygroundLogger.BytesStream + 127
frame #6: 0x000000010e18ddbf PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_structured_impl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 2143
frame #7: 0x000000010e188e0c PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_structured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64, PlaygroundLogger.LoggerCappingPolicy) -> () + 1996
frame #8: 0x000000010e189e7d PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_structured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64) -> () + 989
frame #9: 0x000000010e18f856 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64) -> () + 2486
frame #10: 0x000000010e18a899 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_children (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64, Swift.Range<Swift.UInt64>) -> () + 2233
frame #11: 0x000000010e18e96a PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_structured_impl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 5130
frame #12: 0x000000010e188e0c PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode_structured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.Mirror, Swift.UInt64, PlaygroundLo
Version:
Xcode Version 6.0 (6A215l)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!