472,139 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Help with thread related tracebacks

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

Jul 19 '05 #1
0 1090

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Timothy Smith | last post: by
22 posts views Thread by Jeff Louie | last post: by
6 posts views Thread by LP | last post: by
reply views Thread by Nathan | last post: by
5 posts views Thread by George Sakkis | last post: by
29 posts views Thread by Barry | last post: by

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.