Bug #12588 deadlock detector - out of stack
Submitted: 15 Aug 2005 17:50 Modified: 13 Sep 2005 15:50
Reporter: Vadim Tkachenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version: OS:
Assigned to: Osku Salerma CPU Architecture:Any

[15 Aug 2005 17:50] Vadim Tkachenko
Description:
I tested mysql-5.0 on several high-end systems (2 x Opteron 2.6GHz, 2x
XEON 3.6GHz EMT64, 2 x dual-core Opteron 2.6GHz).

OS: RedHat AS 4 (Update 1).

Mysqld repeatable crashed under certain workload with 1024 threads.
Mysqld did not store any info in error log, but kernel did:

kernel: mysqld[15717]: segfault at 00000000455fbff8 rip 0000000000723a28
rsp 00000000455fc000 error 6

gdb backtrace see in attached file.

From this backtrace I made the conclusion that mysql exceeds stack size (I had thread_stack = 128K, and manual says 64K is enough if I don't use UDP).

So I increased thread_stack to 256K and the problem was resolved.

How to repeat:
see Description
[15 Aug 2005 17:52] Vadim Tkachenko
gdb backtrace

Attachment: bt.txt (text/plain), 10.01 KiB.

[16 Aug 2005 12:27] Heikki Tuuri
Assigning this to Osku.
[16 Aug 2005 20:49] Heikki Tuuri
Since the stack consumption is about 100 bytes per level, and InnoDB should normally run with a 32 kB stack, it is good to restrict the depth to 200. Look how the function handles the case *cost > 1000000.
[17 Aug 2005 8:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/28375
[17 Aug 2005 17:33] Heikki Tuuri
Fixed in 5.0.12.
[17 Aug 2005 17:51] Paul Dubois
Noted in 5.0.12 changelog.
[25 Aug 2005 11:22] Osku Salerma
Note that due to stupidity on my part, this change was actually pushed to 5.0.13, not 5.0.12.
[13 Sep 2005 15:38] Heikki Tuuri
Osku or Paul,

please correct the docs. The bug fix is in 5.0.13, not 5.0.12.

Heikki
[13 Sep 2005 15:50] Paul Dubois
I've moved the changelog entry to 5.0.13.