Bug #47510 core dump in ndbmtd in getting memory on sparc
Submitted: 22 Sep 2009 8:27 Modified: 31 Aug 2010 11:17
Reporter: Jørgen Austvik Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Solaris (sparc)
Assigned to: Jonas Oreland CPU Architecture:Any

[22 Sep 2009 8:27] Jørgen Austvik
Description:
ndbmtd coredumps in memory management.

=>[5] Ndbd_mem_manager::grow(this = 0x884270, start = 0, cnt = 1065408U), line 409 in "ndbd_malloc_impl.cpp"
  [6] Ndbd_mem_manager::init(this = 0x884270, watchCounter = 0xffbff794, alloc_less_memory = true), line 391 in "ndbd_malloc_impl.cpp"
  [7] init_global_memory_manager(ed = STRUCT, watchCounter = 0xffbff794), line 163 in "ndbd.cpp"
  [8] ndbd_run(foreground = false), line 540 in "ndbd.cpp"
  [9] main(argc = 0, argv = 0x884124), line 207 in "main.cpp"
(dbx) print start_bmo
dbx: "start_bmo" is not defined in the scope `ndbmtd`ndbd_malloc_impl.cpp`Ndbd_mem_manager::grow(unsigned,unsigned)`
dbx: see `help scope' for details
(dbx) print start_bmp 
start_bmp = 0
(dbx) print last_bmp
last_bmp = 4U
(dbx) print start
start = 0
(dbx) print cnt
cnt = 1065408U

Log:
2009-09-22 10:14:13 [ndbd] INFO     -- mysql-5.1.37 ndb-7.0.8 --
2009-09-22 10:14:13 [ndbd] INFO     -- Ndbd_mem_manager::init(1) min: 506Mb initial: 526Mb
Assertion failed: start_bmp == 0 && last_bmp == 0, file ndbd_malloc_impl.cpp, line 409
2009-09-22 10:14:45 [ndbd] ALERT    -- Node 2: Forced node shutdown completed. Initiated by signal 6.

How to repeat:
config.ini:

[ndbd default]
NoOfReplicas=1
DataMemory=33000M
IndexMemory=4125M

version:

revno: 3015 [merge]
branch nick: mysql-5.1-telco-7.0

Start ndbmtd.

Suggested fix:
If given DataMemory is bigger than we can handle: give error message.
[22 Sep 2009 8:33] Jørgen Austvik
I have tried decreasing data/index memory to 4G/1G, and it doesn't help. The non-mt ndbd starts OK, though.
[12 Oct 2009 10:58] Jonas Oreland
FYI: the assertion is enclosed in "#if CHARP == 4"
I.e you running a 32-bit build.
Not sure how this affect things, but it can't be good.
Specially not if trying to allocate 37G
[12 Oct 2009 11:30] Jørgen Austvik
Jonas: OK.

It also fails with 4/1G. 

Should it give me an error message if I have specified more memory than the build can give me?

#define SIZEOF_CHAR 1
#define SIZEOF_CHARP 4
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_OFF_T 8
...
#define HAVE_MMAP64 1
[31 Aug 2010 11:17] Jonas Oreland
This seems like a duplicate of
http://bugs.mysql.com/bug.php?id=52536

closing..
reopen if disagree

/Jonas