« Position and resize F… | Home | Top 10 from the MBS P… »

Avoiding macOS Ventura crashes when loading plugins

Since macOS Ventura was released in October, we got plenty of crash reports from Xojo developers. There are bugs in macOS Ventura when loading dynamic libraries. Loading a dylib crashes with a probability of around 1%. Now a full set of MBS Plugins has over 500 dylibs and in our tests the crashes usually happen in the higher ranges like after 300, 400 or 500 dylibs are loaded. The crash reports look like this:

Process:               Xojo [...]
Path:                  /.../Xojo.app/Contents/MacOS/Xojo
Identifier:            com.xojo.xojo
Version:               22.4.0.... (22.4.0.3....)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               ...

Date/Time:             ...
OS Version:            macOS 13.1 (22C65)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   dyld  ...  dyld4::RuntimeState::addPermanentRanges(dyld3::Array const&) + 44
1   dyld  ...  dyld4::RuntimeState::addPermanentRanges(dyld3::Array const&) + 24
2   dyld  ...  dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()() const + 1128
3   dyld  ...  dyld4::APIs::dlopen_from(char const*, int, void*) + 892
...
8   Xojo  ...  PluginBridge.LoadPlugin%b%oo + 96
9   Xojo  ...  RBLibrary.LoadOnePlugin%o%obb + 4396
10  Xojo  ...  RBLibrary.LoadPluginsFromFolder%%ooA1obb + 2304
11  Xojo  ...  RBLibrary.LoadUserPlugins%%o + 1512
12  Xojo  ...  RBLibrary.Load%%o + 10100
13  Xojo  ...  IDEApp.Event_Open%%o + 64312

First since there are several bugs and Apple fixes bugs, please install updates for MacOS Ventura. Also make sure you have recent versions of Xojo (2022r4.1) and MBS Plugins 22.5 (or 22.6pr4), so you benefit from fixes related to macOS Ventura.

Next, please reduce the number of plugins you use. MBS Plugins contain 500+ dylibs with thousands of classes, but you probably only need a few plugins. So instead of 50 plugins installed, you may just go with 10 to 20 and not see the crash described above. Please check dependencies here. You need at least Main plugin for version and license handling. If you use various MacOS related plugins, you also need MacBase for some base classes. But not everyone uses our XL, OCR or Phidgets plugins.

If you like to know what plugins you use, just look into the built application. For macOS open the package with contextual menu and look into Contents/Frameworks folder. For Windows and Linux, please looks in the Libs folder. You may then lookup plugin part names to find the plugin.

When Xojo still crashes on launch, just try again. Usually it works fine after one or two crashes. We hope Apple fixes their bugs in the future with an upcoming update. Or tells us what to change on linking to avoid this.

28 12 22 - 11:15