Bug #114318 MySQL Workbench crashes using scripting shell command 'key' in dict on grt.Dict
Submitted: 12 Mar 10:36 Modified: 13 Apr 12:21
Reporter: Karsten Wutzke Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:8.0.36 OS:Windows (11)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: workbench crash

[12 Mar 10:36] Karsten Wutzke
Description:
I am able to crash MySQL Workbench with a simple set of actions:

1. Start Workbench
2. "File" menu -> "New Model"
3. "Scripting" menu -> "Scripting Shell" (new window opening)
4. In the "Shell" tab, see command line (white input text) below, then execute:

if 'jpaExportPluginOptions' in grt.root.wb.doc.physicalModels[0].catalog.customData: print("FAILED!")

This crashes the complete application without any error being shown.

How to repeat:
See description.

Suggested fix:
See https://bugs.mysql.com/bug.php?id=114316 for similar crash.

Please fix the "in" operator for grt.Dict.

I have a plugin that uses a key named "jpaExportPluginOptions" to store UI options used to how to generate code etc.

--

BTW: using

if grt.root.wb.doc.physicalModels[0].catalog.customData.has_key('jpaExportPluginOptions'): ...

is not an alternative, as this results in the following stack trace:

11:31:47 [INF][          print]: Executing generate_jpa_annotated_classes(catalog)... 
11:31:47 [INF][          print]: Custom data dictionary class is <class 'grt.Dict'>
11:31:47 [INF][          print]: Plugin options dictionary class is <class 'grt.Dict'>
11:31:47 [ERR][         python]: error calling AgileEntities.generate_jpa_annotated_classes
Traceback:
  No stack information.
NameError: Dict.has_key() takes no arguments (1 given)
11:31:47 [ERR][            grt]: Error executing plugin wb.catalog.util.generate_jpa_annotated_classes: error calling Python module function AgileEntities.generate_jpa_annotated_classes	
11:31:47 [ERR][      WBContext]: error calling Python module function AgileEntities.generate_jpa_annotated_classes
[13 Mar 12:21] MySQL Verification Team
Hello Karsten Wutzke,

Thank you for the bug report.
To investigate further this issue at our end, may I kindly request you to launch workbench under debug mode (--log-level=debug3) and provide unaltered workbench log file(more details about log are explained here - https://dev.mysql.com/doc/workbench/en/workbench-reporting-bugs.html)?

Regards,
Ashwini Patil
[14 Apr 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".