You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2014/01/17 11:05:19 UTC

[jira] [Updated] (DERBY-6456) Infinite loop in NetworkServerControlImpl when reply >= 32k

     [ https://issues.apache.org/jira/browse/DERBY-6456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-6456:
--------------------------------------

    Attachment: d6456-1a.diff

The attached patch fixes the infinite loop by adjusting NetworkServerControlImpl.MAXREPLY so that the reply buffer is large enough to hold the largest possible reply. The largest reply would contain four bytes in the reply header, a single status byte, two bytes for the length field, and 2¹⁶-1 bytes of payload. Which sums up to 65542 bytes.

The patch also contains a regression test case that verifies that such a large reply can be read. The test case never completes without the fix.

I'm running the full regression test suite on the patch now.

> Infinite loop in NetworkServerControlImpl when reply >= 32k
> -----------------------------------------------------------
>
>                 Key: DERBY-6456
>                 URL: https://issues.apache.org/jira/browse/DERBY-6456
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.10.1.1
>            Reporter: Martin JANDA
>         Attachments: d6456-1a.diff
>
>
> When size of reply in NetworkServerControlImpl  equals to 32k (max size for short) ensureDataInBuffer is in infinite loop. clientIs.read(..., replyBuffer.length - replyBufferCount) return 0 because 'replyBuffer.length - replyBufferCount' is 0 (bytes to read).
> Steps to reproduce:
> Open many connections (for me 34) with at least 1 SELECT query. and call getRuntimeInfo(). Runtime info string.length > 32kB. Leading to infinite loop.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)