Bug #13855 | Server crash after a select query (lack of memory) | ||
---|---|---|---|
Submitted: | 7 Oct 2005 19:38 | Modified: | 19 Oct 2005 13:50 |
Reporter: | Ilya Pyatigorskiy | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 4.0.26/4.0 BK source | OS: | Windows (Windows, Linux) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[7 Oct 2005 19:38]
Ilya Pyatigorskiy
[7 Oct 2005 23:19]
MySQL Verification Team
Thank you for the bug report. This bug not affects 4.1 and 5.0 versions. mysql> SELECT DISTINCT t_Test.t_TestId AS TestId, COUNT( DISTINCT APending.t_AnswerId ) -> > 0 AS ToExam -> FROM t_Test -> LEFT JOIN t_Result ON ( t_Test.t_TestId = t_Result.t_TestId && t_Result.Attempt -> =0 ) -> LEFT JOIN t_Answer AS APending ON ( APending.t_ResultId = t_Result.t_ResultId && -> APending.AnswerState =10 ) -> LEFT JOIN Login_has_t_Test AS L ON ( L.t_TestId = t_Test.t_TestId && L.LoginId -> =21 && L.t_RoleId !=1 ) -> WHERE NOW( ) > t_Test.StartTime -> GROUP BY t_Test.t_TestId; ERROR 2013: Lost connection to MySQL server during query /home/miguel/dbs/4.0/libexec/mysqld: ready for connections. Version: '4.0.26-debug-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution [New Thread 1158192048 (LWP 32218)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1158192048 (LWP 32218)] 0x40254ac7 in memset () from /lib/tls/libc.so.6 (gdb) bt full #0 0x40254ac7 in memset () from /lib/tls/libc.so.6 No symbol table info available. #1 0xfffffff8 in ?? () No symbol table info available. #2 0x083b6baa in _mymalloc (size=145764352, filename=0x8458223 "my_alloc.c", lineno=160, MyFlags=16) at safemalloc.c:195 irem = (struct st_irem *) 0x8ac47c0 data = 0x8ac47d8 '¥' <repeats 200 times>... _db_func_ = 0x450884b8 "è\204\bE^À<\b" _db_file_ = 0x401650c0 "]Ã\215\001è\2070" _db_level_ = 1158186216 _db_framep_ = (char **) 0x83cc05e #3 0x083b6599 in alloc_root (mem_root=0x8ad99dc, Size=4294967272) at my_alloc.c:160 get_size = 4294967288 block_size = <value optimized out> point = <value optimized out> next = <value optimized out> prev = (USED_MEM **) 0x8ae5308 #4 0x080fbd60 in sql_alloc (Size=0) at thr_malloc.cc:42 root = <value optimized out> ptr = 0xa5a5a5a5 "" mysql> SELECT DISTINCT t_Test.t_TestId AS TestId, COUNT( DISTINCT APending.t_AnswerId ) -> > 0 AS ToExam -> FROM t_Test -> LEFT JOIN t_Result ON ( t_Test.t_TestId = t_Result.t_TestId && t_Result.Attempt -> =0 ) -> LEFT JOIN t_Answer AS APending ON ( APending.t_ResultId = t_Result.t_ResultId && -> APending.AnswerState =10 ) -> LEFT JOIN Login_has_t_Test AS L ON ( L.t_TestId = t_Test.t_TestId && L.LoginId -> =21 && L.t_RoleId !=1 ) -> WHERE NOW( ) > t_Test.StartTime -> GROUP BY t_Test.t_TestId -> ; +--------+--------+ | TestId | ToExam | +--------+--------+ | 2 | 0 | +--------+--------+ 1 row in set (0.00 sec) mysql> select version(); +------------------+ | version() | +------------------+ | 4.1.15-debug-log | +------------------+ 1 row in set (0.00 sec) mysql> SELECT DISTINCT t_Test.t_TestId AS TestId, COUNT( DISTINCT APending.t_AnswerId ) -> > 0 AS ToExam -> FROM t_Test -> LEFT JOIN t_Result ON ( t_Test.t_TestId = t_Result.t_TestId && t_Result.Attempt -> =0 ) -> LEFT JOIN t_Answer AS APending ON ( APending.t_ResultId = t_Result.t_ResultId && -> APending.AnswerState =10 ) -> LEFT JOIN Login_has_t_Test AS L ON ( L.t_TestId = t_Test.t_TestId && L.LoginId -> =21 && L.t_RoleId !=1 ) -> WHERE NOW( ) > t_Test.StartTime -> GROUP BY t_Test.t_TestId; +--------+--------+ | TestId | ToExam | +--------+--------+ | 2 | 0 | +--------+--------+ 1 row in set (0.03 sec) mysql> select version(); +-----------------+ | version() | +-----------------+ | 5.0.15-rc-debug | +-----------------+ 1 row in set (0.00 sec)
[13 Oct 2005 21:22]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/31074
[13 Oct 2005 23:13]
Evgeny Potemkin
DISTINCT wasn't optimized away and caused creation of tmp table in wrong case. This result in integer overrun and running out of memory. Fixed in 4.0.27, cset 1.2164.1.1
[19 Oct 2005 13:50]
Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Documented fix in 4.0.27 changelog. Closed.
[6 Jan 2006 19:43]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/717