I have a very weird situation with docker/nginx and websockets, I proxy through nginx to a websocket server(Perfect-Websocket) and every time i close the connection the server crashes.
If i connect directly to the websocket server and close the connection its all fine.
If I run the websocket server through Xcode and nginx to that and close the connection it all works fine too.
I have check all the linux dependancies and none of them have been upgraded since Sept 2019 (only started to happen last night)
var s = new WebSocket("wss://localhost:8080/socket", "zara")
s.close();
zaraapp_1 | * thread #7, name = 'issueServer', stop reason = signal SIGPIPE
zaraapp_1 | frame #0: 0x00007ffff76832b7 libpthread.so.0`__libc_write + 71
zaraapp_1 | * thread #8, name = 'issueServer', stop reason = signal SIGPIPE
zaraapp_1 | * frame #0: 0x00007ffff76832b7 libpthread.so.0`__libc_write + 71
zaraapp_1 | frame #1: 0x00007ffff5a48be5 libcrypto.so.1.1`___lldb_unnamed_symbol314$$libcrypto.so.1.1 + 37
zaraapp_1 | frame #2: 0x00007ffff5a43f7a libcrypto.so.1.1`___lldb_unnamed_symbol239$$libcrypto.so.1.1 + 26
zaraapp_1 | frame #3: 0x00007ffff5a42fd5 libcrypto.so.1.1`___lldb_unnamed_symbol236$$libcrypto.so.1.1 + 133
zaraapp_1 | frame #4: 0x00007ffff5a43473 libcrypto.so.1.1`BIO_write + 35
zaraapp_1 | frame #5: 0x00007ffff5e84cb7 libssl.so.1.1`___lldb_unnamed_symbol113$$libssl.so.1.1 + 151
zaraapp_1 | frame #6: 0x00007ffff5e85bd5 libssl.so.1.1`___lldb_unnamed_symbol114$$libssl.so.1.1 + 3557
zaraapp_1 | frame #7: 0x00007ffff5e8f6cc libssl.so.1.1`___lldb_unnamed_symbol201$$libssl.so.1.1 + 92
zaraapp_1 | frame #8: 0x00007ffff5e8d7a5 libssl.so.1.1`___lldb_unnamed_symbol182$$libssl.so.1.1 + 197
zaraapp_1 | frame #9: 0x00007ffff5e986bf libssl.so.1.1`SSL_shutdown + 63
zaraapp_1 | frame #10: 0x0000555555c31ee0 issueServer`NetTCPSSL.close(self=<unavailable>) at NetTCPSSL.swift:355:4 [opt]
zaraapp_1 | frame #11: 0x0000555555c8a6ae issueServer`partial apply for closure #1 in WebSocket.close() [inlined] closure #1 (self=<unavailable>) -> () in PerfectWebSockets.WebSocket.close() -> () at WebSocketHandler.swift:87:17 [opt]
zaraapp_1 | frame #12: 0x0000555555c8a694 issueServer`partial apply for closure #1 in WebSocket.close() at <compiler-generated>:0 [opt]
zaraapp_1 | frame #13: 0x0000555555c90a29 issueServer`partial apply for closure #1 in WebSocket.sendMessage(opcode:bytes:final:completion:) [inlined] closure #1 (completion=0x0000000000000000) -> () in PerfectWebSockets.WebSocket.(sendMessage in _0CBBC1EF67015CC10ED91AFD31C801C6)(opcode: PerfectWebSockets.WebSocket.OpcodeType, bytes: Swift.Array<Swift.UInt8>, final: Swift.Bool, completion: () -> ()) -> () at WebSocketHandler.swift:261:4 [opt]
zaraapp_1 | frame #14: 0x0000555555c90a1f issueServer`partial apply for closure #1 in WebSocket.sendMessage(opcode:bytes:final:completion:) at <compiler-generated>:0 [opt]
zaraapp_1 | frame #15: 0x0000555555c2d0be issueServer`NetTCP.write(bytes:completion:) at NetTCP.swift:0 [opt]
zaraapp_1 | frame #16: 0x0000555555c2cfcf issueServer`NetTCP.write(byts=2 values, completion=0x0000555555c90a10 issueServer`partial apply forwarder for closure #1 (Swift.Int) -> () in PerfectWebSockets.WebSocket.(sendMessage in _0CBBC1EF67015CC10ED91AFD31C801C6)(opcode: PerfectWebSockets.WebSocket.OpcodeType, bytes: Swift.Array<Swift.UInt8>, final: Swift.Bool, completion: () -> ()) -> () at <compiler-generated>, self=<unavailable>) at NetTCP.swift:192 [opt]
zaraapp_1 | frame #17: 0x0000555555c8bb1d issueServer`WebSocket.sendMessage(op=<unavailable>, bytes=0 values, final=<unavailable>, completion=0x0000555555c90a70 issueServer`closure #1 () -> () in PerfectWebSockets.WebSocket.close() -> ()partial apply forwarder with unmangled suffix ".64", self=<unavailable>) at WebSocketHandler.swift:259:15 [opt]
zaraapp_1 | frame #18: 0x0000555555c8af09 issueServer`WebSocket.readFrame(completion:) [inlined] PerfectWebSockets.WebSocket.close(self=<unavailable>) -> () at WebSocketHandler.swift:86:9 [opt]
zaraapp_1 | frame #19: 0x0000555555c8aeea issueServer`WebSocket.readFrame(comp=<unavailable>, self=<unavailable>) at WebSocketHandler.swift:176 [opt]
zaraapp_1 | frame #20: 0x0000555555c9091b issueServer`partial apply for closure #1 in closure #2 in WebSocket.readFrame(completion:) [inlined] closure #1 (self=<unavailable>, comp=<unavailable>) -> () in closure #2 (Swift.Bool) -> () in PerfectWebSockets.WebSocket.(readFrame in _0CBBC1EF67015CC10ED91AFD31C801C6)(completion: (Swift.Optional<PerfectWebSockets.WebSocket.(Frame in _0CBBC1EF67015CC10ED91AFD31C801C6)>) -> ()) -> () at WebSocketHandler.swift:188:26 [opt]
zaraapp_1 | frame #21: 0x0000555555c90913 issueServer`partial apply for closure #1 in closure #2 in WebSocket.readFrame(completion:) at <compiler-generated>:0 [opt]
zaraapp_1 | frame #22: 0x0000555555c909f6 issueServer`partial apply for closure #1 in WebSocket.fillBufferSome(suggestion:completion:) [inlined] closure #1 (b=<unavailable>, self=<unavailable>, completion=<unavailable>) -> () in PerfectWebSockets.WebSocket.fillBufferSome(suggestion: Swift.Int, completion: () -> ()) -> () at WebSocketHandler.swift:162:4 [opt]
zaraapp_1 | frame #23: 0x0000555555c90959 issueServer`partial apply for closure #1 in WebSocket.fillBufferSome(suggestion:completion:) at <compiler-generated>:0 [opt]
zaraapp_1 | frame #24: 0x0000555555c2ca26 issueServer`NetTCP.readSomeBytes(cnt=<unavailable>, completion=0x0000555555c90930 issueServer`partial apply forwarder for closure #1 (Swift.Optional<Swift.Array<Swift.UInt8>>) -> () in PerfectWebSockets.WebSocket.fillBufferSome(suggestion: Swift.Int, completion: () -> ()) -> () at <compiler-generated>, self=<unavailable>) at NetTCP.swift:177:4 [opt]
zaraapp_1 | frame #25: 0x0000555555c8b051 issueServer`closure #2 in WebSocket.readFrame(completion:) [inlined] PerfectWebSockets.WebSocket.fillBufferSome(suggest=32768, completion=<unavailable>, self=<unavailable>) -> ()) -> () at WebSocketHandler.swift:157:15 [opt]
zaraapp_1 | frame #26: 0x0000555555c8b03b issueServer`closure #2 in WebSocket.readFrame(b=<unavailable>, comp=<unavailable>, self=<unavailable>) at WebSocketHandler.swift:187 [opt]
zaraapp_1 | frame #27: 0x0000555555c8ac23 issueServer`closure #1 in WebSocket.fillBuffer(b=<unavailable>, self=<unavailable>, completion=<unavailable>) at WebSocketHandler.swift:152:4 [opt]
zaraapp_1 | frame #28: 0x0000555555c2c4c7 issueServer`NetTCP.readBytesFully(buffer=<unavailable>, read=<unavailable>, remaining=<unavailable>, timeoutSeconds=0, completion=0x0000555555c8bc80 issueServer`partial apply forwarder for closure #1 (Swift.Optional<Swift.Array<Swift.UInt8>>) -> () in PerfectWebSockets.WebSocket.fillBuffer(demand: Swift.Int, completion: (Swift.Bool) -> ()) -> () at <compiler-generated>, self=<unavailable>) at NetTCP.swift:131:4 [opt]
zaraapp_1 | frame #29: 0x0000555555c3788e issueServer`partial apply for closure #1 in NetTCPSSL.readBytesFullyIncomplete(into:read:remaining:timeoutSeconds:completion:) [inlined] closure #1 (w=<unavailable>, completion=0x0000555555c8bc80 issueServer`partial apply forwarder for closure #1 (Swift.Optional<Swift.Array<Swift.UInt8>>) -> () in PerfectWebSockets.WebSocket.fillBuffer(demand: Swift.Int, completion: (Swift.Bool) -> ()) -> () at <compiler-generated>, self=<unavailable>, to=<unavailable>, read=<unavailable>, remaining=<unavailable>, timeoutSeconds=<unavailable>) -> () in PerfectNet.NetTCPSSL.readBytesFullyIncomplete(into: PerfectNet.ReferenceBuffer, read: Swift.Int, remaining: Swift.Int, timeoutSeconds: Swift.Double, completion: (Swift.Optional<Swift.Array<Swift.UInt8>>) -> ()) -> () at NetTCPSSL.swift:332:10 [opt]
zaraapp_1 | frame #30: 0x0000555555c37880 issueServer`partial apply for closure #1 in NetTCPSSL.readBytesFullyIncomplete(into:read:remaining:timeoutSeconds:completion:) at <compiler-generated>:0 [opt]
zaraapp_1 | frame #31: 0x0000555555c2960a issueServer`partial apply for closure #1 in closure #1 in static NetEvent.add(socket:what:timeoutSeconds:callback:) [inlined] closure #1 (callback=<unavailable>, s=<unavailable>, f=<unavailable>) -> () in closure #1 (Swift.Int32, PerfectNet.NetEvent.Filter) -> () in static PerfectNet.NetEvent.add(socket: Swift.Int32, what: PerfectNet.NetEvent.Filter, timeoutSeconds: Swift.Double, callback: (Swift.Int32, PerfectNet.NetEvent.Filter) -> ()) -> () at NetEvent.swift:275:5 [opt]
zaraapp_1 | frame #32: 0x0000555555c295ec issueServer`partial apply for closure #1 in closure #1 in static NetEvent.add(socket:what:timeoutSeconds:callback:) at <compiler-generated>:0 [opt]
zaraapp_1 | frame #33: 0x0000555555917eb9 issueServer`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0 [opt]
zaraapp_1 | frame #34: 0x00007ffff7f69547 libdispatch.so`_dispatch_call_block_and_release + 7
zaraapp_1 | frame #35: 0x00007ffff7f712aa libdispatch.so`_dispatch_continuation_pop + 410
zaraapp_1 | frame #36: 0x00007ffff7f71018 libdispatch.so`_dispatch_async_redirect_invoke + 248
zaraapp_1 | frame #37: 0x00007ffff7f7dbaa libdispatch.so`_dispatch_worker_thread + 602
zaraapp_1 | frame #38: 0x00007ffff76796db libpthread.so.0`start_thread + 219
zaraapp_1 | frame #39: 0x00007ffff47da88f libc.so.6`clone + 63