enlarging inbuf?

Chris Jones jones.chris.g at gmail.com
Wed Mar 26 15:25:10 PDT 2014


Hey Daniel,

(Are you "badger" on moznet by any chance?) Thanks for reporting this.
Your fix is perfectly fine for now, actually :).  I'll file an issue and
land your patch.

Cheers,
Chris


On Wed, Mar 26, 2014 at 5:21 PM, Daniel Stenberg <daniel at haxx.se> wrote:

> Hey all,
>
> During my maiden journey with rr reply I had a little snafu:
>
> (gdb) s
> easy_perform (data=0x810d244, events=false) at easy.c:752
> 752       CURLcode code = CURLE_OK;
> (gdb) p *data
> rr: /home/daniel/src/rr/src/debugger_gdb.cc:431: void
> write_data_raw(dbg_context*, const byte*, ssize_t): Assertion `"Impl
> dynamic alloc if this fails (or double outbuf size)" && (dbg->outlen + len)
> < dbg->insize' failed.
> Remote connection closed
> (gdb)
>
> It turns out dbg->outlen + len is 4097 in this case when dbg->insize is
> 4096. The struct 'data' points to is a giant one that takes several
> --more-- prompts to show fully.
>
> When I doubled the size, my problem was gone. dbg->outlen + len actually
> hasn't surpassed 4200 in my quick tests. Not really any proper analysis but
> at least a crude and basic data point.
>
> diff --git a/src/debugger_gdb.cc b/src/debugger_gdb.cc
> index 2ab52a7..01caca2 100644
> --- a/src/debugger_gdb.cc
> +++ b/src/debugger_gdb.cc
> @@ -77,7 +77,7 @@ struct dbg_context {
>         int listen_fd;
>         int sock_fd;
>         /* XXX probably need to dynamically size these */
> -       byte inbuf[4096];       /* buffered input from gdb */
> +       byte inbuf[8192];       /* buffered input from gdb */
>         ssize_t inlen;          /* length of valid data */
>         ssize_t insize;         /* total size of buffer */
>         ssize_t packetend;      /* index of '#' character */
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> rr-dev mailing list
> rr-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rr-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rr-dev/attachments/20140326/c232b283/attachment.html>


More information about the rr-dev mailing list