You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The NNG threads have limited stack, and if AdmPresetDefinitionsHelper::getSingleton() is first called via an NNG message, it will overflow. This is because construction of the singleton runs a bunch of libadm stuff to parse the common definitions. The crash was observed in the binaural monitoring plugin.
Call stack:
EAR Binaural Monitoring.vst3!__chkstk() Line 109
EAR Binaural Monitoring.vst3!adm::xml::XmlParser::parse() Line 43
EAR Binaural Monitoring.vst3!adm::getCommonDefinitions() Line 163
EAR Binaural Monitoring.vst3!adm::parseXml(std::basic_istream<char,std::char_traits<char>> & stream, adm::xml::ParserOptions options) Line 18
EAR Binaural Monitoring.vst3!AdmPresetDefinitionsHelper::AdmPresetDefinitionsHelper() Line 54
EAR Binaural Monitoring.vst3!AdmPresetDefinitionsHelper::getSingleton() Line 65
EAR Binaural Monitoring.vst3!ear::plugin::BinauralMonitoringBackend::onSceneReceived(ear::plugin::proto::SceneStore store) Line 228
[External Code]
EAR Binaural Monitoring.vst3!ear::plugin::communication::MonitoringMetadataReceiver::handleReceive(std::error_code ec, nng::Message message) Line 65
[External Code]
EAR Binaural Monitoring.vst3!nng::detail::AsyncReadAction::operator()() Line 261
[External Code]
EAR Binaural Monitoring.vst3!nng::AsyncIO::callback() Line 227
The attached project crashes reliably on windows - tested on 2 machines. REAPER v7 (and i think the other machine was v6.something). IIRC, the stack is bigger on MacOS so probably won't crash. bin mon crash project.zip
I see two solutions.
Bump the threads stack size. We've done this elsewhere by calling the message processing it in yet another thread so we're not using NNGs thread. SceneGainsCalculator for normal LS monitoring plugins -
MonitoringMetadataReceiver::handleReceive is the last common point between the Binaural and LS monitoring plugins branch off. Perhaps this is where we launch the thread and remove it from SceneGainsCalculator?
Fix was to launch message handlers in new threads from the common `MonitoringMetadataReceiver::handleReceive` method for both Bin and LS mon plugin message handlers. Message handlers modified to use const refs to `SceneStore` to prevent accidental copies.
The NNG threads have limited stack, and if AdmPresetDefinitionsHelper::getSingleton() is first called via an NNG message, it will overflow. This is because construction of the singleton runs a bunch of libadm stuff to parse the common definitions. The crash was observed in the binaural monitoring plugin.
Call stack:
The attached project crashes reliably on windows - tested on 2 machines. REAPER v7 (and i think the other machine was v6.something). IIRC, the stack is bigger on MacOS so probably won't crash. bin mon crash project.zip
I see two solutions.
ear-production-suite/ear-production-suite-plugins/lib/src/scene_gains_calculator.cpp
Lines 57 to 58 in 77184d2
Maybe it makes sense for all NNG message callbacks to launch in their own thread? This is bound to trip us up again.
Tagging @rsjbailey for suggestions.
The text was updated successfully, but these errors were encountered: