mariadb/mysys
Dmitry Shulga 0d4be10a8a MDEV-14959: Control over memory allocated for SP/PS
This patch adds support for controlling of memory allocation
done by SP/PS that could happen on second and following executions.
As soon as SP or PS has been executed the first time its memory root
is marked as read only since no further memory allocation should
be performed on it. In case such allocation takes place it leads to
the assert hit for invariant that force no new memory allocations
takes place as soon as the SP/PS has been marked as read only.

The feature for control of memory allocation made on behalf SP/PS
is turned on when both debug build is on and the cmake option
-DWITH_PROTECT_STATEMENT_MEMROOT is set.

The reason for introduction of the new cmake option
  -DWITH_PROTECT_STATEMENT_MEMROOT
to control memory allocation of second and following executions of
SP/PS is that for the current server implementation there are too many
places where such memory allocation takes place. As soon as all such
incorrect allocations be fixed the cmake option
 -DWITH_PROTECT_STATEMENT_MEMROOT
can be removed and control of memory allocation made on second and
following executions can be turned on only for debug build. Before
every incorrect memory allocation be fixed it makes sense to guard
the checking of memory allocation on read only memory by extra cmake
option else we would get a lot of failing test on buildbot.

Moreover, fixing of all incorrect memory allocations could take pretty
long period of time, so for introducing the feature without necessary
to wait until all places throughout the source code be fixed it makes
sense to add the new cmake option.
2023-09-02 13:00:00 +07:00
..
array.c MDEV-22387: Do not violate __attribute__((nonnull)) 2020-11-02 14:19:21 +02:00
base64.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
ChangeLog
charset-def.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
charset.c MDEV-30556 UPPER() returns an empty string for U+0251 in Unicode-5.2.0+ collations for utf8 2023-02-03 18:18:32 +04:00
checksum.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
CMakeLists.txt Merge 10.3 into 10.4 2021-10-21 14:57:00 +03:00
errors.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
file_logger.c MENT-1098 Crash during update on 10.4.17 after upgrade from 10.4.10 2021-02-25 13:23:59 +02:00
get_password.c MDEV-31461 mariadb SIGSEGV when built with -DCLIENT_PLUGIN_DIALOG=STATIC 2023-06-19 12:12:21 +02:00
guess_malloc_library.c Fixed compiler warnings in guess_malloc_library 2018-01-15 16:44:44 +02:00
hash.c Merge 10.2 into 10.3 2020-10-22 08:26:28 +03:00
lf_alloc-pin.c MDEV-31185 rw_trx_hash_t::find() unpins pins too early 2023-05-19 15:50:20 +03:00
lf_dynarray.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
lf_hash.c Merge branch '10.3' into 10.4 2021-12-07 09:47:42 +01:00
list.c Merge 10.1 into 10.2 2020-05-13 11:12:31 +03:00
ma_dyncol.c Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
mf_arr_appstr.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_cache.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
mf_dirname.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_fn_ext.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_format.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_getdate.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_iocache.c Merge 10.3 into 10.4 2021-06-21 12:38:25 +03:00
mf_iocache2.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
mf_keycache.c MDEV-29613 Improve WITH_DBUG_TRACE=OFF 2022-09-23 13:40:42 +03:00
mf_keycaches.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_loadpath.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_pack.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_path.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_qsort.c fix clang build: check alignment the other way 2021-07-26 12:37:25 +03:00
mf_qsort2.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_radix.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_same.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_sort.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_soundex.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_tempdir.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_tempfile.c MDEV-26601: mysys - O_TMPFILE ^ O_CREAT 2021-09-14 21:06:34 +10:00
mf_unixpath.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_wcomp.c Update FSF Address 2019-05-11 21:29:06 +03:00
mulalloc.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_access.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_addr_resolve.c Handle meaningless addr2line results and increase timeout 2023-04-01 10:07:42 +03:00
my_alarm.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_alloc.c MDEV-14959: Control over memory allocated for SP/PS 2023-09-02 13:00:00 +07:00
my_atomic_writes.c Minimize unsafe C functions usage 2023-03-08 10:36:25 +00:00
my_basename.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_bit.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_bitmap.c Merge 10.3 into 10.4 2020-05-30 11:04:27 +03:00
my_chmod.c Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
my_chsize.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_compare.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_compress.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_conio.c Minimize unsafe C functions usage 2023-03-08 10:36:25 +00:00
my_context.c Merge 10.2 into 10.3 2021-10-13 11:38:21 +03:00
my_copy.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_cpu.c MDEV-19845: Make my_cpu.h self-contained 2020-02-01 14:56:05 +02:00
my_create.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_default.c MDEV-27038 Custom configuration file procedure does not work with Docker Desktop for Windows 10+ 2023-07-11 22:00:14 +10:00
my_delete.c Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
my_div.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_dlerror.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_error.c remove non-working debug assert 2020-10-29 09:35:39 +01:00
my_file.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_fopen.c Shrink my_atomic.h and my_cpu.h scope 2020-04-15 22:23:03 +04:00
my_fstream.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_gethwaddr.c Fix building my_gethwaddr() on OpenBSD 2022-10-27 11:30:45 +11:00
my_getncpus.c Correct FreeBSD cpuset_t type 2020-04-03 15:30:33 +02:00
my_getopt.c MDEV-18215: mariabackup does not report unknown command line options 2020-06-14 13:23:07 +03:00
my_getpagesize.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_getsystime.c MDEV-20079 When setting back the system time while mysqld is running, NOW() and UNIX_TIMESTAMP() results get stuck 2019-09-04 09:30:43 +02:00
my_getwd.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_init.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_largepage.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_lib.c Merge 10.3 into 10.4 2020-04-16 12:12:26 +03:00
my_libwrap.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_likely.c Minimize unsafe C functions usage 2023-03-08 10:36:25 +00:00
my_lock.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_lockmem.c Merge 10.3 into 10.4 2019-10-10 11:19:25 +03:00
my_malloc.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_memmem.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_mess.c MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restore 2020-11-23 12:16:45 +05:30
my_minidump.cc MDEV-11499 mysqltest, Windows : improve diagnostics if server fails to shutdown 2021-09-24 11:49:28 +02:00
my_mkdir.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_mmap.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_new.cc Update FSF Address 2019-05-11 21:29:06 +03:00
my_once.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_open.c Shrink my_atomic.h and my_cpu.h scope 2020-04-15 22:23:03 +04:00
my_port.c Follow-up to changing FSF address 2019-05-11 18:30:45 +03:00
my_pread.c Merge 10.3 into 10.4 2019-06-19 10:49:00 +03:00
my_pthread.c MDEV-15795 Stack exceeded if pthread_attr_setstacksize(&thr_attr,8196) succeeds 2022-10-22 10:24:14 +02:00
my_quick.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_rdtsc.c MDEV-23175: my_timer_milliseconds clock_gettime for multiple platfomrs 2021-12-22 16:51:22 +01:00
my_read.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_redel.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_rename.c Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
my_rnd.c MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library 2019-05-22 13:48:25 +02:00
my_safehash.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_safehash.h Update FSF address 2019-05-10 20:52:00 +03:00
my_seek.c myseek: AIX has no "tell" 2021-03-19 11:14:53 +11:00
my_setuser.c mysys: rename ME_xxx flags to match plugin api 2018-06-04 12:32:23 +02:00
my_sleep.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_static.c Merge 10.3 into 10.4 2019-08-31 06:53:45 +03:00
my_static.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_symlink.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_symlink2.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_sync.c MDEV-381: fdatasync() does not correctly flush growing binlog file 2023-08-10 19:52:04 +02:00
my_thr_init.c Minimize unsafe C functions usage 2023-03-08 10:36:25 +00:00
my_uuid.c Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
my_win_popen.cc Ensure that source files contain only valid UTF8 encodings (#2188) 2023-05-19 13:21:34 +01:00
my_wincond.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_winerr.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_winfile.c MDEV-30162 Fix occasional "Permission denied" on Windows caused by buggy 3rd party 2022-12-07 14:26:10 +01:00
my_winthread.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_write.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
mysys_priv.h MDEV-30162 Fix occasional "Permission denied" on Windows caused by buggy 3rd party 2022-12-07 14:26:10 +01:00
psi_noop.c Merge 10.2 into 10.3 2021-08-31 08:36:59 +03:00
ptr_cmp.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
queues.c Merge branch '5.5' into 10.1 2020-04-30 17:36:41 +02:00
safemalloc.c Merge 10.2 into 10.3 2021-10-28 07:50:05 +03:00
stacktrace.c Merge 10.2 into 10.3 2020-08-20 09:12:16 +03:00
string.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
test_charset.c Update FSF Address 2019-05-11 21:29:06 +03:00
test_dir.c Update FSF Address 2019-05-11 21:29:06 +03:00
test_thr_mutex.c Update FSF address 2019-05-10 20:52:00 +03:00
test_xml.c Update FSF Address 2019-05-11 21:29:06 +03:00
testhash.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
thr_alarm.c Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
thr_lock.c MDEV-22227 Assertion `state_ == s_exec' failed in wsrep::client_state::start_transaction 2021-04-28 11:11:01 +03:00
thr_mutex.c MDEV-20183 data race at safe_mutex_lock() 2019-07-26 12:36:06 +03:00
thr_rwlock.c Update FSF Address 2019-05-11 21:29:06 +03:00
thr_timer.c MDEV-15795 Stack exceeded if pthread_attr_setstacksize(&thr_attr,8196) succeeds 2022-10-22 10:24:14 +02:00
tree.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
typelib.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
waiting_threads.c Shrink my_atomic.h and my_cpu.h scope 2020-04-15 22:23:03 +04:00
wqueue.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00