-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Issues with Odmr & Pulsed GUI after deactivating their logic modules. #153
Comments
The same behavior was observed with the procedure described above. The documentation on QueuedConnection:
So, it is likely that the disconnections of the signals in the gui are not properly handeled, which messes up the thread management. As @timoML suggested, I tried to call the disconnect functions before the logic is deactivated. At the same time, I noticed that activate of logic is called before activate of gui when activate_gui is called.
I guess this is called in activate of ManagedModule
So far, I do not understand why it wants to move to the logic thread when activate of gui is called. |
Now I tried the same procedure with different modules.
I will have a look on the corresponding codes. |
I looked into the ODMR modules. I couldn't find an immediately obvious error in the order of deactivation and activation. However, I have tried the description of @astropiuu and find somewhat weird behavior trying different things. case 1:
case 2:
It seems strange to me that with the reload function of the logic everything works just fine, even if the logic was initially deactivated and activated as before. I don't have enough insight to understand the difference between the two. Is it possible that the reload function provides a full reset of the internal states and Qt bindings, that is not given with the deactivation/activation process? Maybe anyone with more knowledge of the Qudi core functions can comment? If that is not the case, it is also possible that the problem is not related to Qudi but rather to Qt. In most other modules the re-activation works well. Maybe Qt fails with some garbage collection or dangling pointers causing the thread error as reported ... |
Currently deactivating and activating a module will not delete the module instance and recreate it but just call From a quick glance I can not see what's wrong with the module. Might be a Qt bug but I'm not sure. Needs more time to investigate. |
Version
current main
What is affected by the bug?
Qudi crashes when relaunching the Odmr GUI module after deactivating or clearing status variables for the Odmr logic unless the logic module is manually reactivated and reloaded. In case of Pulsed GUI, Qudi doesn't crash but the GUI module won't launch and throw errors.
When does the bug occur?
It occurs when the GUI modules are launched, followed by deactivation of logic module and then relaunching the GUI.
How do we replicate the issue?
Expected behavior
Unlike Odmr & Pulsed, other modules relaunch normally and don't crash under similar sequence of actions.
Relevant log output
Additional Comments
The issue has been observed on the current version of Qudi on Windows 10 with the dummy config.
I was able to trace the cause to line 176 in odmrgui.py . I think the issue occurs when setting up the connection between GUI signal and Logic slot. Using QueuedConnection might try to move the GUI object to the Logic module's thread. But, my speculation is that the GUI object is still in the previous logic module's thread and can't be moved from the current thread?
What seems to work for Odmr is reloading and reactivaing the logic module after deactivating it. If GUI is launched then, it launches normally. Pulsed GUI seems more complicated.
Contact Details
mohit.shah@uni-ulm.de
The text was updated successfully, but these errors were encountered: