Odd bug here. I’m on Tumbleweed, but haven’t updated anything in my distro since a couple of days ago.
I pulled the upstream avogadrolibs/app repos this morning and recompiled, and since then I can’t launch Avogadro. It reports Segmentation fault (core dumped) immediately after checking for formatScripts.
At this point the AppImage I had worked fine. I then removed it and downloaded the nightly AppImage and that also now fails to launch.
Since I’ve been playing around with avo_xtb I thought it might be an issue with plugins, so I completely removed all the plugins in ~/.local/share/OpenChemistry/Avogadro. The problem remained, so doesn’t seem to be that.
The weird thing is, even though it was only after updating that the crashes started, I tried downloading the stable 1.98.1 AppImage and it has exactly the same problem.
I also tried reverting various recent commits to avogadrolibs and avogadroapp and rebuilding but it also didn’t seem to work.
So seems not to be a problem with the software itself but either with the environment or with Avogadro files (config or tmp or something) that persist between installations.
Can you remind me how to build in debug mode? I can’t find it in the building documentation.
The terminal output is attached but I’m not sure it’s very enlightening. out.txt (4.3 KB)
In Avogadro.conf there is an entry for the default force field. I was testing out a force field script I’d written, so it was set to that. Removing just that entry also solves the issue.
It seems if Avogadro doesn’t find the force field specified in Avogadro.conf, either because it has been deleted or it doesn’t load properly, it crashes.
I feel like this could theoretically happen to normal users who aren’t fiddling around with scripts, just through deleting or moving files. So maybe this could be made a little more robust, where the forcefield entry in the config is ignored if not found.
I don’t have time to test this until tomorrow, but I think this patch should solve that crash. If so, please let me know. Basically, it checks if the method exists and works for a molecule before using it. (Yes, sounds like that should have already been in the code.)