I believe this to be a bug with Avogadro.
Environment Information
Avogadro version: 1.99, updated the local repo (was 1.98) and compiled today
Operating system and version: Ubuntu 22.04.03
CPU: AMD Ryzen 5 3600
Expected Behavior
Opening any output file via the command line (tried orca output and xyz of benzene) should open Avogadro with the molecule loaded.
Actual Behavior
Avogadro begins its startup, but eventually segfaults (see terminal output below)
Opening Avogadro without a command-line argument and then loading the file via the menu works.
Mitigations tried
Fresh checkout and recompile. Issue remains.
Steps to Reproduce
Terminal output
mewes@kopfknoten:~/CALC/Hosts/BH/SPs$ avogadro2 uks_mono.xyz
Using locale: “C”
Extension plugins dynamically found… 42
OBProcess::executeObabel: Running “obabel” “-L formats read”
OBProcess::executeObabel: Running “obabel” “-L formats write”
OBProcess::executeObabel: Running “obabel” “-L forcefields”
OBProcess::executeObabel: Running “obabel” “-L charges”
OBProcess::executeObabel: Running “obabel” “-V”
“obabel” found: “obabel: Open Babel 3.1.1 – Feb 7 2022 – 06:51:49”
“Checking for energy scripts in path /home/mewes/.local/share/OpenChemistry/Avogadro/energy”
“Checking for energy scripts in path /usr/local/share/OpenChemistry/Avogadro/energy”
“Checking for energy scripts in path /usr/share/OpenChemistry/Avogadro/energy”
“Checking for energy scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/energy”
“Checking for energy scripts in path /home/mewes/SOFTWARE/openchemistry_build/avogadroapp/bin/…/lib/avogadro2/scripts/energy”
registering obmm plugins
“Checking for commands scripts in path /home/mewes/.local/share/OpenChemistry/Avogadro/commands”
“Checking for commands scripts in path /usr/local/share/OpenChemistry/Avogadro/commands”
“Checking for commands scripts in path /usr/share/OpenChemistry/Avogadro/commands”
“Checking for commands scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/commands”
“Checking for commands scripts in path /home/mewes/SOFTWARE/openchemistry_build/avogadroapp/bin/…/lib/avogadro2/scripts/commands”
“Checking for inputGenerators scripts in path /home/mewes/.local/share/OpenChemistry/Avogadro/inputGenerators”
“Checking for inputGenerators scripts in path /usr/local/share/OpenChemistry/Avogadro/inputGenerators”
“Checking for inputGenerators scripts in path /usr/share/OpenChemistry/Avogadro/inputGenerators”
“Checking for inputGenerators scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/inputGenerators”
“Checking for inputGenerators scripts in path /home/mewes/SOFTWARE/openchemistry_build/avogadroapp/bin/…/lib/avogadro2/scripts/inputGenerators”
“Checking for charges scripts in path /home/mewes/.local/share/OpenChemistry/Avogadro/charges”
“Checking for charges scripts in path /usr/local/share/OpenChemistry/Avogadro/charges”
“Checking for charges scripts in path /usr/share/OpenChemistry/Avogadro/charges”
“Checking for charges scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/charges”
“Checking for charges scripts in path /home/mewes/SOFTWARE/openchemistry_build/avogadroapp/bin/…/lib/avogadro2/scripts/charges”
“Checking for formatScripts scripts in path /home/mewes/.local/share/OpenChemistry/Avogadro/formatScripts”
“Checking for formatScripts scripts in path /usr/local/share/OpenChemistry/Avogadro/formatScripts”
“Checking for formatScripts scripts in path /usr/share/OpenChemistry/Avogadro/formatScripts”
“Checking for formatScripts scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/formatScripts”
“Checking for formatScripts scripts in path /home/mewes/SOFTWARE/openchemistry_build/avogadroapp/bin/…/lib/avogadro2/scripts/formatScripts”
Segmentation fault (core dumped)
Yes, @RizzerOnGitHub already reported this on GitHub too. I haven’t had a chance to find the culprit, but there will certainly be a 1.99.1 release.
opened 02:10PM - 12 Feb 24 UTC
**Avogadro version:**
- Avogadrolibs: 1.99.0
(but About reports "Avogadro L… ibrary Version: 1.97.0-4-42-gb9da376")
- Qt: 5.15.10
**Desktop version: (please complete the following information):**
- OS: Linux
- Version debian unstable
- Compiler gcc 13.2.0
**Describe the bug**
avogadro 1.99.0 segfaults when opening a file from the command line (I tested xyz files).
For instance a simple methane molecule, methane.xyz
```text
5
XYZ file generated by Avogadro.
C -1.21766 1.04689 0.00000
H -0.41766 0.79852 0.66575
H -0.89506 1.81122 -0.67574
H -1.50295 0.17754 -0.55475
H -2.05496 1.40028 0.56475
```
**To Reproduce**
Steps to reproduce the behavior:
1. `avogadro methane.xyz`
2. See error
**Expected behavior**
The molecule file loads without error via the GUI interface (File->Open). It should possible to open from the command line also.
**Screenshots**
```shell
$ LD_LIBRARY_PATH=/projects/avogadrolibs/obj-x86_64-linux-gnu/lib gdb avogadro
GNU gdb (Debian 13.2-1) 13.2
...
Type "apropos word" to search for commands related to "word"...
Reading symbols from avogadro...
Reading symbols from /usr/lib/debug/.build-id/3a/7a9a071a88775b79f7a3f8f73387e1434a3898.debug...
(gdb) run methane.xyz
Starting program: /usr/bin/avogadro methane.xyz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff06b76c0 (LWP 1402631)]
[New Thread 0x7fffeece46c0 (LWP 1402632)]
[New Thread 0x7fffee4e36c0 (LWP 1402633)]
[New Thread 0x7fffedce26c0 (LWP 1402634)]
[New Thread 0x7fffed3c06c0 (LWP 1402635)]
Using locale: "en_AU"
AvogadroApp Translation "en_AU" loaded "/usr/bin/../share/avogadro2/i18n/"
[New Thread 0x7fffccdff6c0 (LWP 1402637)]
[New Thread 0x7fffc7fff6c0 (LWP 1402638)]
[New Thread 0x7fffc77fe6c0 (LWP 1402639)]
[New Thread 0x7fffc6ffd6c0 (LWP 1402640)]
[Thread 0x7fffc6ffd6c0 (LWP 1402640) exited]
[Thread 0x7fffc77fe6c0 (LWP 1402639) exited]
[New Thread 0x7fffc77fe6c0 (LWP 1402641)]
[New Thread 0x7fffc6ffd6c0 (LWP 1402642)]
Extension plugins dynamically found… 41
[New Thread 0x7fffc67fc6c0 (LWP 1402643)]
OBProcess::executeObabel: Running "obabel" "-L formats read"
[Detaching after fork from child process 1402644]
OBProcess::executeObabel: Running "obabel" "-L formats write"
[Detaching after fork from child process 1402645]
OBProcess::executeObabel: Running "obabel" "-L forcefields"
[Detaching after fork from child process 1402646]
OBProcess::executeObabel: Running "obabel" "-L charges"
[Detaching after fork from child process 1402647]
OBProcess::executeObabel: Running "obabel" "-V"
[Detaching after fork from child process 1402648]
"obabel" found: "obabel: Open Babel 3.1.1 -- Jan 10 2024 -- 20:00:50"
"Checking for energy scripts in path /home/.local/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/share/gnome/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/local/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/energy"
[Detaching after fork from child process 1402649]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/energy/ani2x.py"
[Detaching after fork from child process 1402657]
[Detaching after fork from child process 1402665]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/energy/gfn1.py"
[Detaching after fork from child process 1402673]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/energy/gfn2.py"
[Detaching after fork from child process 1402681]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/energy/gfnff.py"
[Detaching after fork from child process 1402689]
[Detaching after fork from child process 1402697]
[Detaching after fork from child process 1402705]
[Detaching after fork from child process 1402713]
[Detaching after fork from child process 1402721]
register GAFF
[Detaching after fork from child process 1402729]
register MMFF94
[Detaching after fork from child process 1402737]
register UFF
[Detaching after fork from child process 1402745]
registering obmm plugins
"Checking for commands scripts in path /home/.local/share/OpenChemistry/Avogadro/commands"
"Checking for commands scripts in path /usr/share/gnome/OpenChemistry/Avogadro/commands"
"Checking for commands scripts in path /usr/local/share/OpenChemistry/Avogadro/commands"
"Checking for commands scripts in path /usr/share/OpenChemistry/Avogadro/commands"
"Checking for commands scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/commands"
"Checking for commands scripts in path /usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/commands"
"Checking for inputGenerators scripts in path /home/.local/share/OpenChemistry/Avogadro/inputGenerators"
"Checking for inputGenerators scripts in path /usr/share/gnome/OpenChemistry/Avogadro/inputGenerators"
"Checking for inputGenerators scripts in path /usr/local/share/OpenChemistry/Avogadro/inputGenerators"
"Checking for inputGenerators scripts in path /usr/share/OpenChemistry/Avogadro/inputGenerators"
"Checking for inputGenerators scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/inputGenerators"
"Checking for inputGenerators scripts in path /usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/inputGenerators"
"Checking for charges scripts in path /home/.local/share/OpenChemistry/Avogadro/charges"
"Checking for charges scripts in path /usr/share/gnome/OpenChemistry/Avogadro/charges"
"Checking for charges scripts in path /usr/local/share/OpenChemistry/Avogadro/charges"
"Checking for charges scripts in path /usr/share/OpenChemistry/Avogadro/charges"
"Checking for charges scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/charges"
"Checking for charges scripts in path /usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/charges"
[Detaching after fork from child process 1402753]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/charges/antechamber.py"
[Detaching after fork from child process 1402754]
"Cannot load script /usr/lib/x86_64-linux-gnu/avogadro2/scripts/charges/xtb.py"
"Checking for formatScripts scripts in path /home/.local/share/OpenChemistry/Avogadro/formatScripts"
"Checking for formatScripts scripts in path /usr/share/gnome/OpenChemistry/Avogadro/formatScripts"
"Checking for formatScripts scripts in path /usr/local/share/OpenChemistry/Avogadro/formatScripts"
"Checking for formatScripts scripts in path /usr/share/OpenChemistry/Avogadro/formatScripts"
"Checking for formatScripts scripts in path /var/lib/snapd/desktop/OpenChemistry/Avogadro/formatScripts"
"Checking for formatScripts scripts in path /usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/formatScripts"
[Detaching after fork from child process 1402755]
[Detaching after fork from child process 1402756]
[Detaching after fork from child process 1402757]
[New Thread 0x7fffc5ffb6c0 (LWP 1402758)]
[New Thread 0x7fffc57fa6c0 (LWP 1402759)]
[New Thread 0x7fffc4ff96c0 (LWP 1402760)]
Thread 1 "avogadro" received signal SIGSEGV, Segmentation fault.
Avogadro::Core::Layer::activeLayer (this=this@entry=0xb8) at ./avogadro/core/layer.cpp:82
82 ./avogadro/core/layer.cpp: No such file or directory.
(gdb) bt
#0 Avogadro::Core::Layer::activeLayer() const (this=this@entry=0xb8) at ./avogadro/core/layer.cpp:82
#1 0x00007ffff7e40691 in Avogadro::QtGui::PluginLayerManager::getSetting<Avogadro::QtPlugins::LayerWireframe>(unsigned long) (this=this@entry=0x555555b8c390, layer=layer@entry=18446744073709551615) at ./avogadro/qtgui/pluginlayermanager.h:86
#2 0x00007ffff7e3cfed in Avogadro::QtPlugins::Wireframe::setupWidget() (this=0x555555b8c380) at ./avogadro/qtplugins/wireframe/wireframe.cpp:183
#3 0x00007ffff7b58dd8 in Avogadro::QtGui::ScenePluginModel::data(QModelIndex const&, int) const (this=<optimized out>, index_=..., role=0) at ./avogadro/qtgui/scenepluginmodel.cpp:89
#4 0x00007ffff7605fc0 in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5 0x00007ffff7605638 in QStyledItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6 0x00007ffff764b8f3 in QTreeView::indexRowSizeHint(QModelIndex const&) const () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7 0x00007ffff764f274 in QTreeViewPrivate::itemHeight(int) const () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8 0x00007ffff765082d in QTreeViewPrivate::updateScrollBars() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9 0x00007ffff765a7b2 in QTreeView::updateGeometries() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff73a63aa in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff7452022 in QFrame::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ffff62cc4b3 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff7362f22 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff62cc748 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff739de36 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff73a2897 in QWidgetPrivate::show_helper() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff73a5873 in QWidgetPrivate::setVisible(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff73a2819 in QWidgetPrivate::showChildren(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff73a28b3 in QWidgetPrivate::show_helper() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff73a2839 in QWidgetPrivate::showChildren(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff73a28b3 in QWidgetPrivate::show_helper() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff73a5873 in QWidgetPrivate::setVisible(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff73a2819 in QWidgetPrivate::showChildren(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff73a28b3 in QWidgetPrivate::show_helper() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff73a5873 in QWidgetPrivate::setVisible(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x0000555555570561 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./avogadro/avogadro.cpp:316
```
**Additional context**
Add any other context about the problem here. **Please consider uploading or linking test files.**