﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
1008	Reversing a Collection via slicing causes a segfault	Tristan Croll	Tom Goddard	"With a single atomic model loaded:

{{{
m = session.models.list()[0]
r = m.residues
r2 = m[::-1]
r2.names # segfault
}}}

The below fixes it:

{{{
diff --git a/src/core/atomic/molarray.py b/src/core/atomic/molarray.py
index 9a1d8bb..a3fcfcf 100644
--- a/src/core/atomic/molarray.py
+++ b/src/core/atomic/molarray.py
@@ -103,7 +103,8 @@ class Collection(State):
             pointers = numpy.empty((0,), cptr)
         elif isinstance(items, numpy.ndarray) and items.dtype == numpy.uintp:
             # C++ pointers array
-            pointers = items
+            pointers = numpy.empty(len(items), numpy.uintp)
+            pointers[:] = items
         else:
             # presume iterable of objects of the object_class
             try:
}}}"	defect	closed	major		Core		fixed						all	ChimeraX
