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

Sonarr version (exact version): 2.0.0.4230
Mono version (if Sonarr is not running on Windows): Running on Windows
OS: Windows 7, Current updates through June patch cycle
((Debug logs)) (posted to hastebin or similar): https://dl.dropboxusercontent.com/u/10067141/SonarrLogs20160712.zip
Description of issue:

I am experiencing random crashes of Sonarr. At the moment I have been unable to find a pattern to when the crashes occur. Everything was working fine for over a year until the most current update released. It may or may not be related, but I did notice the crashes started around the same time.

From windows event viewer:
Faulting application name: NzbDrone.exe, version: 2.0.0.4230, time stamp: 0x577bec5e
Faulting module name: clrjit.dll, version: 4.6.1076.0, time stamp: 0x56d79f64
Exception code: 0xc0000005
Fault offset: 0x0000be0b
Faulting process id: 0x4d4
Faulting application start time: 0x01d1db37aece67f3
Faulting application path: C:\ProgramData\NzbDrone\bin\NzbDrone.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
Report Id: 05c394f6-4848-11e6-93ad-00155de20406

I did notice some “System.OutOfMemoryException” errors in the log when attempting to do a Rss sync. The amount of memory in the system has not changed recently. This is the only thing so far that jumps out at me.

Please let me know if I can provide any further information. I would appreciate any suggestions anyone may have.

Thank you!
-Crenim

If anyone has any advice on this one I would sure appreciate it. Symptoms still continue and I am not having any luck chasing down the cause.

It looks like its failing inside the .net framework, I’d start with re-installing .net 4/4.5/4.6 (which ever ones don’t ship with Windows 7 and can’t be reinstalled that is).

Hey guys. Sorry for the delay in my reply.

I decided to go ahead and totally rebuild the system that I am using Sonarr on and try restoring from backup. Everything ran great for about 2 days and then the out of memory errors began again.

I swapped my operating system to Server 2012 instead of Windows 7. I also upped the memory amount available to 8GB and it seems the issues still continue even after a clean install.

If a new set of logs would be helpful, I am happy to provide.

Thanks again in advance.

A trace log of the issue would be great.

Thanks Markus. I really appreciate you taking the time to look at this.

New set of logs is located Here

You will need to enable ((trace logging)) in settings so we get the extra details in the logs.

Here is a new set of logs with trace turned on during a crash event.

It seems like the crash occurs most often when the web interface is being launched. I typically launch it from another computer and access it remotely, notice the timeout, and go find it with a crash box displayed.

Please let me know if I can provide any more details. Once again I really appreciate the time and efforts.

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.