﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2249	Occasional segmentation fault in MatchMaker?	Tristan Croll	Eric Pettersen	"I'm running a script over a very large number of models (re-running an analysis on the CASP13 results in response to a reviewer), and getting the occasional, apparently-random segmentation fault. Managed to catch it once with GDB (top of the traceback copied below)... looks like something might be racing the garbage collection and occasionally losing? In any case, it doesn't seem to be related to any specific file.

Below is the method it appears to crash in. I just added the logging in an attempt to determine the ""problem"" file, but since I added it it's been running over a few hundred alignments without issue. Might be that the act of logging is slowing things down or just the right way, or may be that the crash is just that rare (the same script ran over a few thousand models in a separate ChimeraX instance without a hitch).

{{{
logfile = open('align.log', 'wt')

def align(session, target, model, cutoff_distance=3, logfile=logfile):
    logfile.write('Aligning {} to {}\n'.format(model.name, target.name))
    logfile.flush()
    from chimerax.match_maker.match import match, defaults
    result = match(session, defaults['chain_pairing'], (target, [model]),
        defaults['matrix'], defaults['alignment_algorithm'],
        defaults['gap_open'], defaults['gap_extend'],
        cutoff_distance=cutoff_distance, always_raise_errors=True)[0]

    # Returned arrays of aligned atoms are paired, but are in random order with
    # respect to the actual models. Re-sort them before returning
    import numpy
    model_atoms = result[0]
    target_atoms = result[1]
    sort_order = numpy.argsort(target_atoms.residues.numbers)
    model_atoms = model_atoms[sort_order]
    target_atoms = target_atoms[sort_order]
    return (model_atoms, target_atoms, *result[2:])
}}}

{{{
Program received signal SIGSEGV, Segmentation fault.
PyObject_CallFinalizer (self=self@entry=0x7fff3e7d5b50) at Objects/object.c:288
288	Objects/object.c: No such file or directory.
Missing separate debuginfos, use: debuginfo-install ucsf-chimerax-daily-2019.07.13-1.el7.x86_64
(gdb) bt
#0  0x00007ffff794c49a in PyObject_CallFinalizer (self=self@entry=0x7fff3e7d5b50) at Objects/object.c:288
#1  0x00007ffff794c4c6 in PyObject_CallFinalizerFromDealloc (self=self@entry=0x7fff3e7d5b50) at Objects/object.c:303
#2  0x00007ffff795e8e1 in subtype_dealloc (self=0x7fff3e7d5b50) at Objects/typeobject.c:1207
#3  0x00007ffff7938c27 in free_keys_object (keys=0x7fff3e6555b0) at Objects/dictobject.c:559
#4  0x00007ffff79396b0 in dict_dealloc (mp=0x7fff3e620dc0) at Objects/dictobject.c:1913
#5  0x00007ffff79246f7 in func_dealloc (op=0x7fff3e676f80) at Objects/funcobject.c:537
#6  0x00007ffff7939687 in dict_dealloc (mp=0x7fff3e64d4b0) at Objects/dictobject.c:1905
#7  0x00007ffff795ec8d in subtype_dealloc (self=0x7fff3d6baed0) at Objects/typeobject.c:1263
#8  0x00007ffff7955114 in set_clear_internal (so=<optimized out>) at Objects/setobject.c:507
#9  0x00007ffff79551d9 in set_clear (so=<optimized out>) at Objects/setobject.c:1193
#10 0x00007ffff79071d0 in _PyMethodDef_RawFastCallKeywords (method=0x7ffff7d67e20 <set_methods+32>, self=self@entry=0x7fffb70bf6e0, args=args@entry=0x7fffe73f4f80, nargs=nargs@entry=0, kwnames=kwnames@entry=0x0) at Objects/call.c:633
#11 0x00007ffff7910319 in _PyMethodDescr_FastCallKeywords (descrobj=0x7ffff7fb0b90, args=args@entry=0x7fffe73f4f78, nargs=nargs@entry=1, kwnames=kwnames@entry=0x0) at Objects/descrobject.c:288
#12 0x00007ffff78df94a in _PyEval_EvalFrameDefault (kwnames=0x0, oparg=1, pp_stack=<synthetic pointer>) at Python/ceval.c:4593
#13 0x00007ffff78df94a in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3110
#14 0x00007ffff78d67c0 in function_code_fastcall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>)
    at Objects/call.c:283
#15 0x00007ffff7906d99 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:415

}}}

"	defect	closed	moderate		Structure Comparison		can't reproduce						Linux64 (X11)	ChimeraX
