lmacken / pyrasite

Inject code into running Python processes

Home Page:http://pyrasite.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyImport_GetModuleDict when trying to use pyrasite

pvanderlinden opened this issue · comments

I get the follow exception on the pyrasited process:

Fatal Python error: PyImport_GetModuleDict: no module dictionary!

Current thread 0x00007fdac71ed700 (most recent call first):
  File ".../lib/python3.4/site-packages/zmq/sugar/context.py", line 44 in __del__
Aborted (core dumped)

This is in python 3.4.3, with trying to use pyrasite on a py.test run which hangs at the end of the test run.

Are you able to reproduce this with a simple time.sleep() test?

I just did this with python 3.4 and was unable to reproduce the bug. I'm guessing it's because of zeromq's C extension.

I tried to isolate it, but haven't succeeded so far (it is probably not a problem with py.test indeed). What I suspect at the moment is that Pyrasite is trying to start inside the process when a ZMQ thread is actually running (which are non-python threads).

Yeah, that's what I'm thinking as well.

It would be really difficult to handle this scenario in our injection code without some ugly hacks. However, since this whole project is based on an ugly hack, I'm all for trying it ;)