-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet run
- Notify user of segmentation fault
#43250
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Moving to runtime as a possible apphost issue |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsI have a program that contains a memory access error leading to a segmentation fault in Linux (the actual error occurs in dynamically linked C code). When I run this program as When I run the same program with
|
Moving to host for now since the runtime is correctly bubbling up the seg fault, but dotnet run might not be showing it correctly? |
Using just the host/runtime properly shows the error:
The issue is only when going through the SDK command:
It seems like the SDK commands do some redirection for the processes it launches - |
@elinor-fung do you what stream the segfault is written to? |
Hm, apparently it is the shell's standard error, not the program's standard error. |
Interesting - so do you think that to establish correct behavior
|
Add APIs in .NET Runtime: namespace System.Diagnostics {
public partial class Process {
// existing APIs
public int ExitCode { get; }
public DateTime ExitTime { get; }
+ // WTERMSIG(wstatus), translated if recognized.
+ // As in PosixSignalRegistration, this is either
+ // a negative value for a recognized signal,
+ // or a platform-defined positive value.
+ // Zero if the process did not exit because of a signal,
+ // and always on Windows.
+ public PosixSignal ExitPosixSignal { get; }
+
+ // WCOREDUMP(wstatus).
+ // true if the signal that killed the process
+ // caused a core dump. Always false on Windows.
+ public bool ExitCoreDumped { get; }
}
}
namespace System.Runtime.InteropServices {
public static partial class Marshal {
// existing API
public static string GetPInvokeErrorMessage(int error);
+ // strsignal. Named with "description" rather than
+ // "message", for consistency with sigdescr_np.
+ public static string GetSignalDescription(PosixSignal signal);
}
} Then use those in .NET SDK, to make Somewhat related: dotnet/runtime#63532, dotnet/runtime#59746, dotnet/runtime#50527. Alternatively, if |
I have a program that contains a memory access error leading to a segmentation fault in Linux (the actual error occurs in dynamically linked C code).
When I run this program as
dotnet MyProgram.dll
, aSegmentation fault
error is shown. I believe this is printed by the Linux shell.When I run the same program with
dotnet run
, it terminates when it reaches the segmentation fault error. However no sort of error message or exception is printed. It would be helpful for debugging if the user is notified somehow of the error.The text was updated successfully, but these errors were encountered: