DISTRHO / DISTRHO-Ports

Linux audio plugins and LV2 ports
http://distrho.sourceforge.net/ports
261 stars 46 forks source link

LV2 notifications from non-gui thread #52

Closed x42 closed 4 years ago

x42 commented 4 years ago

TAL-Vocoder is calling LV2UI_Write_Function from a non-GUI thread.

https://paste.debian.net/hidden/18382061/

In case of Ardour TAL calls LV2PluginUI::write_from_ui(). In the linked backtrace this happens concurrently with Ardour calling LV2PluginUI::output_update() in the GUI thread. The latter clears a std::map<> while the former writes into the same std::map<>. This leads to memory corruption, segfault.

From LV2 specs http://lv2plug.in/ns/extensions/ui

"UIs written to this specification do not need to be thread-safe. All functions may only be called in the "UI thread"

would indicate that a plugin GUI must not call the LV2UI_Write_Function from another thread than the main UI or the idle-callback.