enlarging inbuf?

Daniel Stenberg daniel at haxx.se
Wed Mar 26 15:21:43 PDT 2014

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

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

More information about the rr-dev mailing list