On 29.11.2012 05:47, Chris Angelico wrote:
[...]
> Hi there! Looks like this hasn't had any responses from experts, so
> I'm picking it up to see what I can find out.
Thank you Chris for checking this issue! The whole case is quite strange,
and your results helps a lot by confirming its Pike version independency
and timing related nature.
[...]
That is very good, thanks! :)
> My first guess was that it was a Pike version problem, but a Pike
> v7.8.700 behaved exactly like the 7.9.5 on the same computer.
I encountered this initially using Pike 7.8 (but older than .700). But this was
also my first pick. So I started to check the issue with Pike's upstream, and as
you mentioned, it is reproduceable even on current upstream. More to say,
that (same as you) did not find any correlation to 32-bit/64-bit architecture.
[...]
> Every one of the numbers seen there is repeatable. The pairings that
> result in 48919 bytes transferred *always* result in 48919 bytes
> transferred. I completely do not understand what's going on, but
> hopefully more data will help!
I debugged Pike internals using debug prints once and found that end of session
may lead to some results - see below, this one is end of session for Pike client:
----- BEGINNING ------
[...]
[thr:139998730520352,fd:10] ssl_read_callback (0, string[3291]): nonblocking mode=0, callback mode=0
[thr:139998730520352,fd:10] queue_write: Got nothing to write (0 strings buffered)
[thr:139998730520352,fd:10] ssl_read_callback: Got 16384 bytes of application data
[thr:139998730520352,fd:10] Running local backend [r:1 w:0], infinite timeout
[thr:139998730520352,fd:10] ssl_close_callback (0): nonblocking mode=0, callback mode=0
[thr:139998730520352,fd:10] ssl_close_callback: Abrupt close - simulating System.EPIPE
[thr:139998730520352,fd:10] Local backend ended with error
[thr:139998730520352,fd:10] update_internal_state: Not in callback mode [rcb:0]
[thr:139998730520352,fd:10] SSL.sslfile->read: Read done, returning 9723904 bytes (0 still in buffer)
[thr:139998730520352,fd:10] SSL.sslfile->read (11179, 0)
[thr:139998730520352,fd:10] SSL.sslfile->read: Propagating old callback error: Broken pipe
[thr:139998730520352,fd:10] SSL.sslfile->set_nonblocking (0, 0, 0, 0, 0, 0)
[thr:139998730520352,fd:10] update_internal_state: Not in callback mode [rcb:-1]
[thr:139998730520352,fd:10] SSL.sslfile->close (0, 0, 0)
[thr:139998730520352,fd:10] queue_write: Got nothing to write (0 strings buffered)
[thr:139998730520352,fd:10] ssl_read_callback (0, 0 (queued extra call)): nonblocking mode=1, callback mode=0, closing
(0, 2, 1)
[thr:139998730520352,fd:10] update_internal_state: In local backend - nothing done [rcb:0]
[thr:139998730520352,fd:10] Running local backend [r:0 w:1], zero timeout
[thr:139998730520352,fd:10] ssl_write_callback (0): nonblocking mode=1, callback mode=0, closing (0, 2, 1)
[thr:139998730520352,fd:10] ssl_write_callback: Queuing close packet
[thr:139998730520352,fd:10] queue_write: Got 29 bytes to write (1 strings buffered)
[thr:139998730520352,fd:10] update_internal_state: In local backend - nothing done [rcb:0]
[thr:139998730520352,fd:10] ssl_write_callback: Wrote 29 bytes (0 strings left)
[thr:139998730520352,fd:10] update_internal_state: In local backend - nothing done [rcb:0]
[thr:139998730520352,fd:10] queue_write: Connection closed normally
[thr:139998730520352,fd:10] ssl_write_callback: Close packet sent
[thr:139998730520352,fd:10] ssl_write_callback: In or after local close - shutting down
[thr:139998730520352,fd:10] SSL.sslfile->shutdown(): Proper close
[thr:139998730520352,fd:10] SSL.sslfile->shutdown(): Nonclean close - closing stream
[thr:139998730520352,ex fd:10] Local backend ended after close
[thr:139998730520352,ex fd:10] direct_write: Ok
[thr:139998730520352,ex fd:10] SSL.sslfile->shutdown(): Already shut down
[thr:139998730520352,ex fd:10] SSL.sslfile->close: Close done
[thr:139998730520352,ex fd:10] SSL.sslfile->destroy()
----- END ------
And for server that was serving data for the client above:
----- BEGIN ------
[thr:139973660772096,fd:12] SSL.sslfile->write (string[11179])
[thr:139973660772096,fd:12] queue_write: Got nothing to write (0 strings buffered)
[thr:139973660772096,fd:12] direct_write: Ok
[thr:139973660772096,fd:12] SSL.sslfile->write: Queued data[0..11178]
[thr:139973660772096,fd:12] queue_write: Got 11205 bytes to write (1 strings buffered)
[thr:139973660772096,fd:12] update_internal_state: Callback mode [r:1 w:1 rcb:0]
[thr:139973660772096,fd:12] Running local backend [r:0 w:1], zero timeout
[thr:139973660772096,fd:12] Nonwaiting local backend ended - nothing to do
[thr:139973660772096,fd:12] update_internal_state: Callback mode [r:1 w:1 rcb:0]
[thr:139973660772096,fd:12] direct_write: Ok
[thr:139973660772096,fd:12] SSL.sslfile->write: Write string done, accepted 11179 bytes
[thr:139973660772096,fd:12] SSL.sslfile->close (0, 0, 0)
[thr:139973660772096,fd:12] queue_write: Got nothing to write (1 strings buffered)
[thr:139973660772096,fd:12] Running local backend [r:0 w:1], zero timeout
[thr:139973660772096,fd:12] Nonwaiting local backend ended - nothing to do
[thr:139973660772096,fd:12] update_internal_state: After close [r:0 w:1 rcb:0]
[thr:139973660772096,fd:12] direct_write: Ok
[thr:139973660772096,fd:12] SSL.sslfile->close: Close underway
[thr:139973660772096,fd:12] update_internal_state: After close [r:0 w:1 rcb:0]
[thr:139973660772096,fd:12] SSL.sslfile->destroy()
[thr:139973660772096,fd:12] SSL.sslfile->shutdown(): Abrupt close
[thr:139973660772096,fd:12] SSL.sslfile->shutdown(): Nonclean close - closing stream
------ END ------
Same time, this one is from Pike server serving wget client (this orks OK all the time):
------ BEGIN ------
[thr:139663018305280,fd:12] SSL.sslfile->write: Write string done, accepted 11184 bytes
[thr:139663018305280,fd:12] SSL.sslfile->set_nonblocking (Protocols.HTTP.Server.Request(0 0)->read_cb, 0,
Protocols.HTTP.Server.Request(0 0)->close_cb, 0, 0, 0)
[thr:139663018305280,fd:12] update_internal_state: Callback mode [r:1 w:1 rcb:0]
[thr:139663018305280,fd:12] ssl_write_callback (1): nonblocking mode=1, callback mode=1
[thr:139663018305280,fd:12] ssl_write_callback: Wrote 11209 bytes (0 strings left)
[thr:139663018305280,fd:12] update_internal_state: Callback mode [r:1 w:0 rcb:0]
[thr:139663018305280,fd:12] queue_write: Got nothing to write (0 strings buffered)
[thr:139663018305280,fd:12] ssl_close_callback (1): nonblocking mode=1, callback mode=1
[thr:139663018305280,fd:12] ssl_close_callback: Abrupt close - simulating System.EPIPE
[thr:139663018305280,fd:12] ssl_close_callback: Calling close callback Protocols.HTTP.Server.Request(0 0)->close_cb
(error Broken pipe)
[thr:139663018305280,fd:12] SSL.sslfile->close (0, 0, 0)
[thr:139663018305280,fd:12] queue_write: Got nothing to write (0 strings buffered)
[thr:139663018305280,fd:12] Running local backend [r:0 w:1], zero timeout
[thr:139663018305280,fd:12] ssl_write_callback (0): nonblocking mode=1, callback mode=0, closing (0, 2, 1)
[thr:139663018305280,fd:12] ssl_write_callback: Queuing close packet
[thr:139663018305280,fd:12] queue_write: Got 27 bytes to write (1 strings buffered)
[thr:139663018305280,fd:12] update_internal_state: In local backend - nothing done [rcb:0]
[thr:139663018305280,fd:12] ssl_write_callback: Wrote 27 bytes (0 strings left)
[thr:139663018305280,fd:12] update_internal_state: In local backend - nothing done [rcb:0]
[thr:139663018305280,fd:12] queue_write: Connection closed normally
[thr:139663018305280,fd:12] ssl_write_callback: Close packet sent
[thr:139663018305280,fd:12] ssl_write_callback: In or after local close - shutting down
[thr:139663018305280,fd:12] SSL.sslfile->shutdown(): Proper close
[thr:139663018305280,fd:12] SSL.sslfile->shutdown(): Nonclean close - closing stream
[thr:139663018305280,ex fd:12] Local backend ended after close
[thr:139663018305280,ex fd:12] direct_write: Ok
[thr:139663018305280,ex fd:12] SSL.sslfile->shutdown(): Already shut down
[thr:139663018305280,ex fd:12] SSL.sslfile->close: Close done
[thr:139663018305280,ex fd:12] SSL.sslfile->destroy()
------ END ------
Still however I was not able to locate failure. I am working on it. It looks like
this bug does not have many friends (only us two), but I am not going to disappoint him
and fix the issue eventually, it will just take more time I suppose. :)
Best regards,
Jakub