Bug #26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11
Submitted: 8 Feb 2007 3:33 Modified: 17 Apr 2007 9:48
Reporter: Sean Pringle Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.0, 5.1 OS:Any
Assigned to: Tomas Ulin

[8 Feb 2007 3:33] Sean Pringle
Description:
This error message indicates the NDB engine is unable to realloc memory:

   NdbObjectIdMap::expand unable to expand!!

Additonally, the result of realloc() appears not to be checked except to issue the error message, hence later resulting in a signal 11 segfault.

How to repeat:
Do a query joining on mulitple tables (say with blobs) large enough to exhaust the MySQL node's available memory.

Stack trace:

0x81a3968 handle_segfault + 356
0x83a317b _ZN11NdbReceiver4initENS_12ReceiverTypeEPv + 99
0x8398b78 _ZN12NdbOperationC1EP3NdbNS_4TypeE + 412
0x8390078 _ZN15Ndb_free_list_tI12NdbOperationE5seizeEP3Ndb + 84
0x838f452 _ZN3Ndb12getOperationEv + 38
0x83968c7 _ZN14NdbTransaction15getNdbOperationEPK12NdbTableImplP12NdbOperation + 71
0x83b4342 _ZN7NdbBlob9readPartsEPcjj + 66
0x83b3b21 _ZN7NdbBlob15readDataPrivateEPcRj + 653
0x83b3891 _ZN7NdbBlob8readDataEPvRj + 113
0x8256c15 _ZN13ha_ndbcluster19get_ndb_blobs_valueEP7NdbBlobl + 333
0x8256ac2 _Z21g_get_ndb_blobs_valueP7NdbBlobPv + 54
0x83b575d _ZN7NdbBlob11postExecuteEN14NdbTransaction8ExecTypeE + 1201
0x8395995 _ZN14NdbTransaction7executeENS_8ExecTypeENS_11AbortOptionEi + 457
0x825784d _ZN13ha_ndbcluster7pk_readEPKcjPc + 197
0x8259834 _ZN13ha_ndbcluster7rnd_posEPcS0_ + 48
0x824206f _Z16rr_from_tempfileP14st_read_record + 75
0x81eb99b _Z10sub_selectP4JOINP13st_join_tableb + 167
0x81f1b9b _Z9do_selectP4JOINP4ListI4ItemEP8st_tableP9Procedure + 275
0x81e795b _ZN4JOIN4execEv + 4179
0x81e84a9 _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_mP13select_resultP18st_select_lex_unitP13st_sel + 305
0x81e426a _Z13handle_selectP3THDP6st_lexP13select_resultm + 270
0x81b88fe _Z21mysql_execute_commandP3THD + 642
0x81bf8ea _Z11mysql_parseP3THDPcj + 306
0x81b717a _Z16dispatch_command19enum_server_commandP3THDPcj + 1182
0x81b6ca1 _Z10do_commandP3THD + 129
0x81b6398 handle_one_connection + 620
0x36ddd8 (?)
0x20fd1a (?)

Suggested fix:
Provide a better error message that mentions the words "memory" and "resize".  Lose the double exclamation marks.

Check the result of the realloc() and bail out gracefully with ER_OUTOFMEMORY or something.
[9 Feb 2007 19:57] Hartmut Holzgraefe
expand() only printing an error message would be ok (as realloc leaves the original memory chunk intact if reallocation fails), but IMHO it should return true or false instead of void and just printing a warning, so that callers have a chance to deal with expansion failures ...
[14 Feb 2007 8:47] 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/19846
[11 Apr 2007 12:19] Tomas Ulin
patch

Attachment: tmp.patch (text/x-patch), 63.38 KiB.

[11 Apr 2007 12:20] Tomas Ulin
break out of some inline fuctions

Attachment: ObjectMap.cpp (text/x-c++src), 1.64 KiB.

[11 Apr 2007 13:06] 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/24277

ChangeSet@1.2442, 2007-04-11 15:21:11+02:00, tomas@whalegate.ndb.mysql.com +29 -0
  Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11
  - try to catch as many malloc failures as possible and give error messages
[11 Apr 2007 15: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/24293

ChangeSet@1.2574, 2007-04-11 18:10:45+02:00, tomas@whalegate.ndb.mysql.com +6 -0
  Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11
  - try to catch as many malloc failures as possible and give error messages
  (more for 5.1)
[15 Apr 2007 16:49] Bugs System
Pushed into 5.1.18-beta
[15 Apr 2007 16:53] Bugs System
Pushed into 5.0.40
[17 Apr 2007 9:48] 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

Documented bugfix in 5.0.40 and 5.1.18 changelogs.