473,408 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Fatal Python error: deallocating None

It's the first time in the three years I've been using python that a
program crashes without a nice traceback to give me a clue of what
might be wrong. After searching a little, it seems it's one of those
hard to get down to cases, so I've no idea where to look for. Briefly
what I do is, select some rows from one table, do some number crunching
and insert or update rows in another table. The C extensions I'm using
are numarray and MySQLdb (indirectly, through Sqlalchemy).

What makes the problem worse is that it's not deterministic; I can
restart it from (a little before) the point of crash and it doesn't
happen again at the same point, but it might happen further down. Now,
I wouldn't mind restarting it manually every time since the crashes are
not all that frequent; problem is, it's supposed to be a long-running
process that will probably take days to finish normally, so I want it
to run overnight too. Any hints ?

Thanks,
George

Oct 26 '06 #1
2 8304
At Wednesday 25/10/2006 21:28, George Sakkis wrote:
>It's the first time in the three years I've been using python that a
program crashes without a nice traceback to give me a clue of what
might be wrong. After searching a little, it seems it's one of those
hard to get down to cases, so I've no idea where to look for. Briefly
what I do is, select some rows from one table, do some number crunching
and insert or update rows in another table. The C extensions I'm using
are numarray and MySQLdb (indirectly, through Sqlalchemy).

What makes the problem worse is that it's not deterministic; I can
restart it from (a little before) the point of crash and it doesn't
happen again at the same point, but it might happen further down. Now,
I wouldn't mind restarting it manually every time since the crashes are
not all that frequent; problem is, it's supposed to be a long-running
process that will probably take days to finish normally, so I want it
to run overnight too. Any hints ?
Mmm, it appears that one of these C extensions isn't managing the ref
count correctly - perhaps there is a return Py_None without a
previous Py_INCREF? If None were returned in certain functions to
indicate failure or something exceptional - and not a regular
condition - that would explain that it doesn't fail very often.
Unfortunately I don't know how to debug this - except by carefully
inspecting the C code :(
--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ˇgratis!
ˇAbrí tu cuenta ya! - http://correo.yahoo.com.ar
Oct 26 '06 #2
Gabriel Genellina wrote:
Mmm, it appears that one of these C extensions isn't managing the ref
count correctly - perhaps there is a return Py_None without a previous
Py_INCREF? If None were returned in certain functions to indicate
failure or something exceptional - and not a regular condition - that
would explain that it doesn't fail very often.
Unfortunately I don't know how to debug this - except by carefully
inspecting the C code :(
inserting

print sys.getrefcount(None)

at strategic locations in your code will usually help you identify the
culprit.

(last time I stumbled upon this was in an earlier release of "sqlite",
which leaked one Py_None every time you connected to the database. our
application contained a separate task that created it's own database
connection every 15:th minute or so, to calculate some statistics. and
a fresh Python interpreter contains 500-600 references to Py_None...)

</F>

Oct 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marek Baczek Baczyński | last post by:
:map ,p :!python % <cr> ,p #v+ C:\COMMAND.COM /c python items.py Fatal Python error: unknown scope for super in __init__(14) in items.py symbols: {'multirandrange': 264} locals: {} globals:...
1
by: reinhard | last post by:
Our project was developed with Python 2.0 and includes some Tk 8.3 extension widgets as well as python extensions using the CXX interface. After moving to Python 2.3 and TclTk 8.4 our program...
0
by: Vikram | last post by:
hi, i have a program which uses multiple threads and downloads pages using pycurl and processes these pages among other things. the program works fine with python 2.2 and pycurl 7.10.8 ; with...
6
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take...
0
by: Vineet Jain | last post by:
I'm running a process which uses python numeric arrays extensively and also does some calculations in c. All objects are created in python or through the Numeric library and then passed to the c...
12
by: TristaSD | last post by:
Hi, Here's a nice footer I get inside every php page I write in wwwroot on my server. The code gets parsed just fine. I installed php5.2-win32 under W2K Server, IIS 5.0. I've installed php on...
5
by: Cappy2112 | last post by:
I've just started a job which has a massive python2.3.4-centric tools installation and configuration. I know what you're going to say, but I can't upgrade and be the only one with a newer...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
1
by: mmacrobert | last post by:
Hi Everyone, I've created a 'C' dll that is accessed via ctypes library containing a bunch of functions. I've successfully been able to use the functions. However, I would like to throw python...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.