summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-10-21 19:40:08 +0200
committerSergei Golubchik <serg@mariadb.org>2022-10-22 10:24:14 +0200
commit3e377fd35bf78905ea5d6564ec865d4877e924e5 (patch)
tree0f95db688922183343e2ecd39367d9da6e973858 /mysys
parent68391acef239cc468d9c11c9bbdeebd143c188b7 (diff)
downloadmariadb-git-3e377fd35bf78905ea5d6564ec865d4877e924e5.tar.gz
MDEV-15795 Stack exceeded if pthread_attr_setstacksize(&thr_attr,8196) succeeds
on Linux this pthread_attr_setstacksize() fails with EINVAL "The stack size is less than PTHREAD_STACK_MIN (16384) bytes". But on FreeBSD it succeeds and causes a crash later, as 8196 is too little. Let's keep the stack at its default size in the timer thread.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_pthread.c1
-rw-r--r--mysys/thr_alarm.c1
-rw-r--r--mysys/thr_timer.c1
3 files changed, 0 insertions, 3 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index e2795ed7bb9..dc6e0904951 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -263,7 +263,6 @@ int sigwait(sigset_t *setp, int *sigp)
pthread_attr_init(&thr_attr);
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
- pthread_attr_setstacksize(&thr_attr,8196);
pthread_create(&sigwait_thread_id, &thr_attr, sigwait_thread, setp);
pthread_attr_destroy(&thr_attr);
}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 8a89762de2a..f6eb963c34c 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -114,7 +114,6 @@ void init_thr_alarm(uint max_alarms)
pthread_attr_init(&thr_attr);
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
- pthread_attr_setstacksize(&thr_attr,8196);
mysql_thread_create(key_thread_alarm,
&alarm_thread, &thr_attr, alarm_handler, NULL);
pthread_attr_destroy(&thr_attr);
diff --git a/mysys/thr_timer.c b/mysys/thr_timer.c
index 1532875d7f3..1b614ac48bd 100644
--- a/mysys/thr_timer.c
+++ b/mysys/thr_timer.c
@@ -85,7 +85,6 @@ my_bool init_thr_timer(uint alloc_timers)
/* Create a thread to handle timers */
pthread_attr_init(&thr_attr);
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
- pthread_attr_setstacksize(&thr_attr,8196);
thr_timer_inited= 1;
if (mysql_thread_create(key_thread_timer, &timer_thread, &thr_attr,
timer_handler, NULL))