pydm icon indicating copy to clipboard operation
pydm copied to clipboard

PyDMEmbeddedDisplay cannot handle switching off .py files

Open kabanaty opened this issue 2 years ago • 3 comments

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 avatar Jul 01 '22 18:07 kabanaty

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

kabanaty avatar Jul 01 '22 20:07 kabanaty

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.

jbellister-slac avatar Jul 05 '22 19:07 jbellister-slac

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.

kabanaty avatar Oct 11 '22 07:10 kabanaty