[Twisted-Python] crasher

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Oct 29 18:24:46 EST 2002


Okay, I've discovered a _very very_ odd bug in Twisted.  In trying to get this
stupid web/issues conduit thing working on Mac IE, I was trying all kinds of
crazy nonsense.  In particular there was one bit where I tried to make
issueconduit close the connection after the server sent each message, so it
would be immediately displayed, and then have the browser re-open the
connection after a second to retrieve any new messages.  (Mac IE doesn't allow
you to modify pages with Javascript that haven't been fully loaded for some
reason.) I did this using js timeouts and setting the src attribute on a hidden
iframe.

What happened next was not what I expected at all.  First, the server started
sending me the welcome message in a loop.  (This is probably just a bug in the
conduit code, nothing serious.)  However, when I entered something in the text
field and hit "enter", twistd _locked up hard_.  I couldn't even send it a
SIGTERM.  So I killed it and tried again a few times.  It would reliably lock
up after trying to send a message.  Best of all, this does not normally happen:
it is quite possible to interact with the server using the default js (with
some trivial changes); the only problem is that the updates won't show up until
the connection is finished.

The only thing I could think of that would be useful for debugging info is
strace, since it was wedged so hard and I didn't know where.  Here's what I
got:

    ...
    munmap(0x4001b000, 4096)                = 0
    close(9)                                = 0
    gettimeofday({1035895791, 342136}, NULL) = 0
    send(6, "HTTP/1.1 200 OK\r\nTransfer-encodi"..., 136, 0) = 136
    send(6, "c3\r\n<IssueBot> A SUPPORT R"..., 201, 0) = 201
    send(6, "0\r\n\r\n", 5, 0)              = 5
    gettimeofday({1035895791, 345729}, NULL) = 0
    gettimeofday({1035895791, 346897}, NULL) = 0
    write(1, "29/10/2002 06:49 [HTTPChannel,0,"..., 20529/10/2002 06:49 [HTTPChannel,0,64.123.27.109] 64.123.27.109 - - [29/Oct/2002:12:49:50 +0000] "<GET /issues.rpy/conduit?output=135 HTTP/1.1>" 200 195 "-" "Mozilla/4.0 (compatible; MSIE 5.14; Mac_PowerPC)"
    ) = 205
    brk(0x846d000)                          = 0x846d000
    old_mmap(NULL, 245760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4035b000
    brk(0x8433000)                          = 0x8433000
    mremap(0x4035b000, 245760, 245760, MREMAP_MAYMOVE) = 0x4035b000
    mremap(0x4035b000, 245760, 245760, MREMAP_MAYMOVE) = 0x4035b000
    mremap(0x4035b000, 245760, 245760, MREMAP_MAYMOVE) = 0x4035b000
    mremap(0x4035b000, 245760, 245760, MREMAP_MAYMOVE) = 0x4035b000
    ...

It then repeats "mremap" basically forever, and the various numbers there
increase very gradually.

So for some reason, Twisted is trying to allocate some huuuge chunk of memory.
Is there a way to get gdb to tell me where in python this is happening?

I am going out of my mind trying to figure out a way to debug this, so extra
eyes are helpful, but I don't think this bug can be found through normal
bughunting; you'd have to be pretty familiar with whatever code is causing the
problem.  I figure it might be either woven, twisted.protocols.http or
twisted.internet.

Help? :-)

-- 
 |    <`'>    |  Glyph Lefkowitz: Traveling Sorcerer   |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20021029/e042314a/attachment.pgp 


More information about the Twisted-Python mailing list