Bug #43585 "stack smashing detected" in very large JOIN query

Submitted: 12 Mar 2009 11:27 Modified: 7 May 2009 12:09
Reporter: Michael Ash Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S5 (Performance)
Version:mysql Ver 14.12 Distrib 5.0.51a, for de OS:Linux
Assigned to: CPU Architecture:Any
Tags: join, large query, left join, stack smashing detected

[12 Mar 2009 11:27] Michael Ash
Description:
I am including the output log and the error log from a script that included a long (> 1 day) query involving the join of two large datasets.

I am not sure why the optimize command failed in the first line (because it works from the command line), and everything else SEEMS to have run OK.

--------------
OPTIMIZE TABLE xy_walk_bg
--------------

+------------------+----------+----------+----------------------------------------+
| Table            | Op       | Msg_type | Msg_text                               |
+------------------+----------+----------+----------------------------------------+
| xwalk.xy_walk_bg | optimize | Error    | Table 'xwalk.xy_walk_bg' doesn't exist | 
| xwalk.xy_walk_bg | optimize | error    | Corrupt                                | 
+------------------+----------+----------+----------------------------------------+
2 rows in set (0.02 sec)

--------------
DROP TABLE IF EXISTS c_contrib
--------------

Query OK, 0 rows affected (36.07 sec)

--------------
CREATE TABLE c_contrib (
x              SMALLINT(6),
y              SMALLINT(6),
blkgrp_id      VARCHAR(12),
ReleaseNumber  INT(11),
c_contrib      FLOAT
)
--------------

Query OK, 0 rows affected (0.02 sec)

--------------
INSERT INTO c_contrib
SELECT b.x,b.y,blkgrp_id,ReleaseNumber,IFNULL(p_bg_c*ToxConc,0) AS c_contrib 
FROM xy_xwalk_bg b LEFT JOIN grid.cell_2005 c ON b.x=c.x AND b.y=c.y
--------------

Query OK, 1642411026 rows affected (1 day 4 hours 17 min 33.69 sec)
Records: 1642411026  Duplicates: 0  Warnings: 0

*** stack smashing detected ***: mysql terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7b3d138]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7b3d0f0]
mysql[0x8051565]
mysql[0x80525c7]
mysql(main+0x4f8)[0x8053198]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7a66450]
mysql[0x804b9f1]
======= Memory map: ========
08048000-08059000 r-xp 00000000 08:01 8505870    /usr/bin/mysql
08059000-0805b000 rw-p 00011000 08:01 8505870    /usr/bin/mysql
0805b000-0807d000 rw-p 0805b000 00:00 0          [heap]
b7a3f000-b7a48000 r-xp 00000000 08:01 15057163   /lib/tls/i686/cmov/libnss_files-2.7.so
b7a48000-b7a4a000 rw-p 00008000 08:01 15057163   /lib/tls/i686/cmov/libnss_files-2.7.so
b7a4a000-b7a4c000 rw-p b7a4a000 00:00 0 
b7a4c000-b7a4e000 r-xp 00000000 08:01 15057157   /lib/tls/i686/cmov/libdl-2.7.so
b7a4e000-b7a50000 rw-p 00001000 08:01 15057157   /lib/tls/i686/cmov/libdl-2.7.so
b7a50000-b7b99000 r-xp 00000000 08:01 15057154   /lib/tls/i686/cmov/libc-2.7.so
b7b99000-b7b9a000 r--p 00149000 08:01 15057154   /lib/tls/i686/cmov/libc-2.7.so
b7b9a000-b7b9c000 rw-p 0014a000 08:01 15057154   /lib/tls/i686/cmov/libc-2.7.so
b7b9c000-b7b9f000 rw-p b7b9c000 00:00 0 
b7b9f000-b7ba9000 r-xp 00000000 08:01 15024165   /lib/libgcc_s.so.1
b7ba9000-b7baa000 rw-p 0000a000 08:01 15024165   /lib/libgcc_s.so.1
b7baa000-b7bcd000 r-xp 00000000 08:01 15057158   /lib/tls/i686/cmov/libm-2.7.so
b7bcd000-b7bcf000 rw-p 00023000 08:01 15057158   /lib/tls/i686/cmov/libm-2.7.so
b7bcf000-b7bd0000 rw-p b7bcf000 00:00 0 
b7bd0000-b7cb8000 r-xp 00000000 08:01 8504043    /usr/lib/libstdc++.so.6.0.9
b7cb8000-b7cbb000 r--p 000e8000 08:01 8504043    /usr/lib/libstdc++.so.6.0.9
b7cbb000-b7cbd000 rw-p 000eb000 08:01 8504043    /usr/lib/libstdc++.so.6.0.9
b7cbd000-b7cc3000 rw-p b7cbd000 00:00 0 
b7cc3000-b7cd7000 r-xp 00000000 08:01 8503583    /usr/lib/libz.so.1.2.3.3
b7cd7000-b7cd8000 rw-p 00013000 08:01 8503583    /usr/lib/libz.so.1.2.3.3
b7cd8000-b7cec000 r-xp 00000000 08:01 15057160   /lib/tls/i686/cmov/libnsl-2.7.so
b7cec000-b7cee000 rw-p 00013000 08:01 15057160   /lib/tls/i686/cmov/libnsl-2.7.so
b7cee000-b7cf0000 rw-p b7cee000 00:00 0 
b7cf0000-b7cf9000 r-xp 00000000 08:01 15057156   /lib/tls/i686/cmov/libcrypt-2.7.so
b7cf9000-b7cfb000 rw-p 00008000 08:01 15057156   /lib/tls/i686/cmov/libcrypt-2.7.so
b7cfb000-b7d22000 rw-p b7cfb000 00:00 0 
b7d22000-b7d36000 r-xp 00000000 08:01 15057168   /lib/tls/i686/cmov/libpthread-2.7.so
b7d36000-b7d38000 rw-p 00013000 08:01 15057168   /lib/tls/i686/cmov/libpthread-2.7.so
b7d38000-b7d3a000 rw-p b7d38000 00:00 0 
b7d3a000-b7ed6000 r-xp 00000000 08:01 8503331    /usr/lib/libmysqlclient.so.15.0.0
b7ed6000-b7f19000 rw-p 0019b000 08:01 8503331    /usr/lib/libmysqlclient.so.15.0.0
b7f19000-b7f1b000 rw-p b7f19000 00:00 0 
b7f1b000-b7f48000 r-xp 00000000 08:01 15024197   /lib/libncurses.so.5.6
b7f48000-b7f4b000 rw-p 0002c000 08:01 15024197   /lib/libncurses.so.5.6
b7f4b000-b7f77000 r-xp 00000000 08:01 15024247   /lib/libreadline.so.5.2
b7f77000-b7f7b000 rw-p 0002c000 08:01 15024247   /lib/libreadline.so.5.2
b7f7b000-b7f7c000 rw-p b7f7b000 00:00 0 
b7f8c000-b7f8f000 rw-p b7f8c000 00:00 0 
b7f8f000-b7f90000 r-xp b7f8f000 00:00 0          [vdso]
b7f90000-b7faa000 r-xp 00000000 08:01 15024196   /lib/ld-2.7.so
b7faa000-b7fac000 rw-p 00019000 08:01 15024196   /lib/ld-2.7.so
bf7f1000-bf806000 rw-p bffeb000 00:00 0          [stack]

How to repeat:
I have not been able to repeat the bug.  On the other hand, the query simply won't complete.
[15 Mar 2009 18:54] Shane Bester
looks like mysql client crashed, so this might be a duplicate of bug #33841
[7 Apr 2009 12:09] MySQL Verification Team
Thank you for the bug report. Could you please verify if actually the same as bug http://bugs.mysql.com/bug.php?id=33841 how Shane asked?. Thanks in advance.
[7 May 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.