Page MenuHomePhabricator

[Preferences] Cannot open SAM preference page after tool activation
Open, NormalPublic

Description

Segment Anything tool has its parameters set inside Preferences>Segmentation>Segment Anything.
However, the preferences page refuses to load if the SAM tool is already active and "READY". The workbench gets stuck and only way out is to Cntl+C quit and close.

OS: Ubuntu & MacOS

Works fine on windows & Ubuntu.

Event Timeline

a178n triaged this task as Normal priority.Jun 27 2023, 9:52 AM
a178n created this task.

After suspecting whether python process using std::async would be causing the issue, like below:

m_Future = std::async(std::launch::async, &mitk::SegmentAnythingPythonService::start_python_daemon, this);

I tried starting python process using basic std::thread like shown below:

std::thread([&](){mitk::SegmentAnythingPythonService::start_python_daemon();}).detach();

there is no change in behavior.
The issue root cause still eludes me.

Latest testing reveals that the issue is fixed in Ubuntu 22.04.
I think the reason is Qt6 update.

But despite Qt6, the issue exists on MacOS (Intel, Sonoma).

Since it is the only preference page not loading and it is only happening when your tool is active it is most definitely related to a shared resource that is blocked by your tool. Something like the Python process or its encapsulation. Since it does not seem to be a complete dead lock (?) probably something like a mutex or similar is involved? Or whatever the internals of start_python_daemon() are, only one instance may be active per process maybe?