summaryrefslogtreecommitdiff
path: root/mysys/my_once.c
diff options
context:
space:
mode:
authorNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-01-15 15:30:26 +0530
committerNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-01-15 15:30:26 +0530
commitd01b5c392ceed32f4d9a34eec13be4fdd78c1ef6 (patch)
treec177ff5163e51c6d1c8953eeb892c7cc47ca220a /mysys/my_once.c
parentf7f21ee732acf386745ec9e70c536f51e8871bf0 (diff)
downloadmariadb-git-d01b5c392ceed32f4d9a34eec13be4fdd78c1ef6.tar.gz
Bug#11757464:SERVER CRASH IN RECURSIVE CALL WHEN OOM
Analysis: --------- When the server is out of memory, an error is raised to indicate the same. Handling the error requires more memory to be allocated which fails, hence the error handling loops in a recursion and causes the server to crash. Fix: --- a) Prevents pushing the 'out of memory' error condition to the diagnostic area as it requires memory allocation. GET DIAGNOSTICS, SHOW WARNINGS and SHOW ERRORS statements will not show information about this error. However the 'out of memory' error is returned to the client. b) It sets the ME_FATALERROR flag when 'out of memory' errors are reported (for places where the flag is not already set). This flag prevents activation of SP error handlers which also require memory allocation and therefore are likely to fail.
Diffstat (limited to 'mysys/my_once.c')
-rw-r--r--mysys/my_once.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_once.c b/mysys/my_once.c
index 7df9b0a1981..b9232db9b2e 100644
--- a/mysys/my_once.c
+++ b/mysys/my_once.c
@@ -59,7 +59,7 @@ void* my_once_alloc(size_t Size, myf MyFlags)
{
my_errno=errno;
if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),get_size);
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_FATALERROR), get_size);
return((uchar*) 0);
}
DBUG_PRINT("test",("my_once_malloc %lu byte malloced", (ulong) get_size));