You are not logged in.
Pages: 1
Hello,
I have been trying to troubleshoot an issue with Avogadro chemistry package.
It seems when I build the program with -D_GLIBCXX_ASSERTIONS in the CXXFLAGS Avogadro crashes when I copy molecules, and link them back to the original molecule.
This is the crash message:
/usr/include/c++/14.2.1/bits/stl_vector.h:1130: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
[1] 3156821 IOT instruction (core dumped) avogadro2
I posted this information on their forums as well, but I wanted to cross post it here because some of the back traces appear to come from outside Avogadro's code, and inside core. Here is a link to where I found the issue on their forums: https://discuss.avogadro.cc/t/crash-whe … nd/4964/13
I am not sure if this is just specific to my processor, but all of the Avogadro builds in the main repository and AUR seem to be affected by this issue.
I was able to build a debug build of the package, but the backtrace has optimized out some information on where it's crashing, and it seems to be coming from libstdc++-v3
I looked on the arch Wiki, and I think it says that no matter what I do, this gets optimized out? Is there a way I can build debug symbols into libstdc++v3? Is the issue even there potentially? Should we just remove the -D_GLIBCXX_ASSERTIONS from the packages? (https://wiki.archlinux.org/title/Debugg … ing_traces)
I am at the point where I have no idea what's going on.
This is a backtrace from the latest Avogadro build from their Git repo built with the following flags:
export CFLAGS="-O0 -g -fno-inline -fno-omit-frame-pointer -fno-unroll-loops -pipe -march=native -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection"
export CXXFLAGS="-O0 -g -fno-inline -fno-omit-frame-pointer -fno-unroll-loops -pipe -march=native -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -D_GLIBCXX_ASSERTIONS"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fuse-ld=mold"
export LTOFLAGS="-flto=auto"
Thread 1 "avogadro2" received signal SIGABRT, Aborted.
0x00007ffff0ca53f4 in ?? () from /usr/lib/libc.so.6
The target architecture is set to "auto" (currently "i386:x86-64").
(gdb) bt
#0 0x00007ffff0ca53f4 in ??? () at /usr/lib/libc.so.6
#1 0x00007ffff0c4c120 in raise () at /usr/lib/libc.so.6
#2 0x00007ffff0c334c3 in abort () at /usr/lib/libc.so.6
#3 0x00007fffec2d3bb0 in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/assert_fail.cc:41
#4 0x00007ffff598e500 in std::vector<int, std::allocator<int> >::operator[] (this=0x555555d732c8, __n=22) at /usr/include/c++/14.2.1/bits/stl_vector.h:1130
#5 0x00007ffff599bdbc in Avogadro::Core::Graph::addEdge (this=0x555555d73290, a=1, b=11) at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/core/graph.cpp:227
#6 0x00007ffff59bedb7 in Avogadro::Core::Molecule::addBond (this=0x555555d730c0, atom1=1, atom2=11, order=1 '\001') at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/core/molecule.cpp:677
#7 0x00007ffff7460d48 in Avogadro::QtGui::Molecule::addBond (this=0x555555d730b0, atomId1=1, atomId2=11, order=1 '\001') at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtgui/molecule.cpp:175
#8 0x00007ffff7473ee7 in Avogadro::QtGui::(anonymous namespace)::AddBondCommand::redo (this=0x555555736620) at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtgui/rwmolecule_undo.h:407
#9 0x00007ffff6efeaaa in QUndoStack::push(QUndoCommand*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff7476ff8 in Avogadro::QtGui::RWMolecule::addBond (this=0x55555611dee0, atom1=11, atom2=1, order=1 '\001') at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtgui/rwmolecule.cpp:274
#11 0x00007ffff7aaf3c8 in Avogadro::QtGui::RWMolecule::addBond (this=0x55555611dee0, atom1=..., atom2=..., order=1 '\001') at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtgui/rwmolecule.h:769
#12 0x00007ffff7aae962 in Avogadro::QtPlugins::Editor::atomLeftDrag (this=0x555555d6bce0, e=0x7fffffffc820) at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtplugins/editor/editor.cpp:604
#13 0x00007ffff7aac87d in Avogadro::QtPlugins::Editor::mouseMoveEvent (this=0x555555d6bce0, e=0x7fffffffc820) at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtplugins/editor/editor.cpp:188
#14 0x00007ffff7fb741b in Avogadro::QtOpenGL::GLWidget::mouseMoveEvent (this=0x555555d11c70, e=0x7fffffffc820) at /home/aeonik/git/openchemistry/avogadrolibs/avogadro/qtopengl/glwidget.cpp:272
#15 0x00007ffff6b8f6d7 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff6b56331 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff6b5c0d1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff5eaba68 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#19 0x00007ffff6b59df5 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /usr/lib/libQt5Widgets.so.5
#20 0x00007ffff6ba8c8a in ??? () at /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff6baacc7 in ??? () at /usr/lib/libQt5Widgets.so.5
#22 0x00007ffff6b56331 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#23 0x00007ffff5eaba68 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#24 0x00007ffff633ba90 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/libQt5Gui.so.5
#25 0x00007ffff631cdcd in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#26 0x00007fffe5d302f8 in ??? () at /usr/lib/libQt5XcbQpa.so.5
#27 0x00007fffeaa35299 in ??? () at /usr/lib/libglib-2.0.so.0
#28 0x00007fffeaa97ec7 in ??? () at /usr/lib/libglib-2.0.so.0
#29 0x00007fffeaa34795 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#30 0x00007ffff5efa37f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#31 0x00007ffff5ea382c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#32 0x00007ffff5eafbfd in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#33 0x00005555555722e3 in main (argc=1, argv=0x7fffffffd3c8) at /home/aeonik/git/openchemistry/avogadroapp/avogadro/avogadro.cpp:324
#34 0x00007ffff0c34e08 in ??? () at /usr/lib/libc.so.6
#35 0x00007ffff0c34ecc in __libc_start_main () at /usr/lib/libc.so.6
#36 0x00005555555681f5 in _start ()
Regards,
Aeonik
Offline
Pages: 1