Ticket #2556 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

MantidPlot: scripting window can crash Mantid if a python script is running

Reported by: Mathieu Doucet Owned by: Martyn Gigg
Priority: major Milestone: Iteration 28
Component: MantidPlot Keywords:
Cc: Blocked By:
Blocking: Tester: Owen Arnold

Description

  • Start a python algorithm that will run for a long time (from the algorithm list)
  • Click the python script icon to make the scripting window appear.
  • Kill the scripting window using the X button
  • Click the python script icon to make the scripting window reappear.
  • If the python algorithm is still running, MantidPlot will seg fault.

This seems to be related to the fact that a new PythonScript object is created whenever a scripting window or tab is created.

Comment out the following lines in PythonScript.cpp and there will be no crash. On the other hand you will lose all the Mantid imports (which could be done at execution time anyway):

  PyObject *pymodule = PyImport_AddModule("__main__");
  localDict = PyDict_Copy(PyModule_GetDict(pymodule));

Change History

comment:1 Changed 10 years ago by Martyn Gigg

  • Owner set to Martyn Gigg
  • Status changed from new to accepted

comment:2 Changed 10 years ago by Martyn Gigg

(In [10192]) Refs #2562 #2556. Should fix problems with scripting window interaction when other things are runnning. The GIL needs aquiring so that Pythn can switch between different running sections, i.e. a Python algorithm from the GUI and a script. Annoying small local changes seems to have had quite an impact.

comment:3 Changed 10 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:4 Changed 9 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:5 Changed 9 years ago by Roman Tolchenov

  • Status changed from verifying to reopened
  • Resolution fixed deleted

It is still crashing

comment:6 Changed 9 years ago by Martyn Gigg

  • Status changed from reopened to accepted

This seems to have been fixed as it doesn't occur for me now.

comment:7 Changed 9 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:8 Changed 9 years ago by Roman Tolchenov

  • Status changed from verify to reopened
  • Resolution fixed deleted

comment:9 Changed 9 years ago by Martyn Gigg

  • Status changed from reopened to accepted

Most up-to-date dev build and release build from servers seems okay.

comment:10 Changed 9 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:11 Changed 9 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester changed from Roman Tolchenov to Owen Arnold

comment:12 Changed 9 years ago by Owen Arnold

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Only works if the scripting window has been opened prior to running the python algorithm. Tried with the python squares algorithm

Algorithm: Squares v1 Parameters:

Name: MaxRange, Value: 1000000, Default?: No, Direction: Input Name: Preamble, Value: 100000, Default?: No, Direction: Input Name: Sum, Value: 1, Default?: No, Direction: Input Name: OutputFile, Value: C:\MantidInstall\bin\1, Default?: No, Direction: Input Name: OutputWorkspace, Value: 1, Default?: No, Direction: Output

comment:13 Changed 9 years ago by Martyn Gigg

  • Status changed from reopened to verify
  • Resolution set to fixed

(In [11186]) Two parts: Fix issue with python scripting window crashing while a python algorithm is running (not an ideal fix but a new issue has been created to sure up the stuff properly. Fixes #2556. Fix for crash when viewing curve properties from the right-click menu on the plot. Fixes #2890

comment:14 Changed 9 years ago by Owen Arnold

  • Status changed from verify to verifying

comment:15 Changed 9 years ago by Owen Arnold

  • Status changed from verifying to closed

Checked exact situation that was brining down Mantid previously. Works with latest (development) build.

comment:16 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3403

Note: See TracTickets for help on using tickets.