memory/gc/test/test_rawrefcount.py::TestRawRefCount::()::test_pypy_nonlight_dies_quickly
self = <rpython.memory.gc.test.test_rawrefcount.TestRawRefCount object at 0x00000000853f0e58>
old = False
def test_pypy_nonlight_dies_quickly(self, old=False):
p1, p1ref, r1, r1addr, check_alive = (
> self._rawrefcount_pair(42, is_light=False, create_old=old))
memory/gc/test/test_rawrefcount.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.memory.gc.test.test_rawrefcount.TestRawRefCount object at 0x00000000853f0e58>
intval = 42, is_light = False, is_pyobj = False, create_old = False
create_immortal = False, force_external = False
def _rawrefcount_pair(self, intval, is_light=False, is_pyobj=False,
create_old=False, create_immortal=False,
force_external=False):
if is_light:
rc = REFCNT_FROM_PYPY_LIGHT
else:
rc = REFCNT_FROM_PYPY
self.trigger = []
self.gc.rawrefcount_init(lambda: self.trigger.append(1))
#
if create_immortal:
p1 = lltype.malloc(S, immortal=True)
else:
saved = self.gc.nonlarge_max
try:
if force_external:
self.gc.nonlarge_max = 1
p1 = self.malloc(S)
finally:
self.gc.nonlarge_max = saved
p1.x = intval
if create_immortal:
self.consider_constant(p1)
elif create_old:
self.stackroots.append(p1)
self._collect(major=False)
p1 = self.stackroots.pop()
p1ref = lltype.cast_opaque_ptr(llmemory.GCREF, p1)
# r1 points at ob_refcnt; the ob_pypy_link prefix is reserved before it
r1 = rawrefcount._pyobject_alloc(immortal=create_immortal)
r1.c_ob_refcnt = rc
r1addr = llmemory.cast_ptr_to_adr(r1)
if is_pyobj:
assert not is_light
self.gc.rawrefcount_create_link_pyobj(p1ref, r1addr)
else:
self.gc.rawrefcount_create_link_pypy(p1ref, r1addr)
assert r1.c_ob_refcnt == rc
> assert rawrefcount._ob_link_get(r1) != 0
E assert 0 != 0
E + where 0 = <function _ob_link_get at 0x00000000397f8a70>(<* <C object Struct PyObjectS { c_ob_refcnt, c_ob_type } at 0x6ae193d0>>)
E + where <function _ob_link_get at 0x00000000397f8a70> = <function _ob_link_get at 0x00000000397f8a70>
E + where <function _ob_link_get at 0x00000000397f8a70> = rawrefcount._ob_link_get
memory/gc/test/test_rawrefcount.py:75: AssertionError
builder: rpython-linux-aarch64 build #764*
test: memory/gc/test/test_rawrefcount.py::TestRawRefCount::()::test_pypy_nonlight_dies_quickly