StormHub / NetUV

.Net standard/Core binding for Libuv
Other
76 stars 20 forks source link

SegFault on Linux when server actively terminates client connection #60

Closed oliverw closed 7 years ago

oliverw commented 7 years ago

I'm getting repeated reports of Segfaults on Linux which all seem to be related to situations where the server actively terminates client connections.

Inspecting the core dump using gdb revealed this crash location: https://github.com/libuv/libuv/blob/v0.10/src/unix/stream.c#L867

Due to optimization being turned on it might be the assert three lines below . Another bug report points to uv__write_callbacks.

Flow of events

  1. The client's subscription to the stream of incoming messages gets disposed. This may happen from any TaskPool-Thread
  2. Therefore the actual disposal is marshalled to Event-Loop's thread using an AsyncHandle (same file, Line #172
  3. Line 174 is executing on the Event-Loop thread and the Dispose on Line #174 invokes the actual connection shutdown
  4. There's usually nothing to report beyond this point 😢
oliverw commented 7 years ago

Is ServerGC even included in .net core?

oliverw commented 7 years ago

NVM: https://stackoverflow.com/questions/44035282/how-can-i-enable-server-gc-in-net-core

StormHub commented 7 years ago

This is another reason I prefer to have some sort of channel on top of libuv handles. Yes

true
StormHub commented 7 years ago

"< ServerGarbageCollection >true< /ServerGarbageCollection >" put it in the csproj.

StormHub commented 7 years ago

Really interested in get down to the bottom of this.

oliverw commented 7 years ago

@StormHub Me. Too. By the way we could also move this conversation to a private Slack channel if you prefer.

StormHub commented 7 years ago

We can go the https://gitter.im//NetUV/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge