Closed Bug 1545039 Opened 4 months ago Closed 4 months ago

GeckoWebExecutor sometimes sends empty request bodies


(GeckoView :: General, defect, P1)



(firefox66 wontfix, firefox67 wontfix, firefox68 fixed)

Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed


(Reporter: sebastian, Assigned: snorp)


(Whiteboard: [geckoview:fenix:m4])


(1 file)

AC issue:

See comments in AC issue.

Some quotes:

Working with @vladikoff and @thomcc, we can now reproduce this consistently. We have some POST requests getting sent without a body although the InputStream was correctly passed from A-S to A-C, then read into a ByteBuffer and passed to GWE.

GWE also sets the content-length header correctly based on the size of the ByteBuffer, but then fails to read, and sends an empty request body. After debugging this for a while, one suspicion is the potential offset of the backing array in ByteBuffer. In the non-working case, we always see an offset, meaning that just consuming e.g. from buffer.array() (without taking the offset into account) wouldn't work as the first byte(s) will be 0.

Since GWE requires a direct ByteBuffer (created with ByteBuffer.allocateDirect), A-C doesn't seem to be able to control this offset and it would have to be taken into account on the consuming-side (in GWE)...unless GWE is just using JNI's GetDirectBufferAddress which should just work.

Copying question from the AC issue here and setting needinfo for snorp :)

@snorp We need your help here :). Did you encounter this before (failing for some but not all streams)? Anything we're doing wrong there when creating the ByteBuffer:

Flags: needinfo?(snorp)

I replied on github, but I do think we have some sort of bug here. I'll investigate today.

Flags: needinfo?(snorp)
Assignee: nobody → snorp

James says this bug is blocking Fenix Sync.

Priority: -- → P1
Whiteboard: [geckoview:fenix:m4]
Pushed by
Correctly copy request bodies in GeckoWebExecutor r=geckoview-reviewers,agi
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.