Crash in BSDYengine

Hi all,

I ran across this bug while installing Avogadro on a computer at
cornell. Using arch linux with gcc 4.5.0, the following happens when
attempting to draw on the glwidget (backtrace and output below). It
seems to be unable to find the pRadius member.

I think this may be related to bug 3014823, so I’ll include this there
as well. Any ideas?

Dave

Program received signal SIGSEGV, Segmentation fault.
0x004f0049 in ?? ()
(gdb) bt
#0 0x004f0049 in ?? ()
#1 0xb6a144ef in Avogadro::BSDYEngine::radius (this=0x89ea860,
atom=0x8b05f90) at
/usr/src/avogadro/libavogadro/src/engines/bsdyengine.cpp:357
#2 0xb6a101d1 in Avogadro::BSDYEngine::renderOpaque (this=0x89ea860,
pd=0x843ed28) at
/usr/src/avogadro/libavogadro/src/engines/bsdyengine.cpp:170
#3 0xb6993d8d in Avogadro::GLWidget::render (this=0x8434f08) at
/usr/src/avogadro/libavogadro/src/glwidget.cpp:777
#4 0xb69933b0 in Avogadro::GLWidget::paintGL (this=0x8434f08) at
/usr/src/avogadro/libavogadro/src/glwidget.cpp:552
#5 0xb6993535 in Avogadro::GLWidget::paintEvent (this=0x8434f08) at
/usr/src/avogadro/libavogadro/src/glwidget.cpp:602
#6 0xb74e017e in QWidget::event(QEvent*) () from /usr/bin/…/lib/libQtGui.so.4
#7 0xb7dd1719 in QGLWidget::event(QEvent*) () from
/usr/bin/…/lib/libQtOpenGL.so.4
#8 0xb6995f5e in Avogadro::GLWidget::event (this=0x8434f08,
event=0xbfffeb24) at
/usr/src/avogadro/libavogadro/src/glwidget.cpp:1062
#9 0xb7488f14 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/bin/…/lib/libQtGui.so.4
#10 0xb748d1ab in QApplication::notify(QObject*, QEvent*) () from
/usr/bin/…/lib/libQtGui.so.4
#11 0xb712fecb in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/bin/…/lib/libQtCore.so.4
#12 0xb74dadd4 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from
/usr/bin/…/lib/libQtGui.so.4
#13 0xb76a17b6 in QWidgetPrivate::repaint_sys(QRegion const&) () from
/usr/bin/…/lib/libQtGui.so.4
#14 0xb74d0fbe in QWidgetPrivate::syncBackingStore() () from
/usr/bin/…/lib/libQtGui.so.4
#15 0xb74e07dd in QWidget::event(QEvent*) () from /usr/bin/…/lib/libQtGui.so.4
#16 0xb7dd1719 in QGLWidget::event(QEvent*) () from
/usr/bin/…/lib/libQtOpenGL.so.4
#17 0xb6995f5e in Avogadro::GLWidget::event (this=0x8434f08,
event=0x8ae6090) at
/usr/src/avogadro/libavogadro/src/glwidget.cpp:1062
#18 0xb7488f14 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/bin/…/lib/libQtGui.so.4
#19 0xb748d1ab in QApplication::notify(QObject*, QEvent*) () from
/usr/bin/…/lib/libQtGui.so.4
#20 0xb712fecb in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/bin/…/lib/libQtCore.so.4
#21 0xb71339c1 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) () from /usr/bin/…/lib/libQtCore.so.4
#22 0xb7133bad in QCoreApplication::sendPostedEvents(QObject*, int) ()
from /usr/bin/…/lib/libQtCore.so.4
#23 0xb715a98f in ?? () from /usr/bin/…/lib/libQtCore.so.4
#24 0xb6512f72 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0xb6513750 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#26 0xb6513a04 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0xb715ae7c in
QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag)
() from /usr/bin/…/lib/libQtCore.so.4
#28 0xb75351b5 in ?? () from /usr/bin/…/lib/libQtGui.so.4
#29 0xb712f119 in
QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) ()
from /usr/bin/…/lib/libQtCore.so.4
#30 0xb712f38a in
QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from
/usr/bin/…/lib/libQtCore.so.4
#31 0xb7133c6f in QCoreApplication::exec() () from
/usr/bin/…/lib/libQtCore.so.4
#32 0xb7486637 in QApplication::exec() () from /usr/bin/…/lib/libQtGui.so.4
#33 0x0806e66d in main (argc=1, argv=0xbffff824) at
/usr/src/avogadro/avogadro/src/main.cpp:245
(gdb) up
#1 0xb6a144ef in Avogadro::BSDYEngine::radius (this=0x89ea860,
atom=0x8b05f90) at
/usr/src/avogadro/libavogadro/src/engines/bsdyengine.cpp:357
357 return pRadius(atom) * m_atomRadiusPercentage;
(gdb) list
352 {
353 if (atom->customRadius())
354 return atom->customRadius()* m_atomRadiusPercentage;
355 else {
356 if (atom->atomicNumber())
357 return pRadius(atom) * m_atomRadiusPercentage;
358 }
359 return m_atomRadiusPercentage;
360 }
361
(gdb) p pRadius(atom)
Couldn’t find method Avogadro::BSDYEngine::pRadius

Hi all,

I ran across this bug while installing Avogadro on a computer at
cornell. Using arch linux with gcc 4.5.0, the following happens when
attempting to draw on the glwidget (backtrace and output below). It
seems to be unable to find the pRadius member.

I think this may be related to bug 3014823, so I’ll include this there
as well. Any ideas?

Hi David,
It’s my fault. Fix pushed to Gerrit


Regards,
Konstantin

Thanks Konstantin, I’m back in Buffalo this morning, but as soon as I
can ssh back into their computer I’ll verify and push the fix. (I
can’t duplicate the crash here for some reason…).

Dave

On Sat, Aug 7, 2010 at 5:58 AM, Konstantin Tokarev annulen@yandex.ru wrote:

Hi all,

I ran across this bug while installing Avogadro on a computer at
cornell. Using arch linux with gcc 4.5.0, the following happens when
attempting to draw on the glwidget (backtrace and output below). It
seems to be unable to find the pRadius member.

I think this may be related to bug 3014823, so I’ll include this there
as well. Any ideas?

Hi David,
It’s my fault. Fix pushed to Gerrit


Regards,
Konstantin

Thanks Konstantin, I’m back in Buffalo this morning, but as soon as I
can ssh back into their computer I’ll verify and push the fix. (I
can’t duplicate the crash here for some reason…).

I also cannot reproduce, but I think this crash was caused by missing initialization
of function pointer in constructor - fixed now


Regards,
Konstantin