El host de AU falla en IOThread en macOS 11 y versiones posteriores

Tengo un problema con un host de AU (basado en Audio Toolbox/Core Audio, no en AVFoundation) cuando se ejecuta en macOS 11 o posterior y Apple Silicon: falla después de algunas operaciones en la GUI. Lo extraño es que falla en IOThread. ¿Podría ser causado por alguna operación inapropiada en la GUI (por ejemplo, fuera del subproceso principal) que afecta el IOThread? Suena bastante improbable para mí. Y no encontré nada sospechoso en el código.

Hay dos registros en el depurador:

[AUHostingService Client] connection interrupted.

rt_sender::signal_wait failed: 89

Y aquí está el registro de fallos:

Code Type:             ARM-64 (Native)
Parent Process:        ??? [1]
OS Version:            macOS 11.6.1 (20G224)
Report Version:        12

Crashed Thread:        14  com.apple.audio.IOThread.client

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [2509]

VM Regions Near 0:
--> 
    __TEXT                      104150000-104248000    [  992K] r-x/r-x SM=COW  /Volumes/...

Application Specific Information:
Performing @selector(selectModule:) from sender NSMenuItem 0x600001033db0

Thread 14 Crashed:: com.apple.audio.IOThread.client
0   libsystem_platform.dylib        0x000000019847e6dc _platform_memset + 108
1   com.apple.audio.AudioToolboxCore    0x000000019987dd5c AUOOPRenderingClient::render(unsigned long, AUOOPRenderClientUser const&, bool, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*, AURenderEvent const*, int (unsigned int*, AudioTimeStamp const*, unsigned int, long, AudioBufferList*) block_pointer) + 212
2   com.apple.audio.AudioToolboxCore    0x00000001998d4390 __38-[AUAudioUnit_XPC internalRenderBlock]_block_invoke + 288
3   com.apple.audio.AudioToolboxCore    0x000000019993d4f4 __26-[AUAudioUnit renderBlock]_block_invoke + 288
4   com.apple.audio.AudioToolboxCore    0x00000001998c1d9c AUv3InstanceBase::Render(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 132
5   com.apple.audio.AudioToolboxCore    0x00000001999f7234 AUIB_Render(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 68
6   com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
7   com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
8   com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
9   com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
10  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
11  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
12  com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
13  com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
14  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
15  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
16  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
17  com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
18  com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
19  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
20  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
21  com.myFramework 0x00000001173d603c ausdk::AUInputElement::PullInputWithBufferList(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 184 (AUInputElement.h:84)
22  com.myFramework 0x00000001173d5f70 ausdk::AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 212 (AUInputElement.cpp:82)
23  com.myFramework 0x00000001173d2808 ausdk::AUEffectBase::Render(unsigned int&, AudioTimeStamp const&, unsigned int) + 92 (AUEffectBase.cpp:295)
24  com.myFramework 0x00000001173bd9f8 ausdk::AUBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 80
25  com.myFramework 0x00000001173c355c ausdk::AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, ausdk::AUOutputElement&, unsigned int, AudioBufferList&) + 152 (AUBase.h:549)
26  com.myFramework 0x00000001173c3048 ausdk::AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 1228 (AUBase.cpp:1307)
27  com.myFramework 0x00000001173d9694 ausdk::AUMethodRender(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 124 (AUPlugInDispatch.cpp:327)
28  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
29  com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
30  com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
31  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
32  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
33  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
34  com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
35  com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
36  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
37  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
38  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
39  com.apple.audio.units.Components    0x00000001206515b4 0x120600000 + 333236
40  com.apple.audio.units.Components    0x0000000120651d54 0x120600000 + 335188
41  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
42  com.apple.audio.units.Components    0x00000001206cf468 0x120600000 + 849000
43  com.apple.audio.units.Components    0x000000012064c01c 0x120600000 + 311324
44  com.apple.audio.units.Components    0x000000012060e7ac 0x120600000 + 59308
45  com.apple.audio.AudioToolboxCore    0x000000019986033c AudioConverterChain::CallInputProc(unsigned int) + 436
46  com.apple.audio.AudioToolboxCore    0x0000000199863cd4 AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 388
47  com.apple.audio.AudioToolboxCore    0x00000001998453ac BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 200
48  com.apple.audio.AudioToolboxCore    0x00000001999f77a8 CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
49  com.apple.audio.AudioToolboxCore    0x00000001998456d8 BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 396
50  com.apple.audio.AudioToolboxCore    0x00000001998607c4 AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 128
51  com.apple.audio.AudioToolboxCore    0x00000001998456d8 BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 396
52  com.apple.audio.AudioToolboxCore    0x000000019990bbcc AudioConverterFillComplexBuffer + 788
53  com.apple.audio.units.Components    0x000000012060e01c 0x120600000 + 57372
54  com.apple.audio.units.Components    0x0000000120632af4 0x120600000 + 207604
55  com.apple.audio.units.Components    0x0000000120611a2c 0x120600000 + 72236
56  com.apple.audio.CoreAudio       0x0000000199dbf138 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 5484
57  com.apple.audio.CoreAudio       0x0000000199f38388 HALB_IOThread::Entry(void*) + 88
58  libsystem_pthread.dylib         0x0000000198433878 _pthread_start + 320
59  libsystem_pthread.dylib         0x000000019842e5e0 thread_start + 8

Thread 14 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000200   x3: 0x0000000000000000
    x4: 0x000000016c109250   x5: 0x000000016c10a6a0   x6: 0x0000000000000080   x7: 0x0000000000000000
    x8: 0x00000000fffefb47   x9: 0x0000000000000002  x10: 0x00006003f202a065  x11: 0x0000000000000007
   x12: 0x0000000000000005  x13: 0x00006000014a40c0  x14: 0x00000001175fe1c8  x15: 0x0000000203886158
   x16: 0x000000019847e610  x17: 0x0000000206f57cb0  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000060000371ca30  x21: 0x0000000198446644  x22: 0x0000000198446644  x23: 0x000060000371ca20
   x24: 0x0000000000000000  x25: 0x00000000fffefb43  x26: 0x000000130014b47a  x27: 0x00000002033a2b70
   x28: 0x000060000371ca20   fp: 0x000000016c108ff0   lr: 0x000000019987dd5c
    sp: 0x000000016c108ef0   pc: 0x000000019847e6dc cpsr: 0x80001000
   far: 0x0000000000000000  esr: 0x92000046

gracias tomas

Answer