Bug #38577 NdbOperation without table info crashes error handler
Submitted: 5 Aug 2008 16:11 Modified: 7 Sep 2010 15:52
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Linux
Assigned to: Bernd Ocklin CPU Architecture:Any
Tags: 5.1.23-ndb-6.2.15

[5 Aug 2008 16:11] Hartmut Holzgraefe
Description:
In certain cases ndbcluster_print_error() may get a NdbOperation object without an associated table as argument. In such cases NdbOperaton::getTableName() will return a NULL pointer which is then passed into strlen() a few lines further down in ndbcluster_print_error() which leads to a segmentation fault due to the NULL pointer being dereferenced.

How to repeat:
.

Suggested fix:
Check for getTableName() returning NULL:

--- mysql-cluster-gpl-6.2.15/sql/ha_ndbcluster.cc	2008-03-17 12:28:28.000000000 +0100
+++ mysql-cluster-gpl-6.2.15-patched/sql/ha_ndbcluster.cc	2008-08-05 17:57:07.000000000 +0200
@@ -8056,6 +8056,7 @@
   DBUG_ENTER("ndbcluster_print_error");
   TABLE_SHARE share;
   const char *tab_name= (error_op) ? error_op->getTableName() : "";
+  if (tab_name == NULL) tab_name="";
   share.db.str= (char*) "";
   share.db.length= 0;
   share.table_name.str= (char *) tab_name;
[12 Nov 2008 14:14] Jonas Oreland
patch is ok,
would be interesting with real testcase
[18 Dec 2009 12:55] 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/94945

3061 Bernd Ocklin	2009-12-18
      bug#38577 don't crash on table name being NULL
[18 Dec 2009 12:57] 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/94946

3062 Bernd Ocklin	2009-12-18
      bug#38577 don't crash on table name being NULL
[18 Dec 2009 14:05] 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/94955

3062 Bernd Ocklin	2009-12-18
      bug#38577 don't crash on table name being NULL
[18 Dec 2009 14:09] 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/94956

3063 Bernd Ocklin	2009-12-18
      bug#38577 don't crash on table name being NULL
[18 Dec 2009 14:12] 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/94958

3069 Bernd Ocklin	2009-12-18 [merge]
      merge bug#38577 from 6.2
[18 Dec 2009 14:13] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:bernhard.ocklin@sun.com-20091218141113-oux8ns6fmz0kcd0f) (version source revid:bernhard.ocklin@sun.com-20091218141113-oux8ns6fmz0kcd0f) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 14: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/94960

3296 Bernd Ocklin	2009-12-18 [merge]
      merge bug#38577 from 6.3
[18 Dec 2009 14:27] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:bernhard.ocklin@sun.com-20091218141444-yjhhw3yj9nblza7x) (version source revid:bernhard.ocklin@sun.com-20091218141444-yjhhw3yj9nblza7x) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[18 Dec 2009 17:24] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20091218172014-gbbgiutso2qxv4qu) (version source revid:magnus.blaudd@sun.com-20091218172014-gbbgiutso2qxv4qu) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[31 Aug 2010 6:57] Jonas Oreland
reading logs...it seems like you have pushed this,
can you please update status

/Jonas
[7 Sep 2010 15:05] Jon Stephens
Documented bugfix in the NDB-6.3.31, 7.0.11, and 7.1.,0 changelogs, as follows:

      mysqld could sometimes crash during a commit while trying to
      handle NDB Error 4028 Node failure caused abort of transaction.

Closed.
[7 Sep 2010 15:52] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html