-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
This causes specifically with the https://github.com/Lachee/discord-rpc-csharp library for games built with unity to crash on linux as they reach the max number of open file descriptors because of all of the dangling sockets:
I built a simple C++ program to reproduce this behavior https://gist.github.com/mdsitton/95fc0040d01cdf198961cb72255c234a:
NamedPipe 24436 deck 154u unix 0x0000000032901640 0t0 1758654 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 155u unix 0x00000000d5c3a1e9 0t0 1758660 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 156u unix 0x00000000683a598f 0t0 1758661 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 157u unix 0x00000000c55ccb76 0t0 1758662 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 158u unix 0x00000000014525f2 0t0 1758663 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 159u unix 0x00000000d50b286d 0t0 1758664 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 160u unix 0x00000000e67ac18d 0t0 1758665 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 161u unix 0x00000000b56c7489 0t0 1758666 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 162u unix 0x000000005ec439e0 0t0 1758667 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 163u unix 0x0000000048697d99 0t0 1758668 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 164u unix 0x00000000134ceea6 0t0 1758669 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 165u unix 0x00000000d28c99e8 0t0 1758673 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 166u unix 0x0000000077915d8f 0t0 1758674 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 167u unix 0x000000005b9e8cf4 0t0 1758675 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 168u unix 0x00000000427a36ff 0t0 1758676 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 169u unix 0x00000000a20791de 0t0 1758677 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 170u unix 0x00000000fea049c2 0t0 1758678 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 171u unix 0x0000000096185ac3 0t0 1758679 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 172u unix 0x00000000095ce08f 0t0 1758680 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 173u unix 0x000000008790cba8 0t0 1758681 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 174u unix 0x000000000c4dd30c 0t0 1758682 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 175u unix 0x00000000d8bd7810 0t0 1758688 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 176u unix 0x00000000b0c390bf 0t0 1758689 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 177u unix 0x0000000073576f72 0t0 1758690 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 178u unix 0x00000000d50b8cda 0t0 1758691 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 179u unix 0x0000000078206672 0t0 1758692 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 180u unix 0x00000000ea085407 0t0 1758693 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 181u unix 0x00000000720ba526 0t0 1758694 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 182u unix 0x00000000f357ca4e 0t0 1758695 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 183u unix 0x00000000784fe663 0t0 1758696 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 184u unix 0x000000002008e488 0t0 1758697 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 185u unix 0x00000000390b7635 0t0 1758702 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 186u unix 0x00000000e8415e72 0t0 1758703 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 187u unix 0x00000000fcddf6dd 0t0 1758704 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 188u unix 0x0000000062727928 0t0 1758705 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 189u unix 0x00000000fa2d3c4a 0t0 1758706 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 190u unix 0x00000000a7262f67 0t0 1758707 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 191u unix 0x00000000cac478ad 0t0 1758708 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 192u unix 0x000000009f51dda5 0t0 1758709 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 193u unix 0x0000000070f71bcb 0t0 1758710 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck 194u unix 0x00000000f631da32 0t0 1758711 type=STREAM (UNCONNECTED)
(deck@steamdeck ~)$ lsof -p 24436 | grep -c STREAM
270
The issue occurs here:
https://github.com/Lachee/unity-named-pipes/blob/master/UnityNamedPipe.Native/connection_unix.cpp#L97
This happens because isOpened is only set to true if a connection is made to the input path, but we still have a socket which doesn't get closed properly.
Metadata
Metadata
Assignees
Labels
No labels