Thus said Stephan Beal on Sat, 10 Jan 2015 03:56:11 +0100:

> i have an idea but can't try it out:
> 
> rebuild_step() local var:
> 
> Blob copy;
> ==>
> Blob copy = empty_blob;

Ok, after many  attempts (timing problems are so much  fun), I was still
able to  get a core dump  even after initializing copy  as you suggested
above. Also, from the trace, it looks like:

(gdb) frame 6
#6  0x1c05a153 in rebuild_step (rid=12271, size=280309, pBase=0xcfbde604)
    at rebuild.c:255
255           manifest_crosslink(rid, pUse, MC_NONE);
(gdb) print pBase
$11 = (Blob *) 0xcfbde604
(gdb) print pUse
$12 = (Blob *) 0xcfbde604
(gdb) print &copy
$13 = (Blob *) 0xcfbde574

Both pBase  and pBlob are the  same address, so unless  I'm mistaken, it
actually wasn't even using copy:

http://www.fossil-scm.org/index.html/info/ea2736883d102bbf2debd96bb0636fdad574d95c?ln=247,252

Which  brings  into  question,  what  exactly was  in  pBase?  And  more
importantly how did newSize get set?

(gdb) frame 1
#1  0x1c008b4a in blobReallocStatic (pBlob=0xcfbde604, newSize=2287243264)
    at blob.c:192
192         memcpy(pNew, pBlob->aData, pBlob->nUsed);
(gdb) print newSize
$12 = 2287243264
(gdb) frame 2
#2  0x1c007aef in blob_resize (pBlob=0xcfbde604, newSize=279907) at blob.c:418
418       pBlob->xRealloc(pBlob, newSize+1);
(gdb) print newSize
$13 = 279907
(gdb) list
413     /*
414     ** Attempt to resize a blob so that its internal buffer is
415     ** nByte in size.  The blob is truncated if necessary.
416     */
417     void blob_resize(Blob *pBlob, unsigned int newSize){
418       pBlob->xRealloc(pBlob, newSize+1);
419       pBlob->nUsed = newSize;
420       pBlob->aData[newSize] = 0;
421     }
422
(gdb) print newSize+1
$14 = 279908

Anything else I should  check? As I said, I can  no longer reproduce the
crash after this:

http://www.fossil-scm.org/index.html/info/e1893dc6ab8f3ae8da3580c14c0581732cc36ec4

But that might just be masking the problem.

Thanks,

Andy
-- 
TAI64 timestamp: 4000000054b0c827


_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to