[Twisted-Python] strange server crash

Christopher Armstrong radix at twistedmatrix.com
Sun Mar 22 11:10:13 EDT 2009

On Sun, Mar 22, 2009 at 10:32 AM, Itamar Shtull-Trauring
<itamar at itamarst.org> wrote:
> On Sat, 2009-03-21 at 20:02 -0700, Alec Matusis wrote:
>>           File "/nail/live/im/myserv/service.py", line 1199, in logout
>>             if self.nick in session.sellers:
>>         exceptions.AttributeError: WLResultSet instance has no
>> attribute 'sellers'
>> This last error repeated about 1000 times for different clients, after
>> which the segfault occurred.
>> The problem is, that “session” is an instance of a Session class that
>> is defined in the code, it is NEITHER a Deferred NOR an instance  of
>> WLResultSet class- these are completely different classes, and there’s
>> no possible way in the code for variable session to become an instance
>> of Deferred.
> I've seen this happen - once. My guess then was memory corruption of
> some sort (somewhere in the C level). If you have any custom C
> extensions you might want to try valgrind.

I'd like to offer a slightly stronger suggestion that this segfault is
not the fault of any pure Python code (such as Twisted), but rather
some C extension that you're using, or perhaps a bug in the Python
runtime itself. The weird attribute errors for the wrong classes are
probably caused by memory corruption leading up to the segfault.

Christopher Armstrong

More information about the Twisted-Python mailing list