On Fri, 3 Sep 2004, D. Richard Hipp wrote: >Christian Smith wrote: >> >> How often does the balancer run? >> > >No so much, it turns out. Long ago, it used to run a lot >more often and was a high runner. But I've since optimized >it out of a lot of situations. > >So allocating with malloc() isn't a big performance hit >after all (at least not on systems where malloc performs >well - I haven't tried it on windows...) I've checked in >the changes so that btree.c now allocates all of its big >temporary data structures using malloc instead of allocating >them off of the stack. > >Let me know if you see any problems....
Just run the test suite on NetBSD/sparc64, and test pagesize-2.3000.7 died with a SIGBUS. Full stack trace at bottom of mail[0]. #0 0x0000000000108d80 in balance_nonroot (pPage=0x39dc10) at ../sqlite/src/btree.c:3045 3045 p->aData = &((u8*)p)[-pBt->pageSize]; (gdb) print *p $2 = {isInit = 70 'F', idxShift = 124 '|', nOverflow = 83 'S', intKey = 68 'D', leaf = 113 'q', zeroData = 51 '3', leafData = 86 'V', hasData = 46 '.', hdrOffset = 112 'p', childPtrSize = 118 'v', maxLocal = 12650, minLocal = 18531, cellOffset = 29040, idxParent = 15423, nFree = 26698, nCell = 22633, aOvfl = {{ pCell = 0x767a74214679514a <Address 0x767a74214679514a out of bounds>, idx = 29743}, {pCell = 0x0, idx = 0}, {pCell = 0x0, idx = 0}, { pCell = 0x0, idx = 0}, {pCell = 0x0, idx = 0}}, pBt = 0x0, aData = 0x0, pgno = 0, pParent = 0x0} This is with current CVS as of around 16:00 GMT today. Note, main thread, so I suspect not the stack size problem (I tacked it to this thread as the it is failing in the same routine). Perhaps a 64-bit issue? Unfortunately, the machine is not accessible from the internet, so more of a heads up for anyone with an internet facing 64 bit machine to try the latest source to see if you can reproduce it. In the meantime, I'll see if I can reproduce the problem on a 64-bit Solaris machine and run it through purify if so. If noone has such a machine, I'll try to borrow a spare Ultra5/10 from work that I can get you ssh access to if needed. Christian [0] Trace #0 0x0000000000108d80 in balance_nonroot (pPage=0x39dc10) at ../sqlite/src/btree.c:3045 #1 0x000000000010a840 in balance_deeper (pPage=0x329c10) at ../sqlite/src/btree.c:3463 #2 0x000000000010a8ac in balance (pPage=0x329c10) at ../sqlite/src/btree.c:3476 #3 0x000000000010aeac in sqlite3BtreeInsert (pCur=0x2c9880, pKey=0x0, nKey=4, pData=0x37f000, nData=1313) at ../sqlite/src/btree.c:3588 #4 0x0000000000134818 in sqlite3VdbeExec (p=0x2c6800) at ../sqlite/src/vdbe.c:3003 #5 0x0000000000164844 in sqlite3_step (pStmt=0x2c6800) at ../sqlite/src/vdbeapi.c:183 #6 0x000000000013bbb0 in DbObjCmd (cd=0x2b3e90, interp=0x29e010, objc=3, objv=0x2a6060) at ../sqlite/src/tclsqlite.c:755 #7 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #8 0x000000004055eb2c in TclExecuteByteCode () from /usr/pkg/lib/libtcl84.so.1 #9 0x000000004055e0dc in TclCompEvalObj () from /usr/pkg/lib/libtcl84.so.1 #10 0x000000004058ecac in TclObjInterpProc () from /usr/pkg/lib/libtcl84.so.1 #11 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #12 0x0000000040538638 in Tcl_EvalEx () from /usr/pkg/lib/libtcl84.so.1 #13 0x0000000040538b30 in Tcl_EvalObjEx () from /usr/pkg/lib/libtcl84.so.1 #14 0x000000004058e70c in Tcl_UplevelObjCmd () from /usr/pkg/lib/libtcl84.so.1 #15 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #16 0x000000004055eb2c in TclExecuteByteCode () from /usr/pkg/lib/libtcl84.so.1 #17 0x000000004055e0dc in TclCompEvalObj () from /usr/pkg/lib/libtcl84.so.1 #18 0x000000004058ecac in TclObjInterpProc () from /usr/pkg/lib/libtcl84.so.1 #19 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #20 0x000000004055eb2c in TclExecuteByteCode () from /usr/pkg/lib/libtcl84.so.1 #21 0x000000004055e0dc in TclCompEvalObj () from /usr/pkg/lib/libtcl84.so.1 #22 0x0000000040538bf4 in Tcl_EvalObjEx () from /usr/pkg/lib/libtcl84.so.1 #23 0x000000004053f0f0 in Tcl_ForeachObjCmd () from /usr/pkg/lib/libtcl84.so.1 #24 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #25 0x0000000040538638 in Tcl_EvalEx () from /usr/pkg/lib/libtcl84.so.1 #26 0x0000000040579198 in Tcl_FSEvalFile () from /usr/pkg/lib/libtcl84.so.1 #27 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #28 0x000000004055eb2c in TclExecuteByteCode () from /usr/pkg/lib/libtcl84.so.1 #29 0x000000004055e0dc in TclCompEvalObj () from /usr/pkg/lib/libtcl84.so.1 #30 0x0000000040538bf4 in Tcl_EvalObjEx () from /usr/pkg/lib/libtcl84.so.1 #31 0x000000004053f0f0 in Tcl_ForeachObjCmd () from /usr/pkg/lib/libtcl84.so.1 #32 0x0000000040537bb4 in TclEvalObjvInternal () from /usr/pkg/lib/libtcl84.so.1 #33 0x0000000040538638 in Tcl_EvalEx () from /usr/pkg/lib/libtcl84.so.1 #34 0x0000000040579198 in Tcl_FSEvalFile () from /usr/pkg/lib/libtcl84.so.1 #35 0x0000000040577d1c in Tcl_EvalFile () from /usr/pkg/lib/libtcl84.so.1 #36 0x000000000013cf28 in main (argc=2, argv=0xffffffffffffd938) at ../sqlite/src/tclsqlite.c:1292 #37 0x0000000000102408 in ___start () -- /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \