Bug #45718 Segmentation fault on Export / Forward Engineer
Submitted: 24 Jun 2009 16:55 Modified: 7 Jul 2009 16:36
Reporter: Matteo Snidero Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1.14 OS:Linux (Ubuntu 9.04)
Assigned to: Maksym Yehorov CPU Architecture:Any
Tags: 5.1, CHECKED, Create Schema, export, forward engineer, segmentation fault

[24 Jun 2009 16:55] Matteo Snidero
Description:
Upon exporting my model (47 tables 29 views) with either File-> Export > Forward Engineer SQL CREATE SCRIPT or Database -> Forward Engineer WB crashes (segmentation fault) after the form to select the objects to export. Same behaviour with one or all objects.

The version (5.1.14 RC) was successfully compiled from source on Ubuntu 9.04.
What follows are the output of  $./mysql-workbench 2> ~/errorlog ($./mysql-workbench 1> ~/log too long):
 
===============================
$./mysql-workbench 2> ~/errorlog
===============================

** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/db.mysql.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/catalog_utils.grt.lua' (lua)
** Message: Initialized Lua module /usr/share/mysql-workbench/lib/mysql-workbench/modules/catalog_utils.grt.lua (WbUtils)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/wb.mysql.validation.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/wb.model.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/db.mysql.sqlparser.grt.so' (cpp)

** (mysql-workbench-bin:14258): WARNING **: Native C++ module classes must have the suffix Impl to avoid confusion between implementation and wrapper classes (MysqlSqlFacade)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/forms.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/tools.grt.lua' (lua)
** Message: Initialized Lua module /usr/share/mysql-workbench/lib/mysql-workbench/modules/tools.grt.lua (WbTools)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/dbutils.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/table_utils.grt.lua' (lua)
** Message: Initialized Lua module /usr/share/mysql-workbench/lib/mysql-workbench/modules/table_utils.grt.lua (WbTableUtils)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/wb.validation.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/modules/wb.mysql.import.grt.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/plugins/db.mysql.editors.wbp.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/plugins/db.mysql.wbp.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/plugins/wb.printing.wbp.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/plugins/db.mysql.diff.reporting.wbp.so' (cpp)
** Message: Trying to load module '/usr/share/mysql-workbench/lib/mysql-workbench/plugins/wb.model.editors.wbp.so' (cpp)

** (mysql-workbench-bin:14258): WARNING **: Plugin 'wb.tools.quickTables' from module WbTools has invalid type ''

** (mysql-workbench-bin:14258): WARNING **: :1463: link 'com.mysql.wb.menu.tools.debug' <object app.MenuItem> key=owner could not be resolved

** (mysql-workbench-bin:14258): WARNING **: :1472: link 'com.mysql.wb.menu.tools.debug' <object app.MenuItem> key=owner could not be resolved

** (mysql-workbench-bin:14258): WARNING **: /home/matteo/.mysql/workbench/wb_options.xml:321: link '4fcee7d2-60dc-11de-ad6e-000ffe698e13' <object GrtObject> key=owner could not be resolved
** Message: item_activated: 0x1157db0 -> 'plugin:wb.file.openModel'

** (mysql-workbench-bin:14258): WARNING **: /tmp/SubloanMonitoringDB_model.mwbd9/document.mwb.xml:20120: link 'cf664b88-60c7-11de-ad6e-000ffe698e13' <object > key= could not be resolved

** (mysql-workbench-bin:14258): WARNING **: skipping element 'link' in unserialized document, line 20120

** (mysql-workbench-bin:14258): WARNING **: /tmp/SubloanMonitoringDB_model.mwbd9/document.mwb.xml:20158: link 'cf664914-60c7-11de-ad6e-000ffe698e13' <object GrtObject> key=owner could not be resolved
** Message: unhandled message 4: wb.file.openModel finished in 0.70s

** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: item_activated: 0x1602910 -> 'plugin:wb.file.openModel'

** (mysql-workbench-bin:14258): WARNING **: /tmp/SubloanMonitoringDB_model.mwbd9/document.mwb.xml:20120: link 'cf664b88-60c7-11de-ad6e-000ffe698e13' <object > key= could not be resolved

** (mysql-workbench-bin:14258): WARNING **: skipping element 'link' in unserialized document, line 20120

** (mysql-workbench-bin:14258): WARNING **: /tmp/SubloanMonitoringDB_model.mwbd9/document.mwb.xml:20158: link 'cf664914-60c7-11de-ad6e-000ffe698e13' <object GrtObject> key=owner could not be resolved
** Message: unhandled message 4: wb.file.openModel finished in 0.71s

** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: rebuild options
** Message: rebuild options

(mysql-workbench-bin:14258): Gtk-CRITICAL **: gtk_tree_view_unref_tree_helper: assertion `node != NULL' failed
** Message: rebuild options
** Message: item_activated: 0x12a1cf0 -> 'plugin:db.mysql.plugin.export.sql'
** Message: unhandled message 4: db.mysql.plugin.export.sql finished in 0.00s

** Message: mforms::ListBoxImpl::set_heading('Objects to Process') not implemented
** Message: mforms::ListBoxImpl::set_heading('Excluded Objects') not implemented
** Message: mforms::ListBoxImpl::set_heading('Objects to Process') not implemented
** Message: mforms::ListBoxImpl::set_heading('Excluded Objects') not implemented
** Message: mforms::ListBoxImpl::set_heading('Objects to Process') not implemented
** Message: mforms::ListBoxImpl::set_heading('Excluded Objects') not implemented
** Message: mforms::ListBoxImpl::set_heading('Objects to Process') not implemented
** Message: mforms::ListBoxImpl::set_heading('Excluded Objects') not implemented
** Message: mforms::ListBoxImpl::set_heading('Objects to Process') not implemented
** Message: mforms::ListBoxImpl::set_heading('Excluded Objects') not implemented
Segmentation fault

How to repeat:
Unfortunately in my environment I have not found a way NOT to make the export crash. Multiple options and filters in the export all result in the segmentation fault.
[24 Jun 2009 17:04] MySQL Verification Team
Thank you for the bug report. The Windows version also fails with the model provided.
[29 Jun 2009 8:03] Matteo Snidero
Dear Miguel or anyone, a recommendation on where I should start changing the model in order to make it more digestible to the export - forward engineering routine and hopefully avoid the crash?
Thanks so much,
Matteo
[1 Jul 2009 12:27] Maksym Yehorov
Validation report for the model given

Attachment: report.gif (image/gif, text), 36.49 KiB.

[1 Jul 2009 12:29] Maksym Yehorov
Thanks for the report. Matteo, your model contains errors. We were able to fix some bugs and add some extra validation for the case. 
   Workbench OSS version does not have validations, so I attached validations result to this bug report, as this broken model crashes the application.

fixed in rev #4223.
[1 Jul 2009 13:23] Matteo Snidero
Dear Maksym and everyone.
Thanks so much for your investigation. Thanks to your validation report I will be able to fix my model. 
I am very grateful for your excellent support.
Matteo
[2 Jul 2009 9:37] Johannes Taxacher
fixes preventing crashing WB due to faulty doc confirmed.
fixed in 5.1.16
[7 Jul 2009 16:36] Tony Bedford
An entry was added to the 5.1.16 changelog:

When a model was exported using either File, Export, Forward Engineer SQL CREATE Script or Database, Forward Engineer..., MySQL Workbench crashed with a segmentation fault. This occurred after the objects to export were selected, it did not matter if one or all objects were selected. This occurred using MySQL Workbench 5.1.14 RC on Ubuntu Linux and Windows.