469,898 Members | 1,605 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

need helping tracking down weird bug in cPickle

Hey everyone, cPickle is raising an ImportError that I just don't quite
understand. Before I paste the code, let me explain the application.
Basically the part of the application that failed is a function that
loads a list of objects from a file using cPickle. This list is a queue
of requests. I've done some research and it looks like cPickle tries to
load some modules as some kind of test. From what I can tell the module
that cPickle is trying to load is a concatenation of the module that it
exists in and part of the string that was sent in the orignal request.

It looks like something where memory is getting overwritten, but I'm not
really doing anything too fancy, so i'm not sure how to approach this
problem. I'm using python2.2. Does anyone know how I might go about
trying to troubleshoot something like this? Is there a good tool or a
better method of error handling I can use to try and track this down?
Or is it better to give up troubleshooting and just upgrade to 2.4?

Here's the code where the error occured:

def initQueue():
global masterQueue
try:
queueFPtr = open("/home/build/bin/resourceManager/queue.rm","rb")
except IOError:
raise ResourceError,"Error Opening Queue for Reading"
except:
traceback.print_exc()
raise ResourceError, "Unknown Error Opening Queue"

try:
pickledList = cPickle.load(queueFPtr)
except EOFError:
masterQueue = [[],[],[]] #empty file, set to empty list for construction
#there exist 3 blank lists in the master list, these list refer to
various priorities 0, 1, and 2
queueFPtr.close()
return
except:
traceback.print_exc()
raise ResourceError, "Unknown Error loading Queue"
queueFPtr.close()
masterQueue = pickledList
return
Here's the traceback:

Traceback (most recent call last):
File "/home/build/bin/resourceManager/resourceQueue.py", line 50, in
initQueue
pickledList = cPickle.load(queueFPtr)
ImportError: No module named resourcepmdb'
Traceback (most recent call last):
File "./installimage.py", line 443, in ?
rpmdb = getResource(buildtag,buildid,"dumborpmdb","Install ing
installer
rpms")
File "/home/build/bin/resourceManager/resourceManager.py", line 39, in
getResource
resourceQueue.initQueue()
File "/home/build/bin/resourceManager/resourceQueue.py", line 58, in
initQueue
raise ResourceError, "Unknown Error loading Queue"
resourceError.ResourceError: Unknown Error loading Queue


--

Carl J. Van Arsdall
cv*********@mvista.com
Build and Release
MontaVista Software

Jun 20 '06 #1
1 1232
Carl J. Van Arsdall wrote:
Hey everyone, cPickle is raising an ImportError that I just don't quite
understand. Before I paste the code, let me explain the application.
Basically the part of the application that failed is a function that
loads a list of objects from a file using cPickle....


Loading and unloading Floating Point NaNs (Not a Numbers) is often the
source of such problems. I'd look for something like that.
They can displays as: (Inf, Ind, NaN, SNaN, QNaN) w/ or w/o a sign.
Depending on your runtimes, processor, OS, and sometimes program history
(flag manipulation), you can get these values in different ways.

--Scott David Daniels
sc***********@acm.org
Jun 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Drochom | last post: by
reply views Thread by Guenter Walser | last post: by
reply views Thread by Richard Kessler | last post: by
1 post views Thread by A.B., Khalid | last post: by
5 posts views Thread by Marcus Lowland | last post: by
reply views Thread by U S Contractors Offering Service A Non-profit | last post: by
5 posts views Thread by Victor Kryukov | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.