Bug #5807 Warning on thread stack
Submitted: 29 Sep 2004 18:13 Modified: 6 Oct 2004 17:09
Reporter: Toshiteru Nishio Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.21 (x86, glibc-2.2, static, gcc) OS:Linux (Redhat AS3)
Assigned to: Lenz Grimmer CPU Architecture:Any

[29 Sep 2004 18:13] Toshiteru Nishio
Description:
If MySQL 4.0.21 Linux (x86, glibc-2.2, static, gcc) Standard is used, when mysqld starts, the following warning appears.
  Warning: Asked for 196608 thread stack, but got 126976

I think this warning indicates that mysqld requested 192K stack size and it got 124K stack size. But in case of 124K stack size, possibly mysqld may die in gethostbyaddr(). See the following text at http://dev.mysql.com/doc/mysql/en/Linux-x86.html 
---
If you are using Red Hat 8.0 or a new glibc 2.2.x library, you may see mysqld die in gethostbyaddr(). This happens because the new glibc library requires a stack size greater than 128KB for this call. To fix the problem, start mysqld with the --thread-stack=192K option. (Use -O thread_stack=192K before MySQL 4.) This stack size is now the default on MySQL 4.0.10 and above, so you should not see the problem. 
---

Additional Info:
http://dev.mysql.com/doc/mysql/en/Source_notes-Linux.html mentions linuxthreads-2.2.2.patch for glibc-2.2. The patch changes STACK_SIZE in internals.h to 128K. I suppose MySQL 4.0.21 Linux (x86, glibc-2.2, static, gcc) Standard is statically linked with the glibc-2.2 to which the linuxthreads-2.2.2.patch is applied. And I suppose, if the STACK_SIZE value is 192K, the above warning does not appear. 

How to repeat:
The warning appears, when mysqld starts.
[6 Oct 2004 17:09] Lenz Grimmer
This message only occurs using our static Linux/x86 binaries, which are linked against a specially patched glibc-2.2.5. The patch applied reduces the thread stack size to 128KB to enable more concurrent threads (4096 instead of 1024). It's a warning only and can be ignored for this binary.

The hint about mysqld dying in gethostbyaddr() refers to a dynamically linked binary that uses the system glibc - it does not apply to the static glibc we use.