diff options
author | Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> | 2013-01-15 15:30:26 +0530 |
---|---|---|
committer | Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> | 2013-01-15 15:30:26 +0530 |
commit | 62e8f2567778e201164ba9e0195f13dfede56b42 (patch) | |
tree | c177ff5163e51c6d1c8953eeb892c7cc47ca220a /storage/myisam | |
parent | a44084413cf48b37a6306e3e6ecf624b8696b330 (diff) | |
download | mariadb-git-62e8f2567778e201164ba9e0195f13dfede56b42.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 'storage/myisam')
-rw-r--r-- | storage/myisam/myisampack.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index f9f31fefcb6..97f95487d01 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -2151,7 +2151,8 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees) */ if (!(packed_tree=(uint*) my_alloca(sizeof(uint)*length*2))) { - my_error(EE_OUTOFMEMORY,MYF(ME_BELL),sizeof(uint)*length*2); + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_FATALERROR), + sizeof(uint)*length*2); return 0; } |