Kitura / BlueSocket

Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.
Apache License 2.0
1.41k stars 197 forks source link

SIGSEGV: invalid address #184

Open 97mik opened 4 years ago

97mik commented 4 years ago

Sometimes got Segmentation fault crash:

* thread #11, name = 'NIO-ELT-#2', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x0000555555d45728 Run`Socket.connect(host="X.X.X.X", port=25, timeout=10000, familyOnly=false, self=<unavailable>) at Socket.swift:1890:20
   1887         
   1888         self.isConnected = true
   1889         var address: Address
-> 1890         if info!.pointee.ai_family == Int32(AF_INET6) {
   1891 
   1892             var addr = sockaddr_in6()
   1893             memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout<sockaddr_in6>.size))

Ubuntu 18.04, Swift 5.0.3