-
Notifications
You must be signed in to change notification settings - Fork 62
napari-widget: Seg Fault When Deleting Data #433
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
Comments
My first thought is that the "deleting a layer" event is not being sent (or received by) the slider / play widget. To check for this;
If we don't get the seg-fault, then it likely means that the slider / play button stores a reference to the dataset layer it is displaying. Explicitly clicking on a layer usually emits a signal that updates this reference. If we don't get a seg-fault in this case, then the issue is likely that the slider / play button does not interpret the "delete layer" signal correctly. (If we do get a seg-fault, I'm back at the drawing board). Following on from this, my next check would be to investigate what napari does when the active / selected layer is deleted. We can repeat the above steps, but skip the "explicitly select the remaining layer dataset".
|
Hey, I've been looking into how this might get fixed and I'm fairly certain this is a bug in the Napari backend (also referenced here: napari/napari#7668). In a nutshell, the issue seems to be that Napari's AnimationThread (independent worker which processes the animation) creates a reference to the QtDimsSlider widget (gui for the play button and slider) when you click the play button which becomes stale if you delete the last layer (which deletes the QtDimsSlider object). If you load new data (creating a new QtDimsSlider) and try to push the play button, the AnimationThread will try to disconnect from the deleted widget so it can connect to the new one and fail because it no longer exists. Therefore, this error will occur if the play button/slider widget is deleted (likely because the last layer was deleted) after you click the play button, then create a new play button/slider widget (likely because you loaded new data) and try to click the new play button. Re-initializing the AnimationThread after deleting all layers prevents the bug from occurring (probably with unintended side effects). Here's how you can do that if you want to see yourself:
In any case, since this doesn't actually have anything to do with how we load data/layers I think fixing this is probably outside the scope of movement. I'm interested in contributing to NIU projects more so let me know if there's anything else I can do to help on the matter. |
Thanks for the in-depth detective work @DPWebster, it seems that you've managed to pinpoint this one.
You are welcome to follow up on this matter, depending on what the |
It will be nice if you could check if napari/napari#7866 solves your issue (If I properly spot the problem). |
Cool! Thanks @Czaki, I will test locally and let you know. |
Based on my tests, napari/napari#7866 indeed solves this issue! |
Good to see that everything's cleared up!
I could safely spare around 10 hours a week @niksirbi; I'm open to working on anything, though napari-related issues might be a better fit as both of the issues I've looked into so far have been bugs relating to napari GUIs. |
Great to hear, @sfmig is currently deep into the napari part of the codebase, so she might have some ideas about a simple task to get you started. |
To resolve this issue, we only have to wait for the |
Hi @DPWebster, great to hear that you are interested in contributing to our napari widget! I think a nice first one to tackle may be this issue on visualising bounding boxes #567. I'd recommend starting with the bounding boxes datasets only, but it would be great if we can next tackle issue #17 and expand the functionality to pose datasets as well. Let me know thoughts! |
napari release should be in one or two days. |
Describe the bug
We currently get a segmentation fault from inside Qt when deleting layers that the plugin has loaded.
To Reproduce
napari
with themovement
plugin loaded,napari -w movement
DLC_single-mouse_EPM.predictions.h5
(as in the user-guide).Expected behaviour
There should be no segmentation fault here.
Additional context
First identified in #393
The text was updated successfully, but these errors were encountered: