The mysqld server fails to work on ia64 Linux apparently due to the
recent switch to a TLS-enabled glibc. The problem is that the
interrupt thread fails to get created (it fails with EINVAL). The
workaround that the patch below uses is to not try to limit the
stack-size to 32KB. The code seems to be buggy to begin with (it
should at least use a stack-size of MAX(32768, PTHREAD_STACK_MIN); on
ia64, PTHREAD_STACK_MIN is 196608 bytes), but I think the reason this
bug got triggered now is due to the fact that NPTL insists that the
stack size no less than:
guardsize + static-TLS-size + MINIMAL_REST_STACK + pagesize
where
guardsize >= 1 page (16KB with the Debian kernel)
MINIMAL_REST_STACK: 16KB on ia64
page_size: 16KB with the Debian kernel
In other words, the stack would have bo be at least 48KB for the
thread-creation to succeed. Of course, with a page size of 64KB, this
minimum would increase to 144KB.
The static-TLS-size is somewhat unpredictable, since that's something
that will change whenever one of the dependent shared libraries
chooses to use more or less thread-local storage. At the moment, only
glibc seems to use TLS and it's only about 16 bytes, but that can
obviously change easily.
In summary, I'd recommend that mysqld should at the very least
increase the stack-size to MAX(32768, PTHREAD_STACK_MIN). However,
since virtual memory is cheap on 64-bit architectures, it might be
best not to try to set the stack size at all on those architectures.
--- sql/mysqld.cc~ 2003-12-07 10:09:21.000000000 -0800
+++ sql/mysqld.cc 2003-12-07 10:32:29.291545673 -0800
@@ -1700,7 +1700,7 @@
#endif
(void) pthread_mutex_lock(&LOCK_thread_count);
- if ((error=pthread_create(&signal_thread,&thr_attr,signal_hand,0)))
+ if ((error=pthread_create(&signal_thread,NULL/*&thr_attr*/,signal_hand,0)))
{
sql_print_error("Can't create interrupt-thread (error %d, errno: %d)",
error,errno);