mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Bug#28690 mysql-enterprise-gpl-5.0.40-linux-i686-glibc won't start on Debian Sarge
- Only use the "hack for bug in NTPL" if using NTPL, by dynamically checking the thd_lib_detected flag mysys/my_thr_init.c: Only start the "dummy thread hack for bug in NPTL" - if using NPTL. If the system uses LinuxThreads it's not needed, it actually causes the "pthread manager" to be started as root and thus all subsequent threads will also run as root although mysqld drops root privileges, this in turns causes mysqld to deadlock since the mysqlds main thread running as <user> can't send signals to a process owned by root.
This commit is contained in:
parent
4507f7ed4c
commit
bfb7b56901
1 changed files with 20 additions and 16 deletions
|
@ -87,27 +87,31 @@ my_bool my_thread_global_init(void)
|
|||
fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef NPTL_PTHREAD_EXIT_BUG
|
||||
/*
|
||||
BUG#24507: Race conditions inside current NPTL pthread_exit()
|
||||
implementation.
|
||||
|
||||
/*
|
||||
BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
|
||||
To avoid a possible segmentation fault during concurrent
|
||||
executions of pthread_exit(), a dummy thread is spawned which
|
||||
initializes internal variables of pthread lib. See bug description
|
||||
for a full explanation.
|
||||
|
||||
To avoid a possible segmentation fault during concurrent executions of
|
||||
pthread_exit(), a dummy thread is spawned which initializes internal variables
|
||||
of pthread lib. See bug description for thoroughfull explanation.
|
||||
|
||||
TODO: Remove this code when fixed versions of glibc6 are in common use.
|
||||
*/
|
||||
TODO: Remove this code when fixed versions of glibc6 are in common
|
||||
use.
|
||||
*/
|
||||
if (thd_lib_detected == THD_LIB_NPTL)
|
||||
{
|
||||
pthread_t dummy_thread;
|
||||
pthread_attr_t dummy_thread_attr;
|
||||
|
||||
pthread_t dummy_thread;
|
||||
pthread_attr_t dummy_thread_attr;
|
||||
|
||||
pthread_attr_init(&dummy_thread_attr);
|
||||
pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED);
|
||||
|
||||
pthread_create(&dummy_thread,&dummy_thread_attr,nptl_pthread_exit_hack_handler,NULL);
|
||||
pthread_attr_init(&dummy_thread_attr);
|
||||
pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
pthread_create(&dummy_thread,&dummy_thread_attr,
|
||||
nptl_pthread_exit_hack_handler, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
|
||||
|
|
Loading…
Reference in a new issue