aboutsummaryrefslogtreecommitdiff
path: root/src/test_malloc.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2009-02-04 15:27:40 +0000
committerdanielk1977 <danielk1977@noemail.net>2009-02-04 15:27:40 +0000
commitb48c1f192e14e3cf20f366f52575eec456dadfb4 (patch)
tree75fa897fab57da6023e7f42b99b322f8fbb2d3cc /src/test_malloc.c
parent8a569e293626e68daae9e06d8c236943d3a620df (diff)
downloadsqlite-b48c1f192e14e3cf20f366f52575eec456dadfb4.tar.gz
sqlite-b48c1f192e14e3cf20f366f52575eec456dadfb4.zip
Fix a bug in test_malloc.c whereby running multi-threaded test cases could cause subsequent OOM tests to fail. (CVS 6254)
FossilOrigin-Name: 03ea9e591337a3c442080ee7cd01cc4ee85c1357
Diffstat (limited to 'src/test_malloc.c')
-rw-r--r--src/test_malloc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test_malloc.c b/src/test_malloc.c
index 7519b5f7a..21ab1e8d6 100644
--- a/src/test_malloc.c
+++ b/src/test_malloc.c
@@ -13,7 +13,7 @@
** This file contains code used to implement test interfaces to the
** memory allocation subsystem.
**
-** $Id: test_malloc.c,v 1.52 2009/01/07 03:59:47 drh Exp $
+** $Id: test_malloc.c,v 1.53 2009/02/04 15:27:40 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -132,6 +132,15 @@ static void faultsimConfig(int nDelay, int nRepeat){
memfault.nBenign = 0;
memfault.nFail = 0;
memfault.enable = nDelay>=0;
+
+ /* Sometimes, when running multi-threaded tests, the isBenignMode
+ ** variable is not properly incremented/decremented so that it is
+ ** 0 when not inside a benign malloc block. This doesn't affect
+ ** the multi-threaded tests, as they do not use this system. But
+ ** it does affect OOM tests run later in the same process. So
+ ** zero the variable here, just to be sure.
+ */
+ memfault.isBenignMode = 0;
}
/*