Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

memory/gc/test/test_rawrefcount.py::TestRawRefCount::()::test_pypy_nonlight_survives_from_obj_old

self = <rpython.memory.gc.test.test_rawrefcount.TestRawRefCount object at 0x0000000059785328>

    def test_pypy_nonlight_survives_from_obj_old(self):
>       self.test_pypy_nonlight_survives_from_obj(old=True)

memory/gc/test/test_rawrefcount.py:239: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
memory/gc/test/test_rawrefcount.py:200: in test_pypy_nonlight_survives_from_obj
    self._rawrefcount_pair(42, is_light=False, create_old=old))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <rpython.memory.gc.test.test_rawrefcount.TestRawRefCount object at 0x0000000059785328>
intval = 42, is_light = False, is_pyobj = False, create_old = True
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 0x000000000ed42db8>(<* <C object Struct PyObjectS { c_ob_refcnt, c_ob_type } at 0x1c6d0f80>>)
E        +    where <function _ob_link_get at 0x000000000ed42db8> = <function _ob_link_get at 0x000000000ed42db8>
E        +      where <function _ob_link_get at 0x000000000ed42db8> = rawrefcount._ob_link_get

memory/gc/test/test_rawrefcount.py:75: AssertionError
builder: rpython-linux-x86-64 build #764*
test: memory/gc/test/test_rawrefcount.py::TestRawRefCount::()::test_pypy_nonlight_survives_from_obj_old