Extension Wizard - file open dialogs hang UI for several seconds

7/31/19 nightly on MacOS 10.14.4.

  1. Open slicer
  2. Go to Extension Wizard
  3. Click “Select Extension” (or anything that opens a file select dialog)

UI freezes (meaning window manager) - mouse movement continues, but dialog opens EXTREMELY slowly, and once it opens, it responds VERY slowly. MacOS UI Dock also does not respond - almost looks like window manager is overloaded/momentarily hung.

I should note that it is operational and useable, just very slow for these operations.

Yes, I’m seeing something similar with the nightly. If started in a terminal (e.g. with /Applications/Slicer-4.11.0-2019-07-19.app/Contents/MacOS/Slicer) I see messages like this appear until the extension window shows up. Once it’s up it seems to work fine. This is only on the nightly, 4.10.2 works fine for me.

[27972:100867:0805/102712.778974:ERROR:gl_context_cgl.cc(137)] Error creating context.
[27972:100867:0805/102712.798547:ERROR:gl_context_cgl.cc(137)] Error creating context.
"{3db9d341-53ba-4a2e-8962-4409eca87c7e}: 5: Operation canceled"
"{4891af70-fea6-4635-8816-9627c110eaf5}: 5: Operation canceled"
"{fbc2e3b6-f01e-44d3-8435-7fb1b48c4f3f}: 5: Operation canceled"
"{9dc4382b-cba6-4d58-91fe-93290d349288}: 5: Operation canceled"
"{17831f79-0336-492a-8854-5d933668c421}: 5: Operation canceled"
"{16c14595-6939-489e-a004-4e51a32d1bdb}: 5: Operation canceled"
"{c8853a8f-36ce-4dbc-9364-558eafbc7d94}: 5: Operation canceled"
"{bedbcf6e-7b05-4ca9-8766-8b1424fc7076}: 5: Operation canceled"
"{d1afaf15-073f-4f18-95aa-dd0dc52328c7}: 5: Operation canceled"
"{99ea99c9-1b2b-4632-82e4-6fb4ea293d4e}: 5: Operation canceled"
"{124fc397-84e4-4923-99bb-c86db8ae777c}: 5: Operation canceled"
"{139bdfbe-86e9-411c-91cc-3002b100e6fa}: 5: Operation canceled"
"{9fc50f60-bfb5-4d37-82bc-92ad197d19f0}: 5: Operation canceled"
"{6071fe8f-cd84-48e6-9755-8e923aa0cb0b}: 5: Operation canceled"
"{66b3b4c5-0a8a-44a9-bb90-15296be5c742}: 5: Operation canceled"
"{34e50472-12b0-48ea-994e-34fe9068fe7a}: 5: Operation canceled"
"{6b8acfcb-8d4f-4355-9cc3-22410d21d08f}: 5: Operation canceled"
"{48575e31-ef58-47c7-bae7-a6a4b72e8335}: 5: Operation canceled"
"{ceb132f1-217c-471f-a3ab-41dc9ceb49d5}: 5: Operation canceled"
"{f456950f-09fb-44e1-bf4d-49981662a254}: 5: Operation canceled"
"{332f5221-e05f-460e-8700-89c156e995dc}: 5: Operation canceled"
"{5fa1e706-50fe-4a19-81a6-9987833368e4}: 5: Operation canceled"

On the mac you can use the Activity Monitor application’s Sample Process option to get an idea of what’s going on, or you can use Instruments from Xcode for a more fine grained look.

OK. It’s not a huge deal as I don’t use the Extension Wizard often, once something is set up I’m more or less done and then I develop in emacs or whatever. Odd that it makes OpenGL hang for some weird reason. I wonder what’s being fed to create the context (and why this needs to be done to open a file dialog).

Thanks for looking at it.

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.


@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…)