By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,652 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,652 IT Pros & Developers. It's quick & easy.

need helping tracking down weird bug in cPickle

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.