Extension Wizard - file open dialogs hang UI for several seconds

It may be caused by the extension manager. Does it happen if you remove Slicer-NNN.ini file? Does it happen if you rename the entire NA-MIC folder in your profile folder?

I believe there are a couple issues - the webengine in the qt version we are using seems to have a graphics context issue, and then the option to restore previous extensions sometimes seems to have networking issues. I don’t end up using it a lot either so I haven’t looked any deeper.

I’ve been working on getting the nightly Slicer builds to all use Qt 5.12.4, so hopefully once that is complete it will fix the QWebEngine error here.

The current macOS nightly uses Qt 5.10.0 which was released December 2017 while macOS 10.14 which @hherhold is using wasn’t originally released until September 2018.

Qt 5.12 is a LTS release so it will have longer support/bug fixes for new macOS releases.

2 Likes

@che85 told me today he has issues with slow Slicer startup and long 10-20 second delay when displaying any file dialog on his Mac. Using Instruments tool showed that the delay is most likely caused by tccd process. This may be also related to the “Allow Slicer application to control your computer?” question that is shown on some Macs.

Others have experienced this issue, too, for example FreeCAD and Skyrim.

Hopefully updating to a more recent Qt will solve this. @jamesobutler if you have a preview build that uses a recent Qt version then it would be great if you could send it to @che85 for testing.

1 Like

Any progress on this? I still get these hangs occasionally.

@jamesobutler did you have a chance to build Slicer with a more recent Qt? Could you create a package that @hherhold or @che85 could test?

Sorry, I do not. I was borrowing a system during my development period back then.

Qt 5.12 series upgrading will require upgrades to the Slicer factory build machines as specified in my PRs there https://github.com/Slicer/DashboardScripts/pulls. Currently unclear if and when support for that would be coming around.

At the time I was doing various work to make Slicer easier to build using the latest compilers as that is the source of the problem for many basic users building from source.

@Sunderlandkyl could you create a Slicer Mac package with a latest possible Qt version so that people with the startup/filedialog hang issue coult try it?

1 Like

I can build from source with Qt 5.12 and see what happens. I seem to remember last time I built it locally it worked okay, but that was some months ago - I stopped building from source when I started doing only Python development.

My local build using Qt 5.12 does not have the problem. I did run a ‘make package’ and ran into errors towards the end, starting with:

768 - fixing item /Volumes/CT_Work/SB/Slicer-build/bin/libqSlicerApp.dylib with @rpath/lib/Slicer-4.11
Error copying file "@rpath/libSimpleITKBasicFilters0-1.3.1.dylib" to "/Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/lib/Slicer-4.11/libSimpleITKBasicFilters0-1.3.1.dylib".
chmod: /Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/lib/Slicer-4.11/libSimpleITKBasicFilters0-1.3.1.dylib: No such file or directory

This went on for a while, then recovered and finished with:

776 - fixing item /usr/local/Cellar/qt/5.12.0/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore with @rpath/Frameworks
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open input file: /Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess for writing (Permission denied)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't lseek to offset: 0 in file: /Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess for writing (Bad file descriptor)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't write new headers in file: /Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess (Bad file descriptor)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't close written on input file: /Volumes/CT_Work/SB/Slicer-build/_CPack_Packages/macosx-amd64/DragNDrop/Slicer-4.11.0-2019-11-07-macosx-amd64/Slicer.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess (Bad file descriptor)
CPack: Create package
CPack Error: Error executing: /usr/bin/hdiutil detach "/Volumes/Slicer-4.11.0-2019-11-07-macosx-amd64"
CPack Error: Error detaching temporary disk image.
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: Slicer
make: *** [package] Error 1

The Slicer app packed into the dmg did seem to work, though, but I didn’t test it extensively (yet).

I’m happy to post that DMG somewhere for testing/use if these packaging errors are ignorable.

I would be great. Dropbox, OneDrive, etc. should work.

@Sunderlandkyl have you tried to build and package, too? Have you experienced similar packaging issues?

Disk image uploading now, should be ready in a few mins.

1 Like

@che85 Could you try the package above and see if you still have the issues of long startup time and long time required for file selection dialogs to show up. Thanks!

Interesting - I tried the build that @hherhold made, and it gave me the dialog box shown below when I tried to open the extension manager. The extension manager dialog does show up but is blank. Today’s factory nightly build on the same mac works fine, and the extension manager takes just a second or two to start up and displays correctly.

@pieper What MacOSX version do you use? Have you experienced slow startup and long wait before file selection dialogs show up? Do you remember that the OS asked you for permission to Slicer control your computer? Did you give permission? (these slowdowns are caused by waiting for tccd process and it is likely related to some security or accessibility checks).

This is kind of odd. When I run the app from the package, I get the window manager hang. When I run it from the command line (i.e., Slicer-build/Slicer), I do not get the hang.

I wonder if it’s a problem with improper packaging, and not all the correct libraries are included, and Slicer falls back on system-installed libraries? (totally shooting in the dark here…)

I’m testing on 10.14.6. It does ask for permissions from time to time but I decline and it doesn’t seem to matter.

I’m installing the latest 10.15 on an older machine now, so I can test that out and let you know.

Interesting idea - in the Activity Monitor if you select a process and click the info icon (i in circle) you can list all the open files and ports, which will show you which libs are in use, so you could compare.

There’s nothing obviously different in the libs at first glance. The packaged one is using the packaged libraries, which (presumably) came from my system, as that’s where it was built using Qt 5.12 from Homebrew.

On macos 10.15, both the factory preview and @hherhold’s build take about 10 seconds to bring up the extension manager. 4.10.2 opens right away.

On a side note, slicer seems to run fine on 10.15, but with stricter default security permissions - you must manually go to the security settings and manually approve each version of the app, you can’t just use the context menu Open.

1 Like