Bug #65239 MySQL Workbench crashes when trying to forward engineer alter script
Submitted: 8 May 2012 11:07 Modified: 20 Jun 2012 12:58
Reporter: Rik Deuzeman Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:5.2.39 OS:MacOS (10.6.8)
Assigned to: CPU Architecture:Any
Tags: crash, forward engineer, synchronize model, workbench

[8 May 2012 11:07] Rik Deuzeman
Description:
When you try to synchronize model or forward engineer alter script in MySQL Workbench on a Mac the client crashes with the following code:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000003c
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00000000  ebx: 0x0061b049  ecx: 0x18760760  edx: 0xbfffbad4
  edi: 0x00000001  esi: 0x00000000  ebp: 0xbfffbb28  esp: 0xbfffbaa0
   ss: 0x0000001f  efl: 0x00010286  eip: 0x0061b321   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x0000003c

How to repeat:
Try on a Mac with Workbench:
file > export > forward engineer alter script or 
database > synchronize model 

When you come to the process of generating the Alter script Workbench crashes.

Suggested fix:
Don't know, didn't browse the code
[10 May 2012 19:27] Valeriy Kravchuk
Can you upload .mwb file that demonstrates the problem?
[11 May 2012 7:26] Rik Deuzeman
MWB with the problem

Attachment: test.mwb (application/octet-stream, text), 5.27 KiB.

[11 May 2012 7:32] Rik Deuzeman
I have pinpointed the problem.

When you add a foreign key, but forget to add the reference table (or didn't reverse engineer correctly) synchronizing the model result in a crash.

It is better to show an error message 'foreign keys not correctly defined' or something.
When you have a large data-model it is very difficult to find the incorrect foreign key.

Regards,
Rik Deuzeman
[15 May 2012 7:45] Valeriy Kravchuk
I do not get any crash while trying to synchronize model from .mwb file uploaded with local 5.1.61 on Mac OS X 10.5.x. Can you upload .sql file to generate ALTER script against or more detailed instructions on what to do with your .mwb file to get the crash?
[15 May 2012 7:54] Rik Deuzeman
I cannot add a sql alter script, because the crash occurs when generating the script.

I have Mac OSX 10.6.8 with version 5.2.39. Maybe that is the difference.

Like I already commented, it has to do with not defining the foreign key correctly.

Regards,
Rik
[20 May 2012 12:58] Valeriy Kravchuk
Please, check if the same problem still happens with a newer version, 5.2.40.
[21 Jun 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".