avogadrolibs
avogadrolibs copied to clipboard
Consistent segfaults while manipulating bonds between independent carbon bonds + hydrogens
Avogadro version: (please complete the following information from the About box):
- Avogadrolibs: 1.98.0-eed1ba848a8bbae6d50205eda16e1046a760e36e
- Qt: 5.15.2 GCC 64-bit
Desktop version: (please complete the following information):
- OS: Ubuntu
- Version 22.04
- Compiler N/A
Describe the bug Avogadro 2 will segfault and display some suboptimal behavior while manipulating bonds and hydrogens between two independent carbon atoms. I've narrowed one potential problematic sequence of events down to the following, for which I've attached screenshots in order to reproduce.
To Reproduce
- Open Avogadro 2, create two carbon atoms by left clicking with the "Draw" tool.
- Left click on the first carbon atom, and drag the resulting bond to the second carbon atom. You should see the following. Notably this hydrogen manipulation done after the bond manipulation is also incorrect, as the second carbon now has zero attached hydrogens: this seems related to https://github.com/OpenChemistry/avogadrolibs/issues/1478.
- Remove the bond between the first and second carbon by right clicking it.
- Remove the second carbon by right clicking it
- Remove the first carbon by right clicking it. You'll notice a segfault prompted by a
nullptraccess toMolecule::bonds, I have a quick fix set up locally so I see the following.
Working on understanding the root cause here to ideally address this issue and https://github.com/OpenChemistry/avogadrolibs/issues/1478 simultaneously.
Expected behavior No segfaults, valence shell of carbons correctly populated at each step in the above process (might split this into a couple separate PRs).
Screenshots Attached above
Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/
Is this now fixed by #1493 ? I was never able to reproduce this, so I need to know if your patch fixed the underlying issue. Thanks.