Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Crash in the Surface Engine. #183

Closed
cryos opened this issue Mar 10, 2008 · 3 comments
Closed

Crash in the Surface Engine. #183

cryos opened this issue Mar 10, 2008 · 3 comments

Comments

@cryos
Copy link
Owner

cryos commented Mar 10, 2008

I created several molecule (all only C and H atom) and tried to crash Avogadro. VDW and Surface engine was active.

Latest OB and Avogadro.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb41b7b90 (LWP 15493)]
0xb7d81245 in OpenBabel::OBAtom::GetVector (this=0x8337534) at atom.cpp:336
336 _v.Set((__c)[_cidx],(__c)[_cidx+1],(*_c)[_cidx+2]);
Current language: auto; currently c++
(gdb) bt
#0 0xb7d81245 in OpenBabel::OBAtom::GetVector (this=0x8337534) at atom.cpp:336
#1 0xb6732fb2 in Avogadro::VDWGridThread::run () from /home/kde-devel/kde/build/avo-git/libavogadro/src/engines/libsurfaceengine.so
#2 0xb716acc7 in QThreadPrivate::start () from /usr/lib/libQtCore.so.4
#3 0xb70e6192 in start_thread () from /lib/libpthread.so.0
#4 0xb6df702e in clone () from /lib/libc.so.6

Reported by: @cniehaus

@cryos
Copy link
Owner Author

cryos commented Mar 10, 2008

Logged In: YES
user_id=684210
Originator: YES

I am sorry, Balls and Sticks is active, not the vdW-engine.

This bug is very easy to reproduce here, just add atoms at random, doesn't take to long until it crashes. Always this backtrace.

Original comment by: @cniehaus

@cryos
Copy link
Owner Author

cryos commented May 12, 2008

Logged In: YES
user_id=21420
Originator: NO

Aha. I think I understand the problem here Marcus. The molecule is going through a BeginModify/EndModify loop. Since there isn't a read/write lock across the thread, the surface engine crashes.

The correct fix is to make sure to lock the molecule against other threads when modifying it. A faster fix might be to check for OBMol::GetMod != 0.

Original comment by: @ghutchis

@cryos
Copy link
Owner Author

cryos commented May 15, 2008

Logged In: YES
user_id=851435
Originator: NO

I made some changes in svn commit 1370 that seems to have improved things in the surface engine significantly. I think that more locking is required but I will need to figure our where without locking up the whole app! Please reopen if this is still an issue - seems to be fixed here.

Original comment by: @cryos

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants