[Twisted-Python] strange server crash

Alec Matusis matusis at yahoo.com
Mon Mar 23 03:25:45 EDT 2009


Very strange. I am not using any custom C extensions...
In the last two days, it has been under larger load, and it has not crashed.
I will update to Python 2.6 soon.

By the way, are there any gotchas in updating from Twisted-2.5 (custom patched for epoll bug)/Python 2.4 to Twisted 8.2/Python 2.6?
It's a production server, so sometimes testing under fake limited load does not reveal everything.

> -----Original Message-----
> From: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-
> bounces at twistedmatrix.com] On Behalf Of Christopher Armstrong
> Sent: Sunday, March 22, 2009 8:10 AM
> To: Twisted general discussion
> Subject: Re: [Twisted-Python] strange server crash
> 
> 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
> http://radix.twistedmatrix.com/
> http://planet-if.com/
> http://canonical.com/
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python






More information about the Twisted-Python mailing list