Sonarr Crashes on Windows (NzbDrone.exe error with clrjit.dll)

The last OutOfMemoryException I see in the looks to be from the 9th, but the trace logs don’t start until after that and don’t appear to have any issues in them.

Interesting. I will watch them closely and see if I can catch it right after the next crash.

Here is a new set of logs from today.

I had an out of memory crash that looks just like the ones I have been experiencing. I can see it in the logs at 13:43. Hopefully that provides some useful information.

I have left tracing on and will continue capturing logs in case.

Here is another set of logs from today. I’ve had a couple more crashes over the last few days. Hopefully this gives you something useful to look at.

Thank you!

If you can spare a minute, it would be awesome if you could take a look at those last sets of logs, please.

For the moment I am going to set up a script to restart the service every hour to make sure it stays running.

Sorry for the delay, lots to sift through (way more and a minute or two) and I wanted to discuss it with another dev.

The fact that it dies during an RSS Sync is a symptom, not the problem itself, it just happens to be the time when memory is allocated and it becomes too much for the process. We had a few theories we tested out, but they didn’t appear tot be the cause.

We’re going to need to capture a memory dump when Sonarr is running to see what information it can give us:

  1. You’ll need to get procdump from here: https://technet.microsoft.com/en-ca/sysinternals/dd996900.aspx
  2. Extract the zip file
  3. Open a command prompt to the folder where the zip was extracted
  4. Get the process ID of Sonarr (Task manager will show you if the PID column is visible or use tasklist from a command prompt)
  5. Run procdump -m 1000 -ma [PID] where [PID] is the actual PID
  6. Wait for the procdump to complete (which will take as long as it takes to hit 1GB of memory used)

Make sure you disable your automatic restart so Sonarr has time to build up to 1GB of memory used.

Once you have the file zip it up and PM me a link to download it (dropbox should work well for it).

Hey Markus,

I just wanted to let you know that the procdump has just been started. I’ve been out of pocket for a few days.

As soon as it spits out a file I will upload it and get back to you.

Thanks again.

1 Like

I just checked the status and I had another crash.

It looks like the procdump did not spit out a file because there was not enough time for it to built up to 1000.

Error:
The process has exited.
Dump count not reached.

I can give it another go, or I can reduce the amount of memory. Please let me know your thoughts.

Let’s try reducing the threshold, 500MB is probably a good next try.

I made a go at 500MB and encountered the same issue… the next crash occurred before the memory had time to fill. After reducing down to 250MB it seemed to complete. I found the usual crash screen sitting on top of a dump file message, so I assume that’s intended behavior.

Here are the results and the latest logs with trace still enabled:
https://dl.dropboxusercontent.com/u/10067141/NzbDrone.exe_160905_202605.dmp
https://dl.dropboxusercontent.com/u/10067141/SonarrLogs20160907.zip

Thanks. Haven’t had a chance to look yet, but wanted to let you know we’ll take a look.

Thank you. Much appreciated.

@markus101, i looked at the dump but at 250mb it’s way too small, the memory layout is exactly what you’d expect.
However, if he gets a OOM exception between 250mb and 500mb, then it’s possibly a specific alloc. I’m wondering what kind of allocation in RSS could be causing the problem. Nothing big enough would make it past httpclient.

I’m thinking we need to configure his system to break at OOM. (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\GCBreakOnOOM=DWORD:2)
And use procdump -b -e -ma [PID] or procdump -b -ma [PID] not sure which, to get a dump.

Thanks guys. If there is something new you want me to try, please let me know.

Hey guys,

Just wanted to let you know what the latest version released didn’t seem to impact my crash issue positively or negatively.

Let me know if there are any more logs I can provide.

We’ll need the procdump that Taloth suggested above after making a change to the registry. Probably best to try with the first one he suggested and then the 2nd if the first doesn’t work.

@Crenim It’s actually easier:

procdump -e 1 -f "OutOfMemory" {pid}

Stupid that I didn’t figure that out before.

Thank you. I just started a new procdump using that command. I’ll let you know as soon as I have something for you guys to review.

Thank you.

I just suffered another crash and generated a dump file.

A new set of logs is located here.
The dump file is located here.

Crap, I’m so sorry.

That commandline should’ve included -ma so procdump -e 1 -f "OutOfMemory" -ma {pid} (the -ma tells procdump to make a full process memory dump instead of a partial dump.)

Semi-good news is that my debugger actually recognizes the OOM exception… just won’t tell me anything else coz it’s a partial dump.

Can you do it again with the -ma parameter included… pretty please? :slight_smile:

/me hides in a corner.