populse / populse_mia

Multiparametric Image Analysis
Other
10 stars 9 forks source link

[Iteration enhancement] RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted #223

Closed servoz closed 2 years ago

servoz commented 3 years ago

As already observed earlier, we sometimes see exceptions being raised during initialisation in iteration modes. It seemed to be erratic so I was hesitating to open a ticket about it as it is difficult to give a minimum procedure to reproduce an erratic problem. But I've seen this issue several times while working on iteration and it's really annoying. I'm trying here a minimal procedure to reproduce, knowing that I haven't yet succeeded in finding the exact cause ...:

Completion ...

. Iteration_pipeline.in_files_filter (mia_processes.bricks.tools.tools.Input_Filter) MIA node ...

During the <mia_processes.bricks.tools.tools.Input_Filter object at 0x7f930f29f360> process initialisation, some possible problems were detected:

Exception occurred in traits notification handler for object: <populse_mia.user_interface.pipeline_manager.process_mia.MIAProcessCompletionEngine object at 0x7f930fc42ca8>, trait: completion_progress, old value: 0.0, new value: 1.0 Traceback (most recent call last): File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event self.dispatch(handler, args) File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch handler(args) File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed if not hasattr(self, 'progressdialog'): RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted

. main (mia_processes.bricks.preprocess.spm.spatial_preprocessing.Smooth) MIA node ...

. main (mia_processes.bricks.preprocess.spm.spatial_preprocessing.Smooth) MIA node ... Exception occurred in traits notification handler for object: <populse_mia.user_interface.pipeline_manager.process_mia.MIAProcessCompletionEngine object at 0x7f930f451b48>, trait: completion_progress, old value: 0.0, new value: 2.05 Traceback (most recent call last): File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event self.dispatch(handler, args) File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch handler(args) File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed if not hasattr(self, 'progressdialog'): RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted

Error during initialisation of the "NoName" pipeline ...! Traceback: File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 1206, in initialize self.test_init = self.init_pipeline() File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 1270, in init_pipeline self.complete_pipeline_parameters(pipeline) File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 983, in complete_pipeline_parameters completion.complete_parameters() File "/casa/home/Git_projects/populse_mia/python/populse_mia/user_interface/pipeline_manager/process_mia.py", line 310, in complete_parameters self.completion_progress = self.fallback_engine.completion_progress File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 478, in call self.notify_listener(self, object, trait_name, old, new) File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 553, in _notify_method_listener object, trait_name, old, new, listener File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 532, in _dispatch_change_event handle_exception(object, trait_name, old, new) File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 149, in _handle_exception raise excp File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 524, in _dispatch_change_event self.dispatch(handler, args) File "/casa/home/.local/lib/python3.6/site-packages/traits/trait_notifiers.py", line 619, in dispatch handler(args) File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/attributed_process_widget.py", line 430, in _completion_progress_changed if not hasattr(self, 'progressdialog'): RuntimeError: wrapped C/C++ object of type AttributedProcessWidget has been deleted


  - In Data Browser we observe that no indexing has been done during the initialisation.
  - Because the `Run pipeline` button is enabled, click on this (careful! if we go to another tab after the initialisation, by going to the Data Browser or another editor of the Pipeline Manager and returning to the previous editor of the Pipeline Manager, the `Run Pipeline` button is no longer available!) :
    - The run step goes smoothly, the expected data are found in the derived_data directory. Of course, this is an run that did not produce any indexing of the database (so it's not just an issue with an exception being thrown that has no impact!)

**Note:** after several tries, i managed to reproduce the bug by following this procedure and then clicking on the in_files_filter node  before clicking on the initialise button .... it seems like a voodoo incantation...
servoz commented 3 years ago

I think we have a case of: the C++ object is deleted by Qt but the Python wrapper still exists.