[Twisted-Python] [andrea at cpushare.com: Re: error after launching cpushare client]
Andrea Arcangeli
andrea at cpushare.com
Wed Aug 3 08:39:33 MDT 2005
Hello,
a CPUShare user reported a failure in the process protocol processEneded
method.
The status parameter passed to the processEnded callback is like this:
status.value.signal == 11
status.value.status == 139
My server code was validating the sigsegv status returned by the client,
and it noticed it wasn't 11. But status.value.signal == 11.
See the debugging patch that produced the below output:
http://www.cpushare.com/hypermail/cpushare-discuss/05/08/0018.html
How can it be that the same status has .value.signal == 11 and
.value.status == 139 at the same time?
I suspect this is a twisted bug.
Thanks for any help!
----- Forwarded message from Andrea Arcangeli <andrea at cpushare.com> -----
Date: Wed, 3 Aug 2005 16:35:37 +0200
From: Andrea Arcangeli <andrea at cpushare.com>
To: cpushare-discuss at cpushare.com
Subject: Re: error after launching cpushare client
On Wed, Aug 03, 2005 at 03:26:39PM +0200, Loïc Le Loarer wrote:
> Le Wednesday 03 August 2005 à 13:09:35 +0200, Andrea Arcangeli a écrit:
> > Hi,
> >
> > On Mon, Aug 01, 2005 at 06:36:13PM +0200, lll+cpushare at m4x.org wrote:
> > > 2005/08/01 17:48 CEST [cpushare_protocol,client] 'sigsegv not killed with signal 11: status 139.'
> >
> > This is weird, it looks like twisted reports status 139 and signal 11 at
> > the same time (while status should be 11 == signal), at first glance it
> > looks a twisted bug.
> >
> > Can you please try to apply this patch and see what it prints? (this way
> > it will be printed on the client side, previously the number 139 is
> > generated by the server side)
>
> Hi,
>
> I have applyed your patch and here is the output :
> 2005/08/03 15:23 CEST [-] Log opened.
> 2005/08/03 15:23 CEST [-] twistd 2.0.1 (/usr/bin/python 2.4.1) starting up
> 2005/08/03 15:23 CEST [-] reactor class: twisted.internet.selectreactor.SelectReactor
> 2005/08/03 15:23 CEST [-] Loading cpushare.tap...
> 2005/08/03 15:23 CEST [-] Loaded.
> 2005/08/03 15:23 CEST [-] Starting factory <cpushare.proto.cpushare_factory instance at 0xb78251ac>
> 2005/08/03 15:23 CEST [-] Enabling Multithreading.
> 2005/08/03 15:23 CEST [cpushare_protocol,client] Starting seccomp task
> 2005/08/03 15:23 CEST [-] Seccomp task gracefully killed by seccomp.
> 2005/08/03 15:23 CEST [cpushare_protocol,client] Starting seccomp task
> 2005/08/03 15:23 CEST [-] Seccomp task gracefully killed by sigsegv, status 139.
> 2005/08/03 15:23 CEST [cpushare_protocol,client] 'sigsegv not killed with signal 11: status 139.'
> 2005/08/03 15:23 CEST [cpushare_protocol,client] Lost connection. Reason: [Failure instance: Traceback (failure with no frames): twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion: Connection lost.
> 2005/08/03 15:23 CEST [cpushare_protocol,client] ]
> 2005/08/03 15:23 CEST [cpushare_protocol,client] <twisted.internet.ssl.Connector instance at 0xb783114c> will retry in 2 seconds
> 2005/08/03 15:23 CEST [cpushare_protocol,client] Stopping factory <cpushare.proto.cpushare_factory instance at 0xb78251ac>
> 2005/08/03 15:23 CEST [-] Main loop terminated.
> 2005/08/03 15:23 CEST [-] Server Shut Down.
>
> The status is 139, does this help ?
Yes it helps since it verified that for some reason twisted reports an
exit status of 139, which collides with an exist status of 11. (it
wasn't a communication error between client and server)
I think it's a twisted bug and not a mistake from my part. I'll ask on
the twisted lists to be sure. What distro/twisted are you using?
In the meantime this will work around it so you can start earning
CPUCoins ;)
Index: cpushare/proto.py
===================================================================
RCS file: /home/andrea/crypto/cvs/cpushare/client/cpushare/cpushare/proto.py,v
retrieving revision 1.49
diff -u -p -r1.49 proto.py
--- cpushare/proto.py 6 Jul 2005 23:19:02 -0000 1.49
+++ cpushare/proto.py 3 Aug 2005 14:34:34 -0000
@@ -82,7 +82,7 @@ class state_machine(object):
self.protocol.sendString(PROTO_SECCOMP_SUCCESS)
def end_failure(failure):
end_common()
- self.protocol.sendString(PROTO_SECCOMP_FAILURE + struct.pack('!i', failure.value.status))
+ self.protocol.sendString(PROTO_SECCOMP_FAILURE + struct.pack('!i', failure.value.signal))
def started(result):
self.protocol.sendString(PROTO_SECCOMP_RUN)
Thanks!
----- End forwarded message -----
More information about the Twisted-Python
mailing list