[SR-6616] Crash when assigning tuple with Array to UnsafeMutablePointer #49165
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
run-time crash
Bug → crash: Swift code crashed during execution
standard library
Area: Standard library umbrella
Environment
$ swift --version
Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: e84d57b482bbf3e99afff2ba5f034a9d
Issue Description:
$ cat main.swift
let p = UnsafeMutablePointer<(Int, [Int])>.allocate(capacity: 2)
p[0] = (1, [1])
p[1] = (2, [2])
Crash with EXC_BAD_ACCESS:
* thread #​1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
{{ * frame #0: 0x00000001004d2423 test`swift_release + 19}}
{{ frame #1: 0x000000010000210a test`main at main.swift:17}}
{{ frame #2: 0x00007fffd13b6235 libdyld.dylib`start + 1}}
It reproduces always when debugger connected, and in about 50% without debugger.
The text was updated successfully, but these errors were encountered: