RoboSharp icon indicating copy to clipboard operation
RoboSharp copied to clipboard

Crash in OnExit Handler

Open zabulus opened this issue 1 year ago • 5 comments

We have a dump with unhandled exception that leads to OnExit handler with following stack:

Exception object: 000001f762e23380
Exception type:   System.NullReferenceException
Message:          Object reference not set to an instance of an object.
InnerException:   <none>
StackTrace (generated):
    SP               IP               Function
    0000006E8447F1A0 00007FFDD67877D5 RoboSharp.dll!RoboSharp.RoboCommand+<>c__DisplayClass105_1.<GetRoboCopyTask>b__2(System.Object, System.EventArgs)+0x35
    0000006E8447F1E0 00007FFE2D7AD265 System_ni!System.Diagnostics.Process.OnExited()+0xe5
    0000006E8447F230 00007FFE2D7AD316 System_ni!System.Diagnostics.Process.RaiseOnExited()+0x66
    0000006E8447F270 00007FFE2FF500B2 mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+0x172
    0000006E8447F340 00007FFE2FF4FF35 mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+0x15
    0000006E8447F370 00007FFE3092618D mscorlib_ni!System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(System.Object, Boolean)+0xed

StackTraceString: <none>
HResult: 80004003

I'm not sure the cause of exception nor what particular object is null in following code: https://github.com/tjscience/RoboSharp/blob/7b5bb3f7947a86f6345e3a3fa3c4468bdd81c58c/RoboSharp/RoboCommand.cs#L547 Basically, all event handlers should have a boundaries for an exception hence it doesn't pop up in non-user code.

zabulus avatar Mar 01 '24 22:03 zabulus

Primitive fix is here: https://github.com/zabulus/RoboSharp/tree/issue/195

zabulus avatar Mar 01 '24 22:03 zabulus

Is this still an issue in latest release?

RFBomb avatar Mar 16 '24 22:03 RFBomb

It still an issue. Exceptions should not leave handler boundaries.

zabulus avatar Mar 22 '24 19:03 zabulus

Alright. Feel free to submit a PR as we were unable to reproduce the issue.

RFBomb avatar Mar 22 '24 19:03 RFBomb

https://github.com/tjscience/RoboSharp/pull/203

zabulus avatar Mar 22 '24 19:03 zabulus