Page 1 of 1

Frequent Random Crashes, caused by PYTHON25.DLL

Posted: December 6th, 2010, 2:32 pm
by blkpanther
So I've been having a problem with SABnzbd crashing fairly regularly (usually mid-download). Here are the details:

Version: 0.5.6
OS: Windows 7 Ultimate 32-bit
Install Type: Windows Zip (did not use installer)
Skin: smpl (but I've used all of them with the same problem)
Firewall: Disabled locally, but the device sits behind a router with a recent build of DD-WRT running SPI enabled
IPv6: Not using, but it is enabled
Reproducible: Yes and no, I haven't found a specific action that makes it happen, but it does happen, several times a day without fail.

Event log gives the following, fairly useless detail:

Faulting application name: SABnzbd.exe, version: 0.5.6.0, time stamp: 0x4917df95
Faulting module name: PYTHON25.DLL, version: 2.5.4150.1013, time stamp: 0x49820b43
Exception code: 0xc0000005
Fault offset: 0x000d4f44
Faulting process id: 0x7c0
Faulting application start time: 0x01cb94d0dd71eff2
Faulting application path: c:\Program Files\SABnzbd\SABnzbd.exe
Faulting module path: c:\Program Files\SABnzbd\PYTHON25.DLL
Report Id: 6011a034-015b-11e0-8c99-00110981cb29

In lieu of any real way to debug or correct the problem, I've come up with the following, kludge solution:

1. Set up both SABnzbd and SickBeard as Windows Services, for ease of monitoring and remote manipulation.
2. Created a simple batch script, using built in command line utilities, and grep like functions to determine if the SABnzbd/SickBeard Service is running, if not RESTART those services. (I've attached my batch script as text at the bottom.)
3. Created a task in Windows Task Scheduler to monitor for the particular event log item that is logged when either apps crash, and execute my batch script (step 2), also I execute the check once an hour just to be sure that everything is running.

Thoughts? Did I reinvent the wheel? Does a method for monitoring and restarting SABnzbd already exist? Is there a solution to the underlying problem that I missed in my searches? It seems as though python is at fault here, not SABnzbd. Is there a way to get better crash details from python?

Thanks!
@ECHO OFF
REM Check if SABnzbd is still running
SETLOCAL
SET file="output.txt"
SET maxfilesize=0

tasklist |findstr /i /r "sabnzbd" > output.txt

for /F "usebackq" %%A IN ('%file%') DO set size=%%~zA

REM If the file is 0 bytes, then the service is not running.
if %size% EQU %maxfilesize% (
echo.The service is not running.
net stop sabnzbd
net start sabnzbd
echo.Service is now running, hopefully.
) else (
echo.The service is running!
)

del output.txt

tasklist |findstr /i /r "sickbeard" > output.txt

for /F "usebackq" %%A IN ('%file%') DO set size=%%~zA

REM If the file is 0 bytes, then the service is not running.
if %size% EQU %maxfilesize% (
echo.The service is not running.
net stop sickbeard
net start sickbeard
echo.Service is now running, hopefully.
) else (
echo.The service is running!
)

del output.txt

Re: Frequent Random Crashes, caused by PYTHON25.DLL

Posted: December 6th, 2010, 2:40 pm
by shypike
Crashing in python25.dll usually indicates trouble in Python's runtime system,
so mostly out-of-scope for us, developers.
0.5.x isn't really designed to run a Windows Service, but it should be possible.

Release 0.6.0 will have true Windows Service support, including a monitoring
service that can restart SABnzbd (both on demand and when SABnzbd should crash).
We're close to public Beta.
If you want you can join the limited distribution Alpha program.

Re: Frequent Random Crashes, caused by PYTHON25.DLL

Posted: December 7th, 2010, 5:50 pm
by blkpanther
Thanks for the info! The problem was actually still present even when not running as a service, I think it's just generally a python stability issue on my box. I'd be happy to give the Alpha a whirl though, perhaps I can contribute something! How does one go about joining the Alpha Program?

Thanks again!
shypike wrote: Crashing in python25.dll usually indicates trouble in Python's runtime system,
so mostly out-of-scope for us, developers.
0.5.x isn't really designed to run a Windows Service, but it should be possible.

Release 0.6.0 will have true Windows Service support, including a monitoring
service that can restart SABnzbd (both on demand and when SABnzbd should crash).
We're close to public Beta.
If you want you can join the limited distribution Alpha program.

Re: Frequent Random Crashes, caused by PYTHON25.DLL

Posted: December 16th, 2010, 4:59 pm
by blkpanther
Another note on this issue:

http://www.mail-archive.com/stackless@s ... 00685.html

I found an post (purportedly) from a Microsoft employee stating that Microsoft is seeing a lot of crashes (via the error reporting tool, I assume) related to Python 2.5. I'm curious, is it possible for a user like myself to drop in a replacement version of the PYTHON25.DLL? Are you using the official Python libraries or the "Stackless" libs? Is it possible to drop in a current version, like 2.7 ish?

Thanks!

Re: Frequent Random Crashes, caused by PYTHON25.DLL

Posted: December 16th, 2010, 7:02 pm
by shypike
No way can you update such files.
We have been looking at Python 2.6, but that gave errors with another file.
Still, it is odd. I have been running SABnzbd as a service for years.