Opened 7 years ago

Closed 7 years ago

#1113 closed defect (fixed)

Segmentation fault when opening new model while old model is being deleted

Reported by: Tristan Croll Owned by: pett
Priority: major Milestone:
Component: Core Version: 0.7
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

  • open a large model that will take some non-trivial time to clean up on deleting (e.g. 3j3y)
  • delete it using the Model Panel
  • as soon as the list of previously-loaded models appears in the main window, click on any model
  • crash

Change History (3)

in reply to:  1 ; comment:1 by tic20@…, 7 years ago

Possibly related, not sure: opening 3j3q twice, then deleting the second 
copy causes a reproducible segmentation fault on my Linux machine. Top 
of the stack trace from GDB is below. Doesn't happen if I delete the 
first model instead.


#0  0x00007ffff796be3a in PyObject_CallFinalizer 
(self=self@entry=0x7ffea0b6deb8) at Objects/object.c:299
#1  0x00007ffff796be69 in PyObject_CallFinalizerFromDealloc 
(self=self@entry=0x7ffea0b6deb8) at Objects/object.c:314
#2  0x00007ffff797d9d4 in subtype_dealloc (self=0x7ffea0b6deb8) at 
Objects/typeobject.c:1151
#3  0x00007fffe0b8bcd2 in atomstruct::Structure::~Structure() () at 
/home/tic20/apps/chimerax/bin/../lib/libatomstruct.so
#4  0x00007fffe0bda831 in 
atomstruct::AtomicStructure::~AtomicStructure() () at 
/home/tic20/apps/chimerax/bin/../lib/libatomstruct.so
#5  0x00007fff9b2774de in ffi_call_unix64 () at 
/tmp/chx-develop.LxzZ5v/build/tmp/Python-3.6.4/Modules/_ctypes/libffi/src/x86/unix64.S:76
#6  0x00007fff9b2767a9 in ffi_call (cif=cif@entry=0x7fffffffa470, 
fn=fn@entry=0x7fffe0c97a60 <structure_delete>, 
rvalue=rvalue@entry=0x7fffffffa3b0, avalue=avalue@entry=0x7fffffffa390)
     at 
/tmp/chx-develop.LxzZ5v/build/tmp/Python-3.6.4/Modules/_ctypes/libffi/src/x86/ffi64.c:525
#7  0x00007fff9b26e382 in _ctypes_callproc (argcount=1, 
resmem=0x7fffffffa3b0, restype=<optimized out>, atypes=<optimized out>, 
avalues=0x7fffffffa390, pProc=0x7fffe0c97a60 <structure_delete>, 
flags=4357) at 
/tmp/chx-develop.LxzZ5v/build/tmp/Python-3.6.4/Modules/_ctypes/callproc.c:809
#8  0x00007fff9b26e382 in _ctypes_callproc 
(pProc=pProc@entry=0x7fffe0c97a60 <structure_delete>, 
argtuple=argtuple@entry=0x7ffefb5b82b0, flags=4357, 
argtypes=argtypes@entry=0x7ffefb5b8a58, restype=0x8fa748, checker=0x0) 
at 
/tmp/chx-develop.LxzZ5v/build/tmp/Python-3.6.4/Modules/_ctypes/callproc.c:1147


On 2018-05-08 15:44, ChimeraX wrote:

in reply to:  2 ; comment:2 by tic20@…, 7 years ago

Hmm... seems my first message that was a furphy - the segmentation fault 
happens whether or not I try to open another model while 3j3q is 
closing. Just the act of opening 3j3q to the point where it can be 
interacted with (rotated), then closing it triggers the crash. While 
it's open I can open/close more "normal" sized (but still large) models 
(e.g. 3gtq) repeatedly, but closing the 3j3q model kills ChimeraX 
(almost) every time. Every time (as far as I can see) if it's the last 
model loaded, and often if it's elsewhere in the list. In the trial I 
just ran, I opened it three times then deleted the first copy without 
issue, but crashed on deleting the second.

On 2018-05-08 16:53, ChimeraX wrote:

comment:3 by pett, 7 years ago

Resolution: fixed
Status: assignedclosed

Needed to directly destroy chains with no Python-layer refs to their Python objects, rather than DECREFing to zero which indirectly calls the destructor -- since the destructor also DECREFs due to inheritance from PyInstance.

Note: See TracTickets for help on using tickets.