[MDEV-13203] [Draft] Out of memory upon SELECT UNION Created: 2017-06-28  Updated: 2017-07-10  Resolved: 2017-07-10

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Elena Stepanova
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-12575 Server crash in AGGR_OP::put_record o... Closed

 Description   

http://buildbot.askmonty.org/buildbot/builders/qa-win-debug/builds/132/steps/crash_tests/logs/stdio

10.2 3e1d0ff5748db3881cca96f9d35bee179552c9f6

2017-06-28  9:53:33 5960 [ERROR] mysqld.exe: Out of memory (Needed 4294967288 bytes)
2017-06-28  9:53:33 5960 [ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
170628  9:53:33 [ERROR] mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.2.7-MariaDB-debug-log
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=7
max_threads=65537
thread_count=12
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4198 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0xcd7bb37228
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
mysqld.exe!SQL_SELECT::cleanup()[opt_range.cc:1212]
mysqld.exe!Filesort::cleanup()[filesort.cc:431]
mysqld.exe!Filesort::~Filesort()[filesort.h:74]
mysqld.exe!Filesort::`scalar deleting destructor'()
mysqld.exe!st_join_table::cleanup()[sql_select.cc:11628]
mysqld.exe!JOIN::cleanup()[sql_select.cc:12041]
mysqld.exe!JOIN::destroy()[sql_select.cc:3501]
mysqld.exe!st_select_lex::cleanup()[sql_union.cc:1461]
mysqld.exe!st_select_lex_unit::cleanup()[sql_union.cc:1294]
mysqld.exe!mysql_union()[sql_union.cc:42]
mysqld.exe!handle_select()[sql_select.cc:351]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6442]
mysqld.exe!mysql_execute_command()[sql_parse.cc:3457]
mysqld.exe!mysql_parse()[sql_parse.cc:7879]
mysqld.exe!dispatch_command()[sql_parse.cc:1819]
mysqld.exe!do_command()[sql_parse.cc:1361]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:346]
mysqld.exe!tp_callback()[threadpool_common.cc:192]
mysqld.exe!tp_callback()[threadpool_win.cc:378]
mysqld.exe!work_callback()[threadpool_win.cc:452]
ntdll.dll!RtlFreeUnicodeString()
ntdll.dll!RtlFreeUnicodeString()
KERNEL32.DLL!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0xcd085a3620): /* GenTest::Transform::ExecuteAsUnion */ (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO 6284 CON_ID 16 */  ) UNION ALL (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO 6284 CON_ID 16 */  LIMIT 0 ) /* TRANSFORM_OUTCOME_UNORDERED_MATCH */ /* QNO 6310 CON_ID 16 */
Connection ID (thread ID): 16
Status: NOT_KILLED

seed=1498632567
Command line:
E:\buildbot\rqg/runall.pl --no-mask --seed=time --threads=5 --duration=400 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --redefine=conf/mariadb/redefine_set_session_vars.yy --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,DisableOptimizations,EnableOptimizations,ExecuteAsCTE,ExecuteAsInsertSelect,ExecuteAsPreparedOnce,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,NullIf,OrderBy,StraightJoin,ExecuteAsExecuteImmediate --grammar=conf/mariadb/functions.yy --mtr-build-thread=150 --basedir1=D:\qa-win-debug\build --vardir1=E:\buildbot\vardirs\qa-win-debug\10.2-132\optim-crash-tests/current1_1

Not easily reproducible.



 Comments   
Comment by Elena Stepanova [ 2017-07-10 ]

It appears to be related to MDEV-12575, at least the stack trace is similar to one of those.

Generated at Thu Feb 08 08:03:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.