Open jwilliamsonveeam opened 2 months ago
Does this code fail when running outside of a container (Debugging or otherwise)? Does this code fail running in the single container experience or the WSL debugging experience Can you get logs from the debugger using the steps here? When running on Linux, what distro are you using?
Hi @NCarlsonMSFT ! This is the info for the container I'm using with VS docker-compose integration: PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
If I run the same code in a Linux container started outside of visual studio and then attach a debugger the process still crashes just with my process' actual name instead of dotnet. I also used the command: DebugAdapterHost.Logging /On /OutputWindow /Verbosity:debug, which is what I assume is what you meant by getting the debugger logs, and saw a lot of handled exceptions before the process exits: Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.BadImageFormatException' in System.Reflection.Metadata.dll Exception thrown: 'System.IO.EndOfStreamException' in MyProgram.Communication.dll Exception thrown: 'System.IO.EndOfStreamException' in System.Private.CoreLib.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.8/System.Net.Quic.dll'. Symbols loaded. Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'NATS.Client.JetStream.NATSJetStreamException' in NATS.Client.dll Exception thrown: 'NATS.Client.JetStream.NATSJetStreamException' in NATS.Client.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in Npgsql.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'Npgsql.PostgresException' in System.Private.CoreLib.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll The thread 963 has exited with code 0 (0x0). Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.IO.IOException' in System.Net.Sockets.dll Exception thrown: 'System.IO.IOException' in System.Private.CoreLib.dll Exception thrown: 'System.IO.IOException' in System.Net.Security.dll Exception thrown: 'System.IO.IOException' in System.Private.CoreLib.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.JetStream.NATSJetStreamException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.NotSupportedException' in System.Net.Http.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'System.Net.Sockets.SocketException' in System.Net.Sockets.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll The program '[731] MyProgram.SubComponent' has exited with code 0 (0x0).
But when I run the same code in the same standalone container without the debugger attached everything works as expected. I wonder if all these exceptions, could be causing some problem with the debugger? Do you still want me to try it with WSL debugging?
Microsoft Visual Studio Professional 2022 Version 17.10.6 VisualStudio.17.Release/17.10.6+35201.131 Microsoft .NET Framework Version 4.8.09032
Installed Version: Professional
Visual C++ 2022 00476-80000-00000-AA511 Microsoft Visual C++ 2022
ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 17.10.344.38934 ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.10.344.38934 Azure App Service Tools v3.0.0
Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 17.10.344.38934 Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 4.10.0-3.24372.12+1c559959e2b25fea517c6f89d0c363698421865d C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
GitHub Copilot 0.2.894.62884 GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.
Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query
Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics
Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Node.js Tools 1.5.60329.1 Commit Hash:15fce86a17f9f33e5bd7ca7ccb9b216aff149252 Adds support for developing and debugging Node.js apps in Visual Studio
NpgsqlVSPackage Extension 1.0 NpgsqlVSPackage Visual Studio Extension Detailed Info
NuGet Package Manager 6.10.2 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.10.3.2427201+4f57d1de251e654812adde201c0265a8ca7ca31d Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.10.178.1 Microsoft SQL Server Data Tools
Switch Startup Project 4.2.76 Provides a toolbar dropdown box to switch between startup projects.
Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.
ToolWindowHostedEditor 1.0 Hosting json editor into a tool window
TypeScript Tools 17.0.30327.2001 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.10.0-3.24372.12+1c559959e2b25fea517c6f89d0c363698421865d Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.10.0-beta.24228.1+dd749058c91585e9b5dae62b0f8df892429ee28f Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.
WiX Toolset Visual Studio Extension 1.0.0.22 WiX Toolset Visual Studio Extension version 1.0.0.22 Copyright (c) .NET Foundation and contributors. All rights reserved.
I also used the command: DebugAdapterHost.Logging /On /OutputWindow /Verbosity:debug, which is what I assume is what you meant by getting the debugger logs
The logs should appear in the Debug Adapter Host Logs
Pane.
You can find the selection by clicking on the dropdown.
If you can get us those logs, that will help us pinpoint the error you are experiencing.
Thanks @WardenGnaw
Here are the logs right as it is exiting:
11:14:31:693 1> [DebugAdapter] <-- E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/MetaDataMemoryUsage","data":{"VS.Diagnostics.Debugger.TotalBytes":43174576.0,"VS.Diagnostics.Debugger.AdditionalModuleCount":0,"VS.Diagnostics.Debugger.vsdbg.TargetCLRVersion":"8.0.824.36612","VS.Diagnostics.Debugger.TotalModuleCount":255,"VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"12","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128"}},"seq":1349}
11:14:31:694 1> [DebugAdapter] <-- E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/StackProvider/AsyncCallstacks","data":{"VS.Diagnostics.Debugger.StackProvider.NumBreaksWithWaitingOnAsyncOperationFrames":0,"VS.Diagnostics.Debugger.StackProvider.NumBreaksWithAsyncFrames":2,"VS.Diagnostics.Debugger.StackProvider.NumBreaksWithAsyncUserFrames":2,"VS.Diagnostics.Debugger.vsdbg.TargetCLRVersion":"8.0.824.36612","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"12","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128"}},"seq":1350}
11:14:31:694 1> [DebugAdapter] <-- E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/ProcessExit","data":{"VS.Diagnostics.Debugger.vsdbg.TargetCLRVersion":"8.0.824.36612","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"12","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128"}},"seq":1351}
11:14:31:694 1> [DebugAdapter] <-- E (exited): {"type":"event","event":"exited","body":{"exitCode":0},"seq":1352}
11:14:31:695 1> State: Running => Exiting
11:14:31:695 1> [DebugAdapter] <-- E (terminated): {"type":"event","event":"terminated","body":{},"seq":1353}
11:14:31:697 1> [DebugAdapter] --> C (disconnect-40): {"type":"request","command":"disconnect","arguments":{},"seq":40}
11:14:31:699 1> [DebugAdapter] <-- E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":2,"VS.Diagnostics.Debugger.vsdbg.TargetCLRVersion":"8.0.824.36612","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"12","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"17.11.10506.2 commit:bf05b28f55d97d1bcb78f61365a1efbfdf0eb128"}},"seq":1354}
11:14:31:699 1> [DebugAdapter] <-- R (disconnect-40) [4 ms]: {"type":"response","request_seq":40,"success":true,"command":"disconnect","seq":1355}
11:14:31:699 1> State: Exiting => Exited
11:14:31:700 1> Sending VS event: IDebugProgramDestroyEvent2 (e147e9e3-6440-4073-a7b7-a65592c714b5)
11:14:31:705 1> [DebugAdapter] --> C (removeBreakpoint-41): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":14},"seq":41}
11:14:31:705 1> [DebugAdapter] --> C (removeBreakpoint-42): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":15},"seq":42}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-43): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":10},"seq":43}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-44): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":11},"seq":44}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-45): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":12},"seq":45}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-46): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":13},"seq":46}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-47): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":16},"seq":47}
11:14:31:707 1> [DebugAdapter] --> C (removeBreakpoint-48): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":1},"seq":48}
11:14:31:708 1> [DebugAdapter] --> C (removeBreakpoint-49): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":2},"seq":49}
11:14:31:708 1> [DebugAdapter] --> C (removeBreakpoint-50): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":3},"seq":50}
11:14:31:708 1> [DebugAdapter] --> C (removeBreakpoint-51): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":4},"seq":51}
11:14:31:708 1> [DebugAdapter] --> C (removeBreakpoint-52): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":6},"seq":52}
11:14:31:996 1> [DebugAdapter] --> C (removeBreakpoint-53): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":7},"seq":53}
11:14:31:996 1> [DebugAdapter] --> C (removeBreakpoint-54): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":8},"seq":54}
11:14:31:996 1> [DebugAdapter] --> C (removeBreakpoint-55): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":9},"seq":55}
11:14:31:996 1> [DebugAdapter] --> C (removeBreakpoint-56): {"type":"request","command":"removeBreakpoint","arguments":{"type":"source","id":5},"seq":56}
11:14:31:996 1> Cancelling outstanding request(s) with ID(s): 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
11:14:31:996 1> Debug adapter process exited.
I can go further back if you think it's hepful.
It's maybe worth mentioning that this code can be successfully debugged on running on windows without a container.
Could you provide more lines above the exit event? I'm looking for what command
or event
(that's not a telemetry one) that is causing the process to exit
264","source":{"name":"ExecutionContext.cs","path":"/_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs","sourceReference":0,"checksums":[{"algorithm":"SHA256","checksum":"5098771c4515b115fc5e694d8e79c3523cebd8fda4a73efa7dfa67220105a1c9"}],"vsSourceLinkInfo":{"url":"https://raw.githubusercontent.com/dotnet/runtime/08338fcaa5c9b9a8190abb99222fed12aaba956c/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs","relativeFilePath":"src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs"}},"line":264,"column":17,"endLine":264,"endColumn":40,"instructionPointerReference":"0x00007F0F42FDE553","moduleId":1000},{"id":1030,"name":"System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder
I hit the char limit so here is some more before that. @WardenGnaw
15:51:18:717 4> State: Running => Pausing
15:51:18:718 4> [DebugAdapter] --> C (threads-33): {"type":"request","command":"threads","arguments":{},"seq":33}
15:51:18:720 4> [DebugAdapter] <-- R (threads-33) [2 ms]: {"type":"response","request_seq":33,"success":true,"command":"threads","body":{"threads":[{"id":630,"name":"
From the logs it seems like a "Exception thrown: 'NATS.Client.NATSTimeoutException' in NATS.Client.dll
is causing the process to exit.
However, it may be something within the debugger or runtime is causing the process to exit.
To continue further we will need you to capture a dump of the crash to see if something is happening in the runtime.
To capture a crashdump, can you add a Environment Variable DOTNET_DbgEnableMiniDump
to 1?
You add the environment variable:
DOTNET_DbgEnableMiniDump: 1
to the environment variables of the profile that is used for the docker scenario.
Unhandled exception. System.Exception: Exception of type 'System.Exception' was thrown.
at PROGRAM PATH #
[createdump] Gathering state for process PID dotnet
[createdump] Crashing thread 012c signal 6 (0006)
[createdump] Writing minidump with heap to file /tmp/coredump.PID
[createdump] Written 118829056 bytes (29011 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 175ms
To keep your crash dump confidential, can you create an issue at https://developercommunity.visualstudio.com/VisualStudio
Feel free to paste the link to the bug here so I can assign it to myself and we can continue the discussion there.
more information about the environment variable can be found at https://learn.microsoft.com/en-us/dotnet/core/diagnostics/collect-dumps-crash.
@WardenGnaw @NCarlsonMSFT Just discovered the debugger also cashes when SSH'ed into a normal redhat VM, but the process I'm debugging continues to run. DockerTools is probably the wrong area for this. I put more info in the visualstudio.com report.
Demo example. This code write out "SUCCEED!" with no debugger attached and this fails to execute with it attached. If you check the process with the strace utility you can see with the debugger there is a SIGTRAP and there is no SIGTRAP if you don't attach a debugger. You can see the sigtrap is coming from libc.6.so from the timer call back here on line 54 https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/timer_routines.c.html
Program.cs
using System.Diagnostics; using System.Resources; using System.Runtime.InteropServices;
namespace TimerCallBackDemo;
public class Program
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void HandleTimerEvent(IntPtr sigval);
public static void Main(string[] args)
{
Thread.Sleep(30000);
HandleTimerEvent callback = HandleTimer;
int SIGEV_THREAD = 2;
IntPtr _timerId = IntPtr.Zero;
var configuration = new NativeMethods.sigevent
{
sigev_notify = SIGEV_THREAD,
sigev_value = new NativeMethods.sigval
{
sigval_ptr = _timerId
},
sigev_notify_function = Marshal.GetFunctionPointerForDelegate(callback),
};
var r1 = NativeMethods.timer_create(NativeMethods.clockid_t.CLOCK_REALTIME, configuration, out _timerId);
var newValue = new NativeMethods.itimerspec
{
it_value = new NativeMethods.timespec
{
tv_sec = 1,
tv_nsec = 1
}
};
var result = NativeMethods.timer_settime(_timerId, (int)NativeMethods.timer_flags.TIMER_ABSTIME, newValue, IntPtr.Zero);
Thread.Sleep(3000);
Console.WriteLine("SUCCESS!");
}
public static void HandleTimer(IntPtr sigval)
{
Console.WriteLine("In minimal delegate");
//_handle.Set();
}
}
NativeMethods.cs using System; using System.Runtime.InteropServices;
namespace TimerCallBackDemo;
public static class NativeMethods { [DllImport("librt.so.1", SetLastError = true, CallingConvention = CallingConvention.StdCall)] public static extern int timer_create(clockid_t clockId, sigevent callback, out IntPtr timerId);
[DllImport("librt.so.1", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
public static extern int timer_settime(IntPtr timerId, int flags, itimerspec newValue, IntPtr oldValue);
[DllImport("librt.so.1", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
public static extern int timer_delete(Int64 timerId);
// Native structures, disable struct warnings
[StructLayout(LayoutKind.Sequential)]
public struct timespec
{
public long tv_sec;
public long tv_nsec;
}
[StructLayout(LayoutKind.Sequential)]
public class itimerspec
{
public timespec it_interval;
public timespec it_value;
}
[StructLayout(LayoutKind.Sequential)]
public class sigevent
{
public sigval sigev_value;
public int sigev_signo;
public int sigev_notify;
public IntPtr sigev_notify_function;// Pointer to: delegate void sigev_notify_function(sigval arg);
public IntPtr sigev_notify_attributes;
}
[StructLayout(LayoutKind.Explicit)]
public struct sigval // Union
{
[FieldOffset(0)]
public int sival_int;
[FieldOffset(0)]
public IntPtr sigval_ptr;
}
[Flags]
public enum timer_flags
{
TIMER_RELATIVETIME = 0,
TIMER_ABSTIME = 1
}
public enum clockid_t : long
{
CLOCK_REALTIME = 0, // A settable system-wide real-time clock
CLOCK_BOOTTIME = 7, // Monotonic clock that measure time while system is suspended
CLOCK_REALTIME_ALARM = 8, // like CLOCK_REALTIME, but will wake the system if it is suspended. Same as `resume` option for Windows timer
CLOCK_BOOTTIME_ALARM = 9 // like CLOCK_BOOTTIME, but will wake the system if it is suspended. Same as `resume` option for Windows timer
}
[DllImport("libc", SetLastError = true, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
public static extern int getresuid(ref int readUserId, ref int effectiveUserId, ref int setUsedId);
[DllImport("libc", SetLastError = true, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
public static extern IntPtr getpwuid(int uid);
}
We have a certain part of our code where the dotnet console process always crashes when the debugger is attached in a docker-compose project. The code executes correctly when started without a debugger, on native linux, and native windows.
System Info
Dotnet info C:\repos> dotnet --info
Using Rancher Desktop, but also saw the same issue on other machines running Docker Desktop: Docker version 24.0.7, build afdd53b
Image: mcr.microsoft.com/dotnet/aspnet:8.0
Output from when service starts until dotnet exits:
There is nothing in my application's logs indicating any exception. The code always crashes in the same place unless I start removing objects. There is plenty of other code that runs before it crashes and it's always in one spot. Unfortunately it's proprietary code so I can't paste it here. I'm looking for other ways to dig into what might be going wrong.
I have the app set to generate crash dumps on sig term and this is what I get:
I turned on MS_VS_DOCKER_TOOLS_LOGGING_ENABLED=1 but the logs only contain messages about hot reload writing and reading to the pipe.