Last Comment Bug 744929 - Snappy Symbolication Server - Mismatched Content-Length and body length may result in exception
: Snappy Symbolication Server - Mismatched Content-Length and body length may r...
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: Gecko Profiler (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks: 744126
  Show dependency treegraph
 
Reported: 2012-04-12 13:35 PDT by David Chan [:dchan]
Modified: 2012-04-16 09:49 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description David Chan [:dchan] 2012-04-12 13:35:58 PDT
This may be the expected behavior of the underlying library.

STR
1. curl -H "Content-Length: 1" -d ""  http://127.0.0.1:8000/
2. Terminate curl on client with Ctrl-C

Expected
No exception?

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 64014)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 323, in handle_one_request
    method()
  File "symbolicationWebService.py", line 82, in do_POST
    self.sendHeaders(400)
  File "symbolicationWebService.py", line 50, in sendHeaders
    self.send_response(errorCode)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 384, in send_response
    self.send_header('Server', self.version_string())
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 390, in send_header
    self.wfile.write("%s: %s\r\n" % (keyword, value))
  File "/usr/lib/python2.6/socket.py", line 318, in write
    self.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
----------------------------------------
Comment 1 Vladan Djeric (:vladan) 2012-04-13 17:56:31 PDT
I added a check for mismatched Content-Length and body length which prevents this exception.

Patch with all the sec-review fixes: https://github.com/vdjeric/Snappy-Symbolication-Server/commit/67705706c605984e220f69469a68b455813923f5

I think the true cause of this exception is a bug in the Python SocketServer library -- the SocketServer lib should not be calling flush on a broken pipe when finishing up a request. I filed a Python bug here: http://bugs.python.org/issue14574

Note You need to log in before you can comment on or make changes to this bug.