aspnetcore: On Linux, failing to bind the address on Start generates a coredump

When starting Kestrel on a port that is taken an exception is thrown. e.g.:

System.IO.IOException: Failed to bind to address https://127.0.0.1:5001: address already in use

Since this exception is not handled, the runtime calls abort which (normally) generates a coredump (see https://github.com/dotnet/coreclr/issues/17929).

The behavior seems excessive for failing to bind the port. Maybe there should be a try/catch somewhere to turn this into a non-success process exit? It may not be obvious these coredumps are being generated. And when seeing these dumps on their system, users may get the wrong impression dotnet failed in some bad way.

CC @davidfowl @halter73 @mikem8361

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (32 by maintainers)

Most upvoted comments

As far as the runtime’s concerned a unhandled exception is an abnormal process termination. The runtime has always called abort or on Windows TerminateProcess in these cases. All the other distros and Windows don’t generate a core dump by default.

/cc: @jkotas