Closed Bug 1644374 Opened 4 years ago Closed 4 years ago

Assertion *countWritten > 0 in nsHttpTransaction::WritePipeSegment when running netwerk/test/unit/test_http3.js

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: michal, Assigned: michal)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(4 files)

Attached file moz.log.gz
#0  0x00007fe501036050 in mozilla::net::nsHttpTransaction::WritePipeSegment(nsIOutputStream*, void*, char*, unsigned int, unsigned int, unsigned int*)
    (stream=0x7fe4da3c8f38, closure=0x7fe4da329c00, buf=0x7fe4da1b6000 '\344' <repeats 199 times>, <incomplete sequence \344>..., offset=0, count=32768, countWritten=0x7fe4e60fbaf8) at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/nsHttpTransaction.cpp:850
#1  0x00007fe500481e8c in nsPipeOutputStream::WriteSegments(nsresult (*)(nsIOutputStream*, void*, char*, unsigned int, unsigned int, unsigned int*), void*, unsigned int, unsigned int*)
    (this=0x7fe4da3c8f38, aReader=0x7fe501035e20 <mozilla::net::nsHttpTransaction::WritePipeSegment(nsIOutputStream*, void*, char*, unsigned int, unsigned int, unsigned int*)>, aClosure=0x7fe4da329c00, aCount=32768, aWriteCount=0x7fe4e60fbc84) at /mnt/work/opt/moz/hg-central-2/xpcom/io/nsPipe3.cpp:1684
#2  0x00007fe5010371f3 in mozilla::net::nsHttpTransaction::WriteSegments(mozilla::net::nsAHttpSegmentWriter*, unsigned int, unsigned int*)
    (this=0x7fe4da329c00, writer=0x7fe4da127e88, count=32768, countWritten=0x7fe4e60fbc84)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/nsHttpTransaction.cpp:969
#3  0x00007fe500e7d86c in mozilla::net::Http3Stream::WriteSegments(mozilla::net::nsAHttpSegmentWriter*, unsigned int, unsigned int*)
    (this=0x7fe4da127e80, writer=0x7fe4f4a84dc0, count=32768, countWritten=0x7fe4e60fbc84)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/Http3Stream.cpp:348
#4  0x00007fe500e7d68e in mozilla::net::Http3Session::ProcessSingleTransactionRead(mozilla::net::Http3Stream*, unsigned int, unsigned int*)
    (this=0x7fe4f4a84da0, stream=0x7fe4da127e80, count=32768, countWritten=0x7fe4e60fbe14)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/Http3Session.cpp:230
#5  0x00007fe500e7dca9 in mozilla::net::Http3Session::ProcessTransactionRead(mozilla::net::Http3Stream*, unsigned int, unsigned int*)
    (this=0x7fe4f4a84da0, stream=0x7fe4da127e80, count=32768, countWritten=0x7fe4e60fbe14)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/Http3Session.cpp:263
#6  0x00007fe500e7e2aa in mozilla::net::Http3Session::ProcessEvents(unsigned int) (this=0x7fe4f4a84da0, count=32768)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/Http3Session.cpp:325
#7  0x00007fe500e82055 in mozilla::net::Http3Session::WriteSegmentsAgain(mozilla::net::nsAHttpSegmentWriter*, unsigned int, unsigned int*, bool*)
    (this=0x7fe4f4a84da0, writer=0x7fe4f4ac3ee8, count=32768, countWritten=0x7fe4e60fbf54, again=0x7fe4e60fbf53)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/Http3Session.cpp:879
#8  0x00007fe500f37913 in mozilla::net::HttpConnectionUDP::OnSocketReadable() (this=0x7fe4f4ac3e00)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/HttpConnectionUDP.cpp:623
#9  0x00007fe500f3824f in mozilla::net::HttpConnectionUDP::OnInputStreamReady(nsIAsyncInputStream*) (this=0x7fe4f4ac3e00, in=0x7fe4e1715aa8)
    at /mnt/work/opt/moz/hg-central-2/netwerk/protocol/http/HttpConnectionUDP.cpp:670
#10 0x00007fe50082915e in mozilla::net::nsSocketInputStream::OnSocketReady(nsresult) (this=0x7fe4e1715aa8, condition=nsresult::NS_OK)
    at /mnt/work/opt/moz/hg-central-2/netwerk/base/nsSocketTransport2.cpp:286
#11 0x00007fe5008337bf in mozilla::net::nsSocketTransport::OnSocketReady(PRFileDesc*, short) (this=0x7fe4e1715800, fd=0x7fe4e49a2d60, outFlags=1)
    at /mnt/work/opt/moz/hg-central-2/netwerk/base/nsSocketTransport2.cpp:2280
#12 0x00007fe50083f15d in mozilla::net::nsSocketTransportService::DoPollIteration(mozilla::BaseTimeDuration<mozilla::TimeDurationValueCalculator>*)
    (this=0x7fe4f4ac6240, pollDuration=0x7fe4e60fc378) at /mnt/work/opt/moz/hg-central-2/netwerk/base/nsSocketTransportService2.cpp:1321
#13 0x00007fe50083e361 in mozilla::net::nsSocketTransportService::Run() (this=0x7fe4f4ac6240)
    at /mnt/work/opt/moz/hg-central-2/netwerk/base/nsSocketTransportService2.cpp:1094
#14 0x00007fe50054c605 in nsThread::ProcessNextEvent(bool, bool*) (this=0x7fe4f4a7abd0, aMayWait=true, aResult=0x7fe4e60fcb67)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThread.cpp:1236
#15 0x00007fe5005523b7 in NS_ProcessNextEvent(nsIThread*, bool) (aThread=0x7fe4f4a7abd0, aMayWait=true)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThreadUtils.cpp:501
#16 0x00007fe5013a81f9 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) (this=0x7fe4e6c2e840, aDelegate=0x7fe4e60fcd78)
    at /mnt/work/opt/moz/hg-central-2/ipc/glue/MessagePump.cpp:332
#17 0x00007fe5012981f7 in MessageLoop::RunInternal() (this=0x7fe4e60fcd78) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:315
#18 0x00007fe501298175 in MessageLoop::RunHandler() (this=0x7fe4e60fcd78) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:308
#19 0x00007fe501298133 in MessageLoop::Run() (this=0x7fe4e60fcd78) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:290
Attached file xpcshell.log.gz
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]

Errors are lost between Http3Stream::OnReadSegment() and Http3Stream::ReadSegments() in nsBufferedInputStream::ReadSegments(). In case of NS_BASE_STREAM_WOULD_BLOCK this means we proceed to the next state without sending all request data.

Assignee: nobody → michal.novotny
Status: NEW → ASSIGNED
Pushed by mnovotny@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/737de9c20ef2 Remember NS_BASE_STREAM_WOULD_BLOCK error in Http3Stream::OnReadSegment() r=necko-reviewers,dragana
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

HTTP/3 server can start sending the response before the whole request is sent (e.g. server decides
to ignore the POST data). In such case Http3Stream::OnWriteSegment() can be called in a state when
we don't want to read the data yet. We need to return NS_BASE_STREAM_WOULD_BLOCK instead of NS_OK
to avoid hitting an assertion in nsHttpTransaction::WritePipeSegment().

Blocks: 1627910
Pushed by mnovotny@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/596e2e59f7a2 Return NS_BASE_STREAM_WOULD_BLOCK from Http3Stream::OnWriteSegment() when no data was written r=necko-reviewers,dragana
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: