473,666 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_exi tfuncs:
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__d elete()
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__d elete()
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' % PluginImportPat h
exec 'PluginStartFun ction=getattr(P lugin, \'%s\')' % FunctionName
PluginStartFunc tion(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:
PluginStartFunc tion(job commands...):
does some processing...
run the module's "run" function by doing:
thread.start_ne w_thread(Plugin RunFunction, (job commands...))
return

PluginRunFuncti on(job commands...):
does some processing...
spawns an external unix (console) program by doing:
RETURN=os.syste m(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 1207

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

Similar topics

7
1783
by: Maxwell Hammer | last post by:
Hi all, This is related to an earlier post 'Help with thread related tracebacks'...for which I have had no feedback yet :-( How should a thread complete i.e. how should it exit? Reading the python online docs one gets the idea that simply returning is OK - but I'm not sure. Is it ok to do a sys.ext()? Use 'return' or just let them run out with no 'return' ???
0
1072
by: Timothy Smith | last post by:
iw ant to use a singel try except statment with my main app loop in the middle and catch all tracebacks and email them to myself as a bug report. however it seems a little more tricky then i thought try: Main.Main() except Exception, err_o: print err_o.__class__.__name__, '//', err_o, '//', err_o.args that was suggested to me however it doesn't catch the errors i made in
10
6278
by: Jim H | last post by:
I sometimes get the following error from my Form's Dispose Method when the application is closing: ------------------------------------------------- An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll Additional information: Cannot call Dispose() while doing CreateHandle(). ------------------------------------------------- How do I find out what is calling CreateHandle()? Here is the...
22
4055
by: Jeff Louie | last post by:
Well I wonder if my old brain can handle threading. Dose this code look reasonable. Regards, Jeff using System; using System.Diagnostics; using System.IO; using System.Threading;
6
10745
by: LP | last post by:
Hi, I am starting a new thread from the main UI thread. If users clicks cancel button, the thread is aborted: workerThread.Abort(); ThreadAbort Exception is handeled in the worker thread: catch (System.Threading.ThreadAbortException ex)
0
1074
by: Nathan | last post by:
Hi folks! Throughout my python development career, I've occasionally made various developer tools to show more information about assertions or exceptions with less hassle to the programmer. Until now, these tools didn't pass a utility vs pain-to-use threshold. Now I've created a tool I believe to have passed that threshold, which I call "binding annotated exception tracebacks". In short, this tool adds text showing relevant local...
5
1330
by: George Sakkis | last post by:
I'm reading the docs on sys.exc_info() but I can't tell for sure whether I'm using it safely to get a snapshot of an exception and reraise it later. The use case is a class which acts like a deferred callable, a callable that will be called at some point in the future (possibly in a different thread) and whose result or raised exception is to be stored as an attribute. This will be available by calling the result() method, which returns...
29
1774
by: Barry | last post by:
I know this is not a php question. If that bothers you, don't respond. If not, I sure could use the advice... I'm using a very abbreviated set of code to show a calendar. The idea is to simply hide the calendar when it loses focus. I'm displaying the calendar in a span tag. When that span loses focus, I recurse through its children. If focus was lost to a child, then I want to keep the calendar visible. I'm using the element.all to...
1
2755
by: Nadeem Ashraf | last post by:
Hi, We are developing a web based application "UltraLearn.com" with a mix of junior/senior Microsoft technologies. That includes Microsoft Silverlight, ASP.Net Ajax and WCF/WF. Recently, we have hit the wall with some of tested/proven technologies. The problem statement follows: We are calling a WCF Service from our site pages to track user navigation. The service in turn makes call to a gateway/server (using HttpWebRequest,...
0
8445
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.