Get this exit code -1073741819 / 3221225477 every couple of runs in the MWE

Hi all :slight_smile:

I’ve got a script that runs the whole day, streaming data and calculating stuff every second. But around 3 hours the scripts suddenly stops with no error message, no output. I only got an error code -1073741819. (Julia 1.6.1)

What does that mean and how can I see the error?

Thanks a lot

Edit: Just get this error every 100th time. Created a MWE here:
image

julia> -1073741819 % UInt32
0xc0000005

Looking at [MS-ERREF]: NTSTATUS Values | Microsoft Learn, this is a “STATUS_ACCESS_VIOLATION” so something might have tried access memory it wasn’t allowed.

3 Likes

Thanks for your answer!
I am working on the same problem and have a follow-up question:
Are there any ways to find out where exactly in the code this problem happens?
Maybe a tool to find unsafe memory access?

All my usual techniques to find bugs have failed me on this issue as the problem only happens very sporadically and unpredictably and no error logs/stacktraces are printed as the violation crashes the whole program. The only thing to go off of is the exit code.

Thanks in advance!

Maybe it is possible to run under a debugger.

Is this on Windows? Is the Julia code calling functions from a C# shared library?

It’s on windows.

A Julia process is started via System.Diagnostics.Process.

Which debugger are you recommending?

Hmm, don’t know about that but in VisualStudio (really good debugger) if in


the window that appears when you select the above you can find the process that runs Julia, then select it. If the C# was build in debug mode any crash will lead directly to the crashing line.

Well, to e honest I’m extrapolating from my experience with C dlls that are accessed via ccall. There, I only have to attach to Julia process itself, lunch the code and voilá.
And while I’m at this I have to say that this experience degraded a lot since a couple years because now steeping in the debugger takes almost 20 seconds for each step. One more reason to dream with a Julia version compiled natively on Windows.

I narrowed down the error and got now a MWE. It happens like 1% of the time. I use 1.6.1 on Windows 10. I don’t know how test it further or debug.
I can’t add a zip here so I put it on my google drive.

ty