[Twisted-Python] exceptions.SystemError: unknown opcode

Jean-Paul Calderone exarkun at divmod.com
Wed May 14 10:01:27 MDT 2008

On Wed, 14 May 2008 12:39:11 -0300, Miguel Filho <miguel.filho at gmail.com> wrote:
>On Wed, May 14, 2008 at 11:39 AM, David Ripton <dripton at ripton.net> wrote:
>> This means that Python found an illegal virtual machine instruction.
>> You can cause this by running or importing a .pyc file from a different
>> version of Python, without having a matching .py file to fall back on.
>Hmm, that stills look strange, because I didn't change anything.

Encountering this after the process has been running for a long time
suggests a memory corruption issue to me.  The fact that it happened
only once while the process is still running and correctly servicing
events further suggests that the corruption was somehow transient, a
somewhat unusual occurance to say the least. :)

Before the SystemError was raised, the process probably wrote a tiny
amount of debug information to stderr.  Is there any chance that got
logged somewhere useful?  In the normal deamonization mode of twistd
it probably would have been discarded since as part of daemonization
stdin, stdout, and stderr are all closed.  The information is barely
useful, though, so it isn't a huge loss, but at least it would point
out which code object had the bad opcode.  The traceback suggests it
was twisted.internet.selectreactor.SelectReactor.doSelect (at least,
if you're using select reactor).  You could attach gdb and check the
the opcodes in the code object for that function, but I imagine they
are correct now, since the process is still running.

So, I have no idea what happened, but it sounds interesting. :)


More information about the Twisted-Python mailing list