hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.03k stars 172 forks source link

Crashes on startup - scanning ~/.ladspa dir #1591

Open Lucretia opened 2 years ago

Lucretia commented 2 years ago

Hydrogen version * : HEAD @ 2109 hrs BST 23/02/2022 Operating system + version : Gentoo (testing) Audio driver + version : Pipewire-0.3.51-r1 (Jack)


Starting up from console:

QT_AUTO_SCREEN_SCALE_FACTOR=1.5 hydrogen -VDebug
...
(I) ::int main(int, char**) Using QT version 5.15.4
(I) ::int main(int, char**) Using data path: /usr/share/hydrogen/data/
(I) ::int main(int, char**) Using locale: /usr/share/hydrogen/data/i18n/
(I) Hydrogen::Hydrogen [Hydrogen]
(I) Effects::getPluginList *** [getPluginList] reading directory: /home/laguest/.ladspa
[main] Unknown exception X-(

Changing the files inside that dir to another extension, gives the same error, moving that dir allows the program to run as does moving the two plugin's out of that directory, they are amp.so and delay.so.


theGreatWhiteShark commented 2 years ago

Hey @Lucretia,

Seems like your to plugins amp.so and delay.so are bricked and causing the crash. Do they work in other applications?

Lucretia commented 2 years ago

Seems they break guitarix as well. Both applications should catch any error, not crash without giving any indication of what happened and that's what both do.

theGreatWhiteShark commented 2 years ago

Both applications should catch any error, not crash without giving any indication of what happened and that's what both do.

I'm not an expert on these system-level kind of thing but it looks like we are already doing this.

Lucretia commented 2 years ago

Well, I've installed the latest HEAD version, so that's not catching this error.

Lucretia commented 2 years ago

Here are the plugins which kills it (place inside ~/.ladspa):

dot-ladspa.tar.gz

cme commented 2 years ago

Well.... There's not really a lot we can or indeed should do to recover from an error like this -- as soon as we've executed some potentially bad code from a plugin, there's no way to tell what damage that might have done to the process, so stopping more or less immediately is the right thing to do.

(We don't isolate ladspa plugins in a separate host process, they're executed as part of the hydrogen process. Changing this would be... a pain)

We certainly could try and emit some more helpful messages in the case of such a crash, though.

elpescado commented 2 years ago

Seems they break guitarix as well. Both applications should catch any error, not crash without giving any indication of what happened and that's what both do.

I think that's because of LADSPA architecture - host application and plugins are so intertwined that when plugin crashes there's nothing really that could be done to recover host.

Lucretia commented 2 years ago

You can check if the load failed, and log it if it did. Then check if on initialisation of the plugin failed, and then log that too. Having some indication of what happened is better than nothing.

cme commented 2 years ago

You can check if the load failed, and log it if it did. Then check if on initialisation of the plugin failed, and then log that too. Having some indication of what happened is better than nothing.

Yep, agreed

Lucretia commented 2 years ago

Although, if the app is going to kill itself, I'd prefer to be given a message box saying why if possible.

cme commented 2 years ago

Although, if the app is going to kill itself, I'd prefer to be given a message box saying why if possible.

Yeah, this is also an issue -- errors go to the logs, not so much to anything the user will see unless they're looking at the console.

Lucretia commented 2 years ago

Although, if the app is going to kill itself, I'd prefer to be given a message box saying why if possible.

Yeah, this is also an issue -- errors go to the logs, not so much to anything the user will see unless they're looking at the console.

But a user who is faced with a silent crash, is going to want to know WTF just happened, message box. This is usability basics.

cme commented 2 years ago

Indeed. Captured in #1592.

theGreatWhiteShark commented 2 years ago

Although, if the app is going to kill itself, I'd prefer to be given a message box saying why if possible.

Hey @Lucretia ,

could you check whether the newest version of Hydrogen on master serves your needs?