Bug #58455 | Starting mysqld with defaults file without extension cause segmentation fault | ||
---|---|---|---|
Submitted: | 24 Nov 2010 12:51 | Modified: | 7 Mar 2011 23:55 |
Reporter: | Mats Kindahl | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.5, mysql-trunk-bugfixing | OS: | Any |
Assigned to: | Mats Kindahl | CPU Architecture: | Any |
[24 Nov 2010 12:51]
Mats Kindahl
[24 Nov 2010 13:08]
Bjørn Munch
What's that stack trace from mysqltest? I see it's calling fn_format too but neither name nor extension is 0.
[24 Nov 2010 17:16]
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/commits/124883 3388 Mats Kindahl 2010-11-24 Bug #58455 Starting mysqld with defaults file without extension cause segmentation fault Bug occurs because fn_expand calls fn_format with NULL as ext. Patch solve this problem by using an empty string as extension, and adding assertions to fn_format that correct arguments are passed. It also adds MYSQLD as enviroment variable to tests to be able to create a test that does not pass bootstrapping parameters, which seems to prevent the crash somehow.
[25 Nov 2010 10:30]
Bjørn Munch
I'm not keen on adding extra code to mtr just for one special test. Instead, this code snippet in that test will set the local variable $MYSQLD to what you need, namely the mysqld executable without args: --- perl; my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD}; open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die; print FILE "let \$MYSQLD= $mysqld;\n"; close FILE; EOF source $MYSQL_TMP_DIR/mysqld.inc; remove_file $MYSQL_TMP_DIR/mysqld.inc; ---
[26 Nov 2010 16: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/commits/125195 3388 Mats Kindahl 2010-11-26 Bug #58455 Starting mysqld with defaults file without extension cause segmentation fault Bug occurs because fn_expand calls fn_format with NULL as ext. Patch solve this problem by using an empty string as extension, and adding assertions to fn_format that correct arguments are passed. It also adds MYSQLD as enviroment variable to tests to be able to create a test that does not pass bootstrapping parameters, which seems to prevent the crash somehow.
[26 Nov 2010 17:04]
Bjørn Munch
OK this looks good, just two minor suggestions: You might move the remove_file to right after you've sourced it in the test, to avoid it being left behind if the test fails. Also, last section of the commit message is now misleading as you no longer set an env.var. I guess you can just say you've added a test, no need to explain the details of it.
[26 Nov 2010 17:05]
Bjørn Munch
Sorry, mouso on the Status field
[27 Nov 2010 20:15]
Mats Kindahl
Actually, the intention was to *leave* the file in case the test fails simply to be able to debug the test case. If the file is removed after it has been used, it is hard to check what went wrong. Re-running the test will truncate the file since ">" is used, so that should not be a problem. The comment is incorrect however, so I'll fix that.
[27 Nov 2010 20:19]
Bjørn Munch
But that file just gives the full path to the mysqld executable, which should be known and completely deterministic, I can't see any need to store that. But no big deal....
[27 Nov 2010 20:21]
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/commits/125231 3388 Mats Kindahl 2010-11-27 Bug #58455 Starting mysqld with defaults file without extension cause segmentation fault Bug occurs because fn_expand calls fn_format with NULL as ext. Patch solve this problem by using an empty string as extension, and adding assertions to fn_format that correct arguments are passed. It also add a test tests several variations of using non-existing defaults files.
[29 Nov 2010 22:17]
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/commits/125422 3390 Mats Kindahl 2010-11-29 Bug #58455 Starting mysqld with defaults file without extension cause segmentation fault Not running mysqld--defaults-file on Windows since it was not designed for it.
[5 Dec 2010 12:42]
Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[17 Dec 2010 3:12]
Paul DuBois
Bug does not appear in any released 5.6.x version. Setting report to Need Merge pending push into 5.5.x.
[11 Jan 2011 21:05]
Guilhem Bichot
this bug also exists in the latest 5.5 dmitry.shulga@oracle.com-20110111152631-jezu2dbglg05g6ff .
[8 Feb 2011 10:21]
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/commits/130694 3315 Mats Kindahl 2011-02-08 Bug #58455 Starting mysqld with defaults file without extension cause segmentation fault Bug occurs because fn_expand calls fn_format with NULL as ext. This is a backport of the patch from 5.6. Patch solve this problem by using an empty string as extension, and adding assertions to fn_format that correct arguments are passed. It also add a test tests several variations of using non-existing defaults files.
[9 Feb 2011 22:35]
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/commits/130929 3629 Mats Kindahl 2011-02-09 [merge] Merging in backported patch for BUG#58455.
[9 Feb 2011 22:37]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:mats.kindahl@oracle.com-20110209223420-8hf0rygwb8hu3t90) (version source revid:mats.kindahl@oracle.com-20110209223420-8hf0rygwb8hu3t90) (merge vers: 5.6.2) (pib:24)
[9 Feb 2011 22:37]
Bugs System
Pushed into mysql-5.5 5.5.10 (revid:mats.kindahl@oracle.com-20110209201527-u4m8pwlummit0nd1) (version source revid:mats.kindahl@oracle.com-20110208102114-m6oo1o8xatvjwl6h) (merge vers: 5.5.10) (pib:24)
[7 Mar 2011 23:55]
Paul DuBois
Noted in 5.5.10, 5.6.2 changelogs. Starting the server with the --defaults-file=file_name option, where the file name had no extension, caused a server crash. CHANGESET - http://lists.mysql.com/commits/130929