QGrpcHttp2Channel: drain the outgoing queue iteratively


Http2Handler::processQueue() dequeued a single message and sent it,
relying on the uploadFinished handler to call processQueue() again for
the next one. On a fast link sendDATA() completes synchronously and
emits uploadFinished from within the call, so a large backlog drained
through one deep recursion (processQueue -> sendDATA -> uploadFinished
-> processQueue -> ...), one stack frame per queued message.
Burst-writing more than ~10k small messages overflowed the stack and
crashed the client with SIGSEGV.

Flatten the drain into a loop guarded against re-entrancy: a re-entrant
processQueue() call flags and returns, while the active loop dequeues
the next message. This resolves the recursion.

[ChangeLog][QtGrpc][QGrpcHttp2Channel] Fixed a stack overflow that could
crash the client when burst-writing a very large number of messages on a
client-streaming or bidirectional RPC.

Fixes: QTBUG-148062
Task-number: QTBUG-147934
Pick-to: 6.12 6.11 6.8
Change-Id: I058a9e3428ea94aad663fdf392949624702f750a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commit378ea257f8ced5e52430d6e587025205f20e4240
parent99c2d5308c476dde5848d02b4aa21f610338bf68
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeTue, 21 Jul 2026 18:18:25 +0000