Bug #8996 | MySQL regularly crashes with 4.1.11 latest bktree | ||
---|---|---|---|
Submitted: | 6 Mar 2005 16:43 | Modified: | 7 Mar 2005 15:40 |
Reporter: | jocelyn fournier (Silver Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.11 bktree | OS: | Linux (linux) |
Assigned to: | Sergei Golubchik | CPU Architecture: | Any |
[6 Mar 2005 16:43]
jocelyn fournier
[7 Mar 2005 7:47]
Heikki Tuuri
Hi! Gluh has modified the code recently: http://lists.mysql.com/internals/22361 I am assigning this critical bug to Gluh. Thank you, Heikki
[7 Mar 2005 8:59]
Sergei Golubchik
Yes, push_warning call was added to to send_error by Gluh. But I fail to see how send_error can be called from handle_connections_sockets. Jocelyn, it is optimized or debug build ? Can you attach to the bugreport the output of (gdb) disassemble handle_connections_sockets ? (or 'objdump -ld mysqld.o' and remove everything but handle_connections_sockets function)
[7 Mar 2005 9:26]
jocelyn fournier
handle_connections_sockets disassembly
Attachment: handle_connections_sockets.asm (application/octet-stream, text), 28.56 KiB.
[7 Mar 2005 9:33]
jocelyn fournier
Hi Sergei, It's an optimised build. I've attached the disassembly of handle_connections_sockets. However, I agree the stack looks weird, I would have expect close_connection for example to appear in the stack. Jocelyn
[7 Mar 2005 10:03]
Sergei Golubchik
Sorry, this disassembly is useless - it's full of unresolved references and I cannot see which function is called in each call. Could you repeat the same objdump... but for mysqld binary ?
[7 Mar 2005 10:13]
jocelyn fournier
Disassembly with proper symbol resolution
Attachment: handle_connections_socket.S (application/octet-stream, text), 28.44 KiB.
[7 Mar 2005 10:15]
jocelyn fournier
Hi Sergei, Sorry about this, I've now uploaded the handle_connections_socket from the mysqld.S file, which has proper symbols resolution (you can see the call to send_error at 80cb261). Jocelyn
[7 Mar 2005 10:43]
jocelyn fournier
Hi, After taken a quick look at the disassembly, it looks like the close_connection function has been inlined in handle_connections_sockets. (from 80cb22b to 80cb275) Jocelyn
[7 Mar 2005 11:58]
Sergei Golubchik
Right, gcc inlined create_new_thread and close_connection. Now I can repeat the crash in debug non-optimized build too - the trick is to set max_connections and try to open more connections than allowed
[7 Mar 2005 12:11]
Marko Mäkelä
Sergey, for what it is worth, 5.0.3 has been crashing on me when I exceed the maximum number of connections, since November or December 2004. Maybe it's the same bug?
[7 Mar 2005 12:27]
Sergei Golubchik
Marko - I just tried, 5.0.3 did not crash. In any case it would be a different bug as the code is different there. But please, do submit (separately) it if you see the crash once again.
[7 Mar 2005 12:53]
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/22726
[7 Mar 2005 13:06]
jocelyn fournier
Hi, I just wonder if the same kind of crash couldn't occur in net_printf (which is called for example for a "can't create new thread" error in create_new_thread) since push_warning has been added in this function as well (adding the test on thd->killed should fix the problem since thd->killed is properly set in create_new_thread in this case). Jocelyn
[7 Mar 2005 14:22]
Marko Mäkelä
Sergei, 5.0 still has the bug, which I have now reported as Bug #9022.
[7 Mar 2005 15:40]
Sergei Golubchik
Jocelyn - yes, it probably could. I now fixed it there too, thanks. Though it would be much more difficult it - it requires pthread_create to fail, which is not as easy to achieve as going over --max-connections. Anyway, both fixed in 4.1.11