Crash in runDispatchLoopUntil with Ableton Live


#1

Hello !

I am working on a virtual instrument.
My virtual instrument invokes an “initialize” method that opens a SplashScreen and updates its text several times during the initialization process.

In Ableton Live on Mac OSX, when I insert my instrument, then re-insert the instrument before the previous one has completely loaded,
(in other words, the first one is destroyed and a new one replaces it),
Ableton crashes in runDispatchLoopUntil:

Crash report: Thread 0: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0xffff1714 __nanotime + 20 1 ...ple.CoreServices.CarbonCore 0x96d7268f UpTime + 20 2 ...ple.CoreServices.CarbonCore 0x96d7263c Microseconds + 23 3 com.ableton.live 0x0039eb6c 0x1000 + 3791724 4 com.ableton.live 0x0039e097 0x1000 + 3788951 5 com.ableton.live 0x0039e43b 0x1000 + 3789883 6 com.ableton.live 0x0003750e 0x1000 + 222478 7 com.ableton.live 0x000375f6 0x1000 + 222710 8 com.ableton.live 0x00037713 0x1000 + 222995 9 com.ableton.live 0x00c21722 std::invalid_argument::~invalid_argument() + 113276 10 com.ableton.live 0x00c218b9 std::invalid_argument::~invalid_argument() + 113683 11 com.ableton.live 0x010b085c std::range_error::~range_error() + 2259006 12 com.ableton.live 0x010d6afd std::range_error::~range_error() + 2415327 13 com.ableton.live 0x01274350 std::out_of_range::~out_of_range() + 1000482 14 com.ableton.live 0x012743bd std::out_of_range::~out_of_range() + 1000591 15 com.ableton.live 0x01010384 std::range_error::~range_error() + 1602406 16 com.ableton.live 0x011860ea std::out_of_range::~out_of_range() + 25020 17 com.ableton.live 0x01185ebf std::out_of_range::~out_of_range() + 24465 18 com.ableton.live 0x0118757f std::out_of_range::~out_of_range() + 30289 19 com.ableton.live 0x007febb6 0x1000 + 8379318 20 com.ableton.live 0x00fe5c77 std::range_error::~range_error() + 1428569 21 com.ableton.live 0x009111a7 0x1000 + 9503143 22 com.ableton.live 0x00911bb9 0x1000 + 9505721 23 com.ableton.live 0x00921cef 0x1000 + 9571567 24 com.ableton.live 0x01411388 std::out_of_range::~out_of_range() + 2692186 25 com.ableton.live 0x0140ed54 std::out_of_range::~out_of_range() + 2682406 26 com.ableton.live 0x0158cfd8 std::out_of_range::~out_of_range() + 4247722 27 com.ableton.live 0x014a3435 std::out_of_range::~out_of_range() + 3290375 28 com.ableton.live 0x014a4ed0 std::out_of_range::~out_of_range() + 3297186 29 com.ableton.live 0x01589584 std::out_of_range::~out_of_range() + 4232790 30 com.ableton.live 0x014b2e33 std::out_of_range::~out_of_range() + 3354373 31 com.ableton.live 0x014b2f07 std::out_of_range::~out_of_range() + 3354585 32 com.ableton.live 0x014b5e8e std::out_of_range::~out_of_range() + 3366752 33 com.apple.AppKit 0x91d07c68 -[NSWindow sendEvent:] + 5549 34 com.apple.AppKit 0x91c20817 -[NSApplication sendEvent:] + 6431 35 com.ableton.live 0x014ab344 std::out_of_range::~out_of_range() + 3322902 36 com.xxxxxxxxxxx 0x1ed2ee16 juce::MessageManager::runDispatchLoopUntil(int) + 442 ...

additional elements/conditions:
[list]

  • Using Juce 1.51.
  • runDispatchLoopUntil is invoked by SplashScreen::updateText()
  • if updateText not invoked, works fine (but the feature of my instrument is reduced)
    [/list]

What is happening ?
Any workaround, explanation or solution ?


#2

I’d certainly recommend avoiding a splash screen! Whenever you start opening your own windows you run the risk of complicated interactions with the host’s windows - you should keep everything inside the plugin’s window unless you absolutely have to create an external window for some reason.

Not to mention that you shouldn’t use a splash screen in a plugin anyway, because they’re so damned annoying!