From 7830cd41baaa8181f395e5e45e47454706f360a5 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 16 Jul 2008 12:25:32 +0000 Subject: [PATCH] Activate testing of mem3 and mem5. Fix problems found. Tickets #3223 and #3225. Other test configuration changes. (CVS 5419) FossilOrigin-Name: a3a7820540f6f2285e6c83cac84383fc7d60d267 --- manifest | 26 +++++++++++++------------- manifest.uuid | 2 +- src/main.c | 6 +++--- src/mem3.c | 7 ++++--- src/mem5.c | 4 ++-- src/test_malloc.c | 13 ++++++++----- test/corrupt9.test | 3 ++- test/mutex2.test | 10 ++++++---- test/permutations.test | 8 ++++---- 9 files changed, 43 insertions(+), 36 deletions(-) diff --git a/manifest b/manifest index 9c6bf363fa..6835492f65 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Work\saround\sbugs\sin\solder\sversions\sof\sthe\sOS/2\sconversion\slibrary\sby\strying\sto\sminimize\scalls\sto\sUniCreateUconvObject()\setc.\sUse\sglobal\suconv\sobjects\sinstead.\s(CVS\s5418) -D 2008-07-15T22:59:05 +C Activate\stesting\sof\smem3\sand\smem5.\s\sFix\sproblems\sfound.\s\sTickets\s#3223\nand\s#3225.\s\sOther\stest\sconfiguration\schanges.\s(CVS\s5419) +D 2008-07-16T12:25:32 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -115,14 +115,14 @@ F src/insert.c e8efc17d037346e4a4a6949e72aab850befe3d5d F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e F src/legacy.c 3626c71fb70912abec9a4312beba753a9ce800df F src/loadext.c ae0eed9fa96d74172d2a90ee63b5bc36d284295c -F src/main.c 1abafc3792ad0c1d9c1aee7a9361f5278649885d +F src/main.c 1c0d8528a2fe8c376f4c52de9fcd53f747e4528b F src/malloc.c b9ff4e02fee17d2158cc52ac44a02a56bde3cf62 F src/md5.c 008216bbb5d34c6fbab5357aa68575ad8a31516a F src/mem1.c 8340fa5f969e9f9b9bdeb54106457a2003456d2b F src/mem2.c 0fc5bd6581c80f3ebd9d0cdf0f3f9c08826397ba -F src/mem3.c abaf65e3fa911b8acdbb67a50a54ec149af55736 +F src/mem3.c 71e43d6be24b014a43b1989ae7adec04817ca6e4 F src/mem4.c 6703adb1717b26d9d70a1c2586b4b7b7ffee7909 -F src/mem5.c 6c711af220f2c1566724dc439a34a98f94ab01a0 +F src/mem5.c 0b0ba1c2a02d86eb812dea6debacee841e3856f7 F src/mutex.c a485a0eac8ee2cd95f66e565b4c6696c18db968f F src/mutex.h e52ffa1dfc6a6077e8b1823d2c2b7dfcbcf85594 F src/mutex_os2.c 9c5637aa4c307c552566d0f0b3bd206245b54a97 @@ -167,7 +167,7 @@ F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b F src/test_func.c 24a556989685495013e08f311ae31c4ef86ddb8c F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f F src/test_loadext.c df8ab3a6481ddebbdf0d28ebac5d9e0790f7860f -F src/test_malloc.c e655e3ff61845fc23886ee81973638e795477c9e +F src/test_malloc.c a77b0425720cd003b3ea02b8695343e73a326a54 F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071 F src/test_mutex.c 86a937f5d28f373b8495faf1347a9d0a306594d4 F src/test_onefile.c 243157b10275251c5dc2d6619aee2ff9ae22379c @@ -251,7 +251,7 @@ F test/corrupt5.test 7796d5bdfe155ed824cee9dff371f49da237cfe0 F test/corrupt6.test e69b877d478224deab7b66844566258cecacd25e F test/corrupt7.test f0ff354eb2f0a23035fbd06724b87cac95b55cc1 F test/corrupt8.test 9992ef7f67cefc576b92373f6bf5ab8775280f51 -F test/corrupt9.test 2a1bf91834dc6f7adead1a4fabb5887393147dc6 +F test/corrupt9.test 794d284109c65c8f10a2b275479045e02d163bae F test/corruptA.test 99e95620b980161cb3e79f06a884a4bb8ae265ff F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89 F test/crash2.test 26d7a4c5520201e5de2c696ea51ab946b59dc0e9 @@ -422,7 +422,7 @@ F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 F test/misc7.test b0d80b95dc2b46ce417cf3e06bfff18166e55181 F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33 F test/mutex1.test 7f5e21fd11fe22de079e5dcd394ee4f6c257e68e -F test/mutex2.test 240cfcb5093d2702790a918b4666d5858323e006 +F test/mutex2.test 4d98b88a55f0eaaabed1fb830e88ffefa37d14e4 F test/nan.test 14c41572ff52dbc740b1c3303dd313a90dc6084c F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82 F test/null.test a8b09b8ed87852742343b33441a9240022108993 @@ -432,7 +432,7 @@ F test/pager2.test c025f91b75fe65e85febda64d9416428b8a5cab5 F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4 F test/pageropt.test 6df72c441db0a037b7ec6990d16311c24fbea77b F test/pagesize.test e0a8b3fe80f8b8e808d94a00734c7a18c76c407e -F test/permutations.test ed3b4721caf1d538778f9f155fd8133216e48212 +F test/permutations.test 3a68576f19a46f737a3c3fc5e88e8d450688c53e F test/pragma.test 2c675ed9a288094ed62bf55b35fbc749e25670fb F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/printf.test 262a5acd3158f788e9bdf7f18d718f3af32ff6ef @@ -608,7 +608,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P b22e187bc2b38bd219dd0feba19b97279bd83089 -R 3e4111cc48212173ac6c652db5b424aa -U pweilbacher -Z 2bd5796475610dfaaebbcccc19839580 +P 80e42183066b53129778ae8cbb16e495f7a82990 +R 5ad98becb2e4ee07779bd7da0702c9a6 +U drh +Z 73b8f4458cbcc2ee80ce777175a24a15 diff --git a/manifest.uuid b/manifest.uuid index 4f45fba045..b6f46fb09f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -80e42183066b53129778ae8cbb16e495f7a82990 \ No newline at end of file +a3a7820540f6f2285e6c83cac84383fc7d60d267 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 7a87860d7b..3d4cd5360a 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.477 2008/07/15 14:47:19 drh Exp $ +** $Id: main.c,v 1.478 2008/07/16 12:25:32 drh Exp $ */ #include "sqliteInt.h" #include @@ -243,10 +243,10 @@ int sqlite3_config(int op, ...){ ** the default case and return an error. */ #ifdef SQLITE_ENABLE_MEMSYS3 - sqlite3Config.m = sqlite3MemGetMemsys3(); + sqlite3Config.m = *sqlite3MemGetMemsys3(); #endif #ifdef SQLITE_ENABLE_MEMSYS5 - sqlite3Config.m = sqlite3MemGetMemsys5(); + sqlite3Config.m = *sqlite3MemGetMemsys5(); #endif } break; diff --git a/src/mem3.c b/src/mem3.c index 38c89f77ff..e276adef36 100644 --- a/src/mem3.c +++ b/src/mem3.c @@ -23,7 +23,7 @@ ** This version of the memory allocation subsystem is included ** in the build only if SQLITE_ENABLE_MEMSYS3 is defined. ** -** $Id: mem3.c,v 1.18 2008/06/27 14:05:25 danielk1977 Exp $ +** $Id: mem3.c,v 1.19 2008/07/16 12:25:32 drh Exp $ */ #include "sqliteInt.h" @@ -498,8 +498,9 @@ void memsys3Free(void *pPrior){ ** works for chunks that are currently checked out. */ static int memsys3Size(void *p){ - Mem3Block *pBlock = (Mem3Block*)p; - assert( pBlock ); + Mem3Block *pBlock; + if( p==0 ) return 0; + pBlock = (Mem3Block*)p; assert( (pBlock[-1].u.hdr.size4x&1)!=0 ); return (pBlock[-1].u.hdr.size4x&~3)*2 - 4; } diff --git a/src/mem5.c b/src/mem5.c index 6161945d6c..7ce28a342c 100644 --- a/src/mem5.c +++ b/src/mem5.c @@ -23,7 +23,7 @@ ** This version of the memory allocation subsystem is included ** in the build only if SQLITE_ENABLE_MEMSYS5 is defined. ** -** $Id: mem5.c,v 1.10 2008/06/27 14:05:25 danielk1977 Exp $ +** $Id: mem5.c,v 1.11 2008/07/16 12:25:32 drh Exp $ */ #include "sqliteInt.h" @@ -46,7 +46,7 @@ ** Log2 of the maximum size of an allocation. */ #ifndef SQLITE_POW2_LOGMAX -# define SQLITE_POW2_LOGMAX 18 +# define SQLITE_POW2_LOGMAX 20 #endif #define POW2_MAX (((unsigned int)1)<sizeof(zBuf) ){ - nByte = sizeof(zBuf); - } + zBuf = realloc(zBuf, nByte); + szBuf = nByte; rc = sqlite3_config(SQLITE_CONFIG_HEAP, zBuf, nByte, nMinAlloc); } diff --git a/test/corrupt9.test b/test/corrupt9.test index ca51fbb675..ee7410d532 100644 --- a/test/corrupt9.test +++ b/test/corrupt9.test @@ -14,7 +14,7 @@ # segfault if it sees a corrupt database file. It specifically focuses # on corruption in the form of duplicate entries no the freelist. # -# $Id: corrupt9.test,v 1.1 2008/07/11 03:34:10 drh Exp $ +# $Id: corrupt9.test,v 1.2 2008/07/16 12:25:32 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -54,6 +54,7 @@ proc corrupt_freelist {filename N} { # do_test corrupt9-1.1 { execsql { + PRAGMA auto_vacuum=NONE; PRAGMA page_size=1024; CREATE TABLE t1(x); INSERT INTO t1(x) VALUES(1); diff --git a/test/mutex2.test b/test/mutex2.test index e0c1aed8f1..ce2a61dac9 100644 --- a/test/mutex2.test +++ b/test/mutex2.test @@ -11,7 +11,7 @@ # # Test scripts for deliberate failures of mutex routines. # -# $Id: mutex2.test,v 1.6 2008/07/14 12:52:53 drh Exp $ +# $Id: mutex2.test,v 1.7 2008/07/16 12:25:32 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -60,9 +60,11 @@ ifcapable utf16 { do_test mutex2-2.4 { sqlite3_mprintf_int {This is a test %d,%d,%d} 1 2 3 } {} -do_test mutex2-2.5 { - sqlite3_auto_extension_sqr -} {7} +ifcapable load_ext { + do_test mutex2-2.5 { + sqlite3_auto_extension_sqr + } {7} +} do_test mutex2-2.6 { sqlite3_reset_auto_extension } {} diff --git a/test/permutations.test b/test/permutations.test index cf3a1ff7be..215745192f 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# $Id: permutations.test,v 1.12 2008/07/14 19:39:17 drh Exp $ +# $Id: permutations.test,v 1.13 2008/07/16 12:25:32 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -361,7 +361,7 @@ ifcapable mem3 { catch {db close} sqlite3_reset_auto_extension sqlite3_shutdown - sqlite3_config_heap 1000000 0 + sqlite3_config_heap 25000000 0 install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions @@ -389,7 +389,7 @@ ifcapable mem5 { catch {db close} sqlite3_reset_auto_extension sqlite3_shutdown - sqlite3_config_heap 1000000 64 + sqlite3_config_heap 25000000 64 install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions @@ -410,7 +410,7 @@ ifcapable mem5 { catch {db close} sqlite3_reset_auto_extension sqlite3_shutdown - sqlite3_config_heap 250000 16 + sqlite3_config_heap 40000000 16 install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions