Bug #47214 ndb_mgmd hangs on thread creation in Snow Leopard
Submitted: 9 Sep 2009 10:06 Modified: 3 Apr 2014 8:51
Reporter: Bernd Ocklin Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:MacOS (10.6)
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: 7.0, 7.1

[9 Sep 2009 10:06] Bernd Ocklin
Description:
ndb_mgmd hangs in NdbCondition_WaitTimeoutAbs when creating a new thread. 

Thread 12 (core thread 11):
#0  0x00007fffffe00295 in __spin_lock ()
#1  0x00007fff829a1302 in pthread_mutex_lock ()
#2  0x0000000100101cbd in NdbMutex_Lock (p_mutex=0x1004244a0) at NdbMutex.c:70
#3  0x0000000100101f97 in ndb_thread_wrapper (_ss=0x101700cd0) at NdbThread.c:143
#4  0x00007fff829d506e in thread_start ()
#5  0x00007fff829d4f21 in thread_start ()

Thread 7 (core thread 6):
#0  0x00007fff8299bf36 in semaphore_wait_trap ()
#1  0x00007fff829a14f5 in pthread_mutex_lock ()
#2  0x00007fff829da941 in pthread_cond_wait ()
#3  0x0000000100101533 in NdbCondition_WaitTimeoutAbs (p_cond=0x10041c590, p_mutex=0x1004244a0, abstime=0x100752c20) at NdbCondition.c:195
#4  0x0000000100101400 in NdbCondition_WaitTimeout (p_cond=0x10041c590, p_mutex=0x1004244a0, msecs=100) at NdbCondition.c:145
#5  0x00000001001021ed in NdbThread_Create (p_thread_func=0x10011522a <sessionThread_C>, p_thread_arg=0x101800600, _stack_size=32768, p_thread_name=0x10013b0f0 "NdbSock_Session", thread_prio=NDB_THREAD_PRIO_LOW) at NdbThread.c:250
#6  0x000000010011596f in SocketServer::startSession (this=0x100805c20, si=@0x1004364f8) at SocketServer.cpp:283
#7  0x0000000100115c46 in SocketServer::doAccept (this=0x100805c20) at SocketServer.cpp:207
#8  0x0000000100115d17 in SocketServer::doRun (this=0x100805c20) at SocketServer.cpp:269
#9  0x0000000100115d5a in socketServerThread_C (_ss=0x100805c20) at SocketServer.cpp:227
#10 0x0000000100101fcb in ndb_thread_wrapper (_ss=0x10042b2d0) at NdbThread.c:147
#11 0x00007fff829d506e in thread_start ()
#12 0x00007fff829d4f21 in thread_start ()

How to repeat:
shell> ndb_mgmd
shell>  ndbd
shell>  ndbd

wait and CPU goes up to 80% while Thread 7 is hanging and not freeing the mutex lock.

This a regression from 6.3 to 7.0 and only happens on Snow Leopard.
[14 Sep 2009 13:49] Geert Vanderkelen
Just to confirm, I don't see ndb_mgmd having CPU load using MacOS X 10.5 (Leopard). There is still the ndb_mgm bug#34438.

(Note: removed codename 'Snow Leopard', version is 10.6 ..)
[15 Sep 2009 9:39] Bernd Ocklin
Not repeatable after clean re-install of MacPorts, XCode and in latest pulls.
[25 Sep 2009 13:57] Bernd Ocklin
Just was able to reproduce this again. Could be duplicate of #45497.
[16 Nov 2009 12:25] Bernd Ocklin
Getting in all the time now.
[16 Nov 2009 12:38] Geert Vanderkelen
Not a duplicate of #45497, re-opening and Verified using MySQL Cluster 7.0.9b (using Mac OS X 10.6.2, latest XCode, _no_ MacPorts)

Start ndb_mgmd and ndbd (do not use --nodaemon):
 shell> ndb_mgmd -f /path/to/config.ini
 shell> ndbd

While ndbd is starting, you can use ndb_mgm without problems:
 [ndbd(NDB)]	1 node(s)
 id=3	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0, Master)

 [ndb_mgmd(MGM)]	1 node(s)
 id=1	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9)

When the data node is started, no other nodes can access cluster and ndb_mgm hangs on every command. Cluster is not functional thus.

Workaround: start ndb_mgmd --nodaemon
[1 Dec 2009 9:00] Kai Voigt
I can confirm this behaviour on my Macbook.

# uname -a
Darwin Kai-Voigts-MacBook-Air.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386

Plain DMG installation of latest mysql-5.1.39 ndb-7.0.9 release.

ndb_mgmd --nodaemon will make the cluster run as expected, without that option, ndb_mgm -e show hangs after the nodes have been started.
[14 Jul 2010 10:18] Tobias Asplund
I was able to repeat as well.
Brand new, from the box Macbook Pro with Mac OS X 10.6.4 and XCode installed from the installation DVDs.
[3 Apr 2014 8:51] Magnus Blåudd
Thank you for taking the time to report a problem.  Unfortunately you are not using a current version of the product you reported a problem with -- the problem might already be fixed. Please download a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions, please change the version on this bug report to the version you tested and change the status back to "Open".  Again, thank you for your continued support of MySQL.