Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Help with thread related tracebacks

Reply
Thread Tools

Help with thread related tracebacks

 
 
Maxwell Hammer
Guest
Posts: n/a
 
      06-16-2005
Hope someone can help with a problem I'm having.
A python program I wrote terminates with the following traceback.

*** start traceback ***
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 22, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.4/threading.py", line 636, in __exitfunc
self._Thread__delete()
File "/usr/lib/python2.4/threading.py", line 522, in __delete
del _active[_get_ident()]
KeyError: 16384
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 22, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.4/threading.py", line 636, in __exitfunc
self._Thread__delete()
File "/usr/lib/python2.4/threading.py", line 522, in __delete
del _active[_get_ident()]
KeyError: 16384
*** end traceback ***

The program works correctly, and the traceback occurs ONLY after my
program has exited normally.

I really don't know what causes this, and since the
program is quite large I wouldn't know what code snippet to post (if any).

The following pseudocode describes what my program does:

Main thread starts
does some processing...
while...
does some processing...
loads a function from a module known only at runtime by doing:
exec 'import %s as Plugin' % PluginImportPath
exec 'PluginStartFunction=getattr(Plugin, \'%s\')' % FunctionName
PluginStartFunction(job commands...)
monitor_events()
if we have to quit:
signal threads to complete and exit.
wait for threads to indicate complete
exit
# end while


Plugin Module:
PluginStartFunction(job commands...):
does some processing...
run the module's "run" function by doing:
thread.start_new_thread(PluginRunFunction, (job commands...))
return

PluginRunFunction(job commands...):
does some processing...
spawns an external unix (console) program by doing:
RETURN=os.system(program string...)
does some processing...
return
##end Plugin Module

I have to load the plugin functions using "exec" because the plugin modules are
only known at runtime, so cannot be hard-coded.

In any case, I have made sure that the main thread does wait for all other
threads to have terminated before it calls sys.exit and exits.
It is only after main thread has exited that the above traceback occurs.

Any gurus out there that can aid with this?

Any and all help would be appreciated, even guidance as to what to investigate
or to try.

By the way what graphical debuggers do people use for debugging python apps.?

Thanks very much

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting terse tracebacks? Roy Smith Python 1 01-02-2006 03:50 AM
catching all tracebacks Timothy Smith Python 0 10-05-2005 11:54 PM
getting tracebacks from traceback objects Michael P. Soulier Python 1 06-24-2005 10:56 AM
How should threads be terminated? (related to 'Help with thread related tracebacks') Maxwell Hammer Python 7 06-18-2005 04:20 PM
tracebacks in embedded python =?ISO-8859-1?Q?Mike_M=FCller?= Python 1 07-09-2003 03:38 PM



Advertisments