Closed
Description
Previous ID | SR-10776 |
Radar | None |
Original Reporter | @YOCKOW |
Type | Bug |
Status | Resolved |
Resolution | Done |
Environment
Swift 5.0.1
Ubuntu 18.04
Additional Detail from JIRA
Votes | 0 |
Component/s | Foundation |
Labels | Bug, RunTimeCrash |
Assignee | @YOCKOW |
Priority | Medium |
md5: 2dbda6a18247e0609926b22b99df2e8a
Issue Description:
The code below can be compiled, but runtime crash occurs with segfault on Linux.
import Foundation
let doc = XMLDocument(rootElement: nil)
print(doc.name)
[Result on REPL]
Process 3697 stopped
* thread #​1, name = 'repl_swift', stop reason = signal SIGSEGV: invalid address (fault address: 0x100000017)
frame #​0: 0x00007ffff3e15a2b libFoundation.so`_CFXMLNodeCopyName + 43
libFoundation.so`_CFXMLNodeCopyName:
-> 0x7ffff3e15a2b <+43>: movq 0x18(%rax), %rsi
0x7ffff3e15a2f <+47>: jmp 0x7ffff3e15a33 ; <+51>
0x7ffff3e15a31 <+49>: xorl %esi, %esi
0x7ffff3e15a33 <+51>: xorl %r14d, %r14d
Target 0: (repl_swift) stopped.
doc: Foundation.XMLDocument = <extracting data from value failed>