[Pythonmac-SIG] Python on mac - can't extend interpreter with "catch_exception_raise" wrapper.

Charlie Miller cmiller at securityevaluators.com
Sat Dec 9 03:30:33 CET 2006


Hi.  I've run into a very strange problem with Python on the mac.  I'm
trying to write a python script which will monitor an application for
exceptions.  It turns out on a mac, to do this you want to use the Mach
IPC interface, see:

http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/
http://www.wodeveloper.com/omniLists/macosx-dev/2000/June/msg00137.html

Once set up, you call the mach function exc_server which then calls
"catch_raise_exception" which you provide.  This works great in C, so I
thought I'd wrap it for python.  But, it turns out the python
interpreter already has a symbol named "catch_raise_exception", (in my
case at 0x2030 under gdb).  The problem is when exc_server calls
catch_raise_exception it calls the one from the python binary and not
the one I provided and dies.  Does anyone have any ideas on how to deal
with this perplexing problem?!?

Thanks!!!

Charlie


More information about the Pythonmac-SIG mailing list