Bug #32290 MySQL Administrator crashes repeatedly
Submitted: 12 Nov 2007 18:15 Modified: 14 May 2009 12:42
Reporter: Mike van der Merwe Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:Administrator 1.2.12 Gui Tools 5.0-r12 OS:MacOS (10.5 Leopard)
Assigned to: CPU Architecture:Any
Tags: crash

[12 Nov 2007 18:15] Mike van der Merwe
Description:
MySQL Administrator crashes frequently and with no obvious cause.

How to repeat:
This bug is hard to repeat because it is random. Sometimes you can create a table with ten fields and it will be fine. 

Sometimes it crashes constantly and the only way around it is to save each field after it has been added. If it crashes you at least don't lose all the fields you added previously.

To repeat, creating a few tables each with more than a few fields. MySql Administrator is guaranteed to crash it several times in the process.

MySQL Administrator crashes equally frequently under 10.4.10 Tiger and 10.5 Leopard.

Suggested fix:
There are two common things from the crash logs. It will crash either on willDisplayCell or applyChanges.

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000001c

Thread 0 Crashed:
0   com.mysql.MySQLToolsCommon    	0x10016fb8 -[MTableEditor(Private) tableView:willDisplayCell:forTableColumn:row:] + 820
1   com.apple.AppKit              	0x91ccef90 -[NSTableView preparedCellAtColumn:row:] + 936
2   com.apple.AppKit              	0x91cceb20 -[NSTableView _drawContentsAtRow:column:withCellFrame:] + 60
3   com.apple.AppKit              	0x91cce064 -[NSTableView drawRow:clipRect:] + 752
4   com.apple.AppKit              	0x91c7c6a8 -[NSTableView drawRowIndexes:clipRect:] + 340
5   com.apple.AppKit              	0x91c7b4a8 -[NSTableView drawRect:] + 1704
6   com.apple.AppKit              	0x91cfc044 -[NSView _drawRect:clip:] + 2908

... or ...

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c18631cf

Thread 0 Crashed:
0   libobjc.A.dylib               	0x911c4ff8 objc_msgSend + 24
1   com.mysql.MySQLToolsCommon    	0x1001bccc -[MTableEditor applyChanges:] + 488
2   com.apple.AppKit              	0x91d04358 -[NSApplication sendAction:to:from:] + 104
3   com.apple.AppKit              	0x91d0428c -[NSControl sendAction:to:] + 92
4   com.apple.AppKit              	0x91d037a4 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1584
5   com.apple.AppKit              	0x91d030dc -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 516
6   com.apple.AppKit              	0x91d02a18 -[NSControl mouseDown:] + 804
7   com.apple.AppKit              	0x91d01454 -[NSWindow sendEvent:] + 4512
8   com.apple.AppKit              	0x91cd48f0 -[NSApplication sendEvent:] + 3128
9   com.apple.AppKit              	0x91c41ed4 -[NSApplication run] + 776
10  com.apple.AppKit              	0x91c1292c NSApplicationMain + 440
11  com.mysql.Administrator       	0x00003394 main + 60
12  com.mysql.Administrator       	0x00002f10 _start + 336 (crt.c:272)
13  com.mysql.Administrator       	0x00002db8 start + 56
[13 Nov 2007 7:51] Sveta Smirnova
Thank you for the report.

Please provide output of SHOW CREATE TABLE for table you experienced crash with.
[13 Nov 2007 8:03] Mike van der Merwe
The database I'm working has nineteen tables, and it's probably happened on most of them. Below is one of the tables it has crashed on. For example, yesterday I needed to add the last three fields you see in the table. It crashed when I attempted to add the pwdirty field, and then when I restarted it, it allowed me to add and save the pwdirty field. But it crashed when I attempted to add lastaccess and lastip fields. I then restarted Administrator and was able to add the lastaccess and lastip fields.

CREATE TABLE `users` (
  `uid` bigint(20) unsigned NOT NULL auto_increment,
  `email` varchar(128) NOT NULL,
  `username` varchar(25) NOT NULL,
  `password` varchar(32) NOT NULL COMMENT 'MD5 of password',
  `membertype` enum('U','B') NOT NULL COMMENT 'User or Broker',
  `sponsor_key` int(10) unsigned default NULL,
  `nationalidno` varchar(35) NOT NULL,
  `active` tinyint(1) NOT NULL default '0',
  `pwdirty` tinyint(1) NOT NULL default '0',
  `lastaccess` datetime default NULL,
  `lastip` varchar(15) default NULL,
  PRIMARY KEY  (`uid`),
  KEY `sponsor_broker_fk` (`sponsor_key`),
  CONSTRAINT `sponsor_broker_fk` FOREIGN KEY (`sponsor_key`) REFERENCES `brokers` (`uid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
[13 Nov 2007 8:26] Sveta Smirnova
Thank you for the feedback.

Verified as described.

To repeat just try to create such table using MySQL Administrator. In my case program crashes after creating `membertype` field.
[16 Nov 2007 14:13] Antonio Pinto
Same problem for me on OS X Leopard. It crashes randomly.
[19 Jan 2008 14:42] marcel kornblum
I'm on OS X 10.5 too and see the same behaviour.

However, it seems to be after adding a new field, when you then click on an empty part of the dataset area (where the columns are listed) as opposed to the details view section or using the keyboard.
[1 Feb 2008 3:07] Daniel Dobkin
I've been seeing this too; since the OS upgrade to 10.5 it has been worse, when it appears.  Sometimes it doesn't appear at all; today I can barely edit tables.

After playing with it a bit, I am able to reproduce the crash at will (almost).  Here's a simple test case:

CREATE TABLE `MYPLAN` (
  `id` bigint(20) unsigned NOT NULL default '0',
  `client_ID` bigint(20) unsigned NOT NULL default '1',
  `planID` bigint(20) unsigned NOT NULL,
  `planVAL` bigint(20) unsigned default '0',
  `created_by` bigint(20) unsigned default NULL,
  `created_on` datetime default '0000-00-00 00:00:00',
  `expires_on` datetime NOT NULL default '9999-12-31 23:59:59',
  PRIMARY KEY  (`client_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Try to modify this table:
  * change "planVAL" to NOT NULL and apply changes
  * change "planVAL" back (turn off "NOT NULL" checkbox) and apply changes
  * change "planVAL" to NOT NULL again and apply changes

It's here that I crash, every time.  Never get to the popup that shows the ALTER TABLE syntax.
[28 Feb 2009 19:00] [ name withheld ]
Well, it appears as if this application has been abandoned.
It's been over a year, and the status of this issue remains unchanged, as do many others.
No closed tickets since 2006.

The only alternative I've found (other than command line) is running the Windows version in a VM.
A bit like walking around the block to get to the kitchen, but at least it works.
[14 May 2009 12:42] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Administrator into MySQL Workbench. Unfortunately you are using an unsupported platform. More informations about supported platforms you will find here:

http://www.mysql.com/support/supportedplatforms/tools.html

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/