[Zope] Stable ZopeHTTP crashes on Linux - TAR problem?

Henrique Almeida almeida@uberlandia.org
Fri, 13 Aug 1999 17:55:04 -0300


Hi all.

I'm using the latest stable release in Linux 2.0.37 and Zope crashed
three times in less than 24 hours. My logs read as follows:

# cat serve.log    
Publishing module Main
Serving HTTP on port 9673 ...
----------------------------------------
Exception happened during processing of request from ('200.211.x.x',
1132)
----------------------------------------

# cat serve.errors
200.211.x.x - - [13/Aug/1999 15:27:35] "GET /abc/ HTTP/1.1" 200 -
200.211.x.x - - [13/Aug/1999 15:27:36] "GET /abc/Images/advert.gif
HTTP/1.1" 200 -
Traceback (innermost last):
  File "ZopeHTTPServer/ZopeHTTPServer.py", line 388, in handle_request
    self.process_request(request, client_address)
  File "lib/python1.5/SocketServer.py", line 239, in process_request
    self.finish_request(request, client_address)
  File "lib/python1.5/SocketServer.py", line 243, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "lib/python1.5/SocketServer.py", line 362, in __init__
    self.handle()
  File "lib/python1.5/BaseHTTPServer.py", line 258, in handle
    method()
  File "ZopeHTTPServer/ZopeHTTPServer.py", line 292, in do_GET
    self.publish_module()
  File "ZopeHTTPServer/ZopeHTTPServer.py", line 305, in publish_module
    publish_module(
  File "lib/python/ZPublisher/Publish.py", line 893, in publish_module
    if response: stdout.write(response)
  File "ZopeHTTPServer/ZopeHTTPServer.py", line 240, in write
    self.handler.wfile.write(self.data[:start]+
IOError: (32, 'Broken pipe')

Note: isn't something strange here? The logs seems to be switched.
"serve.log" have only a error message and "sever.errors" have the entire
access log.

ZopeHTTPServer.py reads on line 240 (*)
 
   def write(self,data):
        if self.latch:
            self.handler.wfile.write(data)
        else:
            self.data=self.data+data  
            start=string.find(self.data,"Status: ")
            if start != -1:
                end=string.find(self.data,"\n",start)
                status=self.data[start+8:end]
                code, message=tuple(string.split(status," ",1))
                self.handler.send_response(string.atoi(code),message)
                self.handler.wfile.write(self.data[:start]+
                    self.data[end+1:])  ---> (*)
                self.latch=1

I don't do Python but, to my knowledge, spaces are significant, aren't
they? In this case the source was only untared and not modified in any
way. It looks that a newline is the problem here, am I right?

[]s

--
Henrique Almeida           | GCS !a CS++>$ UL+++
Univ Federal de Uberlandia | W++ N+ Y+ PGP+ t++@
Uberlandia, MG, Brasil     | 5+++ X+ tv- b++ D++
almeida@uberlandia.org     | e+>++