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...
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
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

1. curl -H "Content-Length: 1" -d ""
2. Terminate curl on client with Ctrl-C

No exception?

Exception happened during processing of request from ('', 64014)
Traceback (most recent call last):
  File "/usr/lib/python2.6/", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/", line 617, in __init__
  File "/usr/lib/python2.6/", line 329, in handle
  File "/usr/lib/python2.6/", line 323, in handle_one_request
  File "", line 82, in do_POST
  File "", line 50, in sendHeaders
  File "/usr/lib/python2.6/", line 384, in send_response
    self.send_header('Server', self.version_string())
  File "/usr/lib/python2.6/", line 390, in send_header
    self.wfile.write("%s: %s\r\n" % (keyword, value))
  File "/usr/lib/python2.6/", line 318, in write
  File "/usr/lib/python2.6/", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
Comment 1 User image 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:

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:

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