1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-13 21:42:58 +03:00
Files
mariadb/mysql-test/r
Sergei Golubchik 1cc67e090e MDEV-16153 Server crashes in Apc_target::disable, ASAN heap-use-after-free in Explain_query::~Explain_query upon/after EXECUTE IMMEDIATE
Explain_query must be created in the execution arena.
But JOIN::optimize_inner temporarily switches to the statement arena
under `if (sel->first_cond_optimization)`. This might cause
Explain_query to be allocated in the statement arena. Usually it is
harmless (although technically incorrect and a waste of memory), but
in case of EXECUTE IMMEDIATE, Prepared_statement object and its
statement arena are destroyed before log_slow_statement() call,
which uses Explain_query.

Fix:
1. Create Explain_query before switching arenas.
2. Before filling earlier-created Explain_query with data, set
thd->mem_root from the Explain_query::mem_root
2018-05-19 22:12:39 +02:00
..
2017-02-10 06:30:42 -05:00
2016-12-29 13:23:18 +01:00
2018-04-10 17:43:18 +03:00
2018-04-05 14:23:18 +04:00
2017-09-17 11:05:33 +03:00
2016-09-06 12:50:02 +04:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-10-24 14:53:18 +02:00
2017-09-17 11:05:33 +03:00
2018-04-24 09:39:45 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2018-04-24 09:39:45 +03:00
2017-02-10 06:30:42 -05:00
2016-12-29 13:23:18 +01:00
2018-02-08 13:53:21 +02:00
2017-10-24 14:53:18 +02:00
2017-05-09 13:24:52 +02:00
2016-12-29 13:23:18 +01:00
2017-02-10 06:30:42 -05:00
2017-06-16 09:50:57 -07:00
2017-10-24 14:53:18 +02:00
2017-09-18 10:12:23 +02:00
2018-04-10 17:43:18 +03:00
2018-04-10 17:43:18 +03:00
2017-09-17 11:05:33 +03:00
2016-09-09 08:33:08 +02:00
2017-03-30 12:48:42 +02:00
2018-03-21 22:58:52 +02:00
2017-10-07 17:43:26 +00:00
2017-06-08 12:45:08 +03:00
2017-02-10 06:30:42 -05:00
2017-09-22 02:27:00 +02:00
2017-05-09 13:24:52 +02:00
2017-08-17 11:38:34 +02:00
2017-09-18 10:12:23 +02:00
2017-02-10 06:30:42 -05:00
2017-04-01 14:15:18 +03:00
2018-04-10 17:43:18 +03:00
2017-06-19 16:46:34 +03:00
2017-07-05 17:15:57 +02:00
2016-09-10 16:04:44 +02:00
2018-04-10 17:43:18 +03:00
2017-06-30 13:28:39 +02:00
2017-02-10 06:30:42 -05:00
2018-04-24 09:39:45 +03:00
2017-07-05 19:08:55 +02:00
2017-04-01 14:15:18 +03:00
2018-04-10 17:43:18 +03:00
2018-04-07 17:11:22 +03:00
2017-01-05 10:48:03 +02:00
2016-12-29 13:23:18 +01:00
2018-04-24 09:39:45 +03:00
2017-10-24 14:53:18 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-09-18 10:12:23 +02:00
2017-02-10 06:30:42 -05:00
2018-04-24 09:39:45 +03:00
2018-05-10 13:01:42 +02:00
2018-04-10 17:43:18 +03:00
2017-10-24 14:53:18 +02:00
2018-04-24 09:39:45 +03:00
2017-06-08 12:45:08 +03:00
2018-01-11 12:05:57 +02:00
2018-01-11 12:05:57 +02:00
2018-01-11 12:05:57 +02:00
2017-09-19 12:43:02 +03:00
2017-11-21 19:47:46 +01:00
2017-11-08 13:12:11 +02:00
2017-10-22 13:03:41 +02:00
2017-11-07 23:02:39 +02:00
2018-03-21 10:36:49 +02:00
2017-10-02 11:16:53 +03:00
2018-04-10 17:43:18 +03:00
2018-04-10 17:43:18 +03:00
2017-02-09 19:34:01 -08:00
2016-09-24 15:12:34 +02:00