slaclab / pydm

Python Display Manager
http://slaclab.github.io/pydm/
Other
112 stars 77 forks source link

PyDMEmbeddedDisplay cannot handle switching off .py files #894

Open kabanaty opened 2 years ago

kabanaty commented 2 years ago

Describe the bug I'm using a single PyDMEmbeddedDisplay that gets it's filename changed dynamically after a user clicks a button. If switching from one .ui file to another file (.ui or .py), there is no issue. If the embedded display file is a .py file, the file will load and display as an embedded file. When trying to dynamically change the filename from a .py file to a different file (.ui or .py) a segmentation fault occurs.

Expected behavior I expect the PyDMEmbeddedDisplay widget to change filenames seamlessly and display the new content without causing a segmentation fault.

Steps to Reproduce From development, cd /u/cd/kabanaty/pydm_sandbox/ pydm embed_test.py Toggle between filenames using the provided buttons

My Platform Python 3.8.13 PyDM 1.16.2

kabanaty commented 2 years ago

Just found that in Designer, trying to enter a .py filename and then changing the filename will crash Designer. Potentially related.

jbellister-slac commented 2 years ago

I think a couple updates to SuperProbe will fix this. If you compare the current version to /u/cd/jesseb/SuperProbe.py you can see the two changes (both related to spacers)

Adding the same spacer object to 2 different layouts seems to be causing the segfault when hitting the button to swap embedded displays. When cleaning up the SuperProbe application, the first layout will delete the spacer, then the second layout tries to do the same and fails.

Let me know if there are still any issues after trying that.

kabanaty commented 1 year ago

Thanks for taking a look at this Jesse. When I get back from vacation I can look at it again. I was having this issue with most (if not all) of my .py pages, not just SuperProbe.

If it is just a strange SpacerItem interaction, it should still be patched so this strange error doesn’t occur to someone unsuspecting.

On Jul 5, 2022, at 3:55 PM, jbellister-slac @.***> wrote:

 I think a couple updates to SuperProbe will fix this. If you compare the current version to /u/cd/jesseb/SuperProbe.py you can see the two changes (both related to spacers)

Adding the same spacer object to 2 different layouts seems to be causing the segfault when hitting the button to swap embedded displays. When cleaning up the SuperProbe application, the first layout will delete the spacer, then the second layout tries to do the same and fails.

Let me know if there are still any issues after trying that.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.