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

jit/backend/llsupport/test/test_zrpy_gc_direct.py::test_guards_translated_without_gctypeptr

def test_guards_translated_without_gctypeptr():
>       run_guards_translated(gcremovetypeptr=True)

jit/backend/llsupport/test/test_zrpy_gc_direct.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jit/backend/llsupport/test/test_zrpy_gc_direct.py:185: in run_guards_translated
    cbuilder.generate_source(defines=cbuilder.DEBUG_DEFINES)
translator/c/genc.py:178: in generate_source
    db = self.build_database()
translator/c/genc.py:102: in build_database
    self.config.translation.reverse_debugger)
translator/c/database.py:64: in __init__
    self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks)
translator/c/gc.py:452: in gettransformer
    return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks)
memory/gctransform/framework.py:247: in __init__
    self.check_custom_trace_funcs(gcdata.gc, translator.rtyper)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <rpython.memory.gctransform.shadowstack.ShadowStackFrameworkGCTransformer object at 0x000000096d450cd0>
gc = <rpython.memory.gc.minimark.MiniMarkGC object at 0x000000096d464ad8>
rtyper = <rpython.rtyper.rtyper.RPythonTyper object at 0x000000096adf9a98>

    def check_custom_trace_funcs(self, gc, rtyper):
        # detect if one of the custom trace functions uses the GC
        # (it must not!)
        for TP, func in rtyper.custom_trace_funcs:
            if getattr(func, '_skip_collect_analyzer_', False):
                continue
            def no_op_callback(obj, arg1, arg2):
                pass
            def ll_check_no_collect(obj):
                func(gc, obj, no_op_callback, None, None)
            annhelper = annlowlevel.MixLevelHelperAnnotator(rtyper)
            graph1 = annhelper.getgraph(ll_check_no_collect, [SomeAddress()],
                                        annmodel.s_None)
            annhelper.finish()
            collect_analyzer = CollectAnalyzer(self.translator)
            if collect_analyzer.analyze_direct_call(graph1):
                raise Exception(
                    "the custom trace hook %r for %r can cause "
>                   "the GC to be called!" % (func, TP))
E               Exception: the custom trace hook <function gcrefs_trace at 0x0000000961079bc8> for <GcStruct GCREFTRACER { array_base_addr, array_length }> can cause the GC to be called!

memory/gctransform/framework.py:630: Exception
---------- Captured stderr call ----------
[rtyper] -=- specialized 8 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] specializing: 100 / 381 blocks   (26%)
[rtyper] specializing: 200 / 434 blocks   (46%)
[rtyper] specializing: 300 / 434 blocks   (69%)
[rtyper] specializing: 400 / 434 blocks   (92%)
[rtyper] -=- specialized 422 more blocks -=-
[rtyper] -=- specialized 26 more blocks -=-
[rtyper] specializing: 500 / 5538 blocks   (9%)
[rtyper] specializing: 1000 / 6568 blocks   (15%)
[rtyper] specializing: 1400 / 6807 blocks   (20%)
[rtyper] specializing: 2500 / 9881 blocks   (25%)
[rtyper] specializing: 3200 / 10408 blocks   (30%)
[rtyper] specializing: 3900 / 11025 blocks   (35%)
[rtyper] specializing: 4500 / 11209 blocks   (40%)
[rtyper] specializing: 5100 / 11233 blocks   (45%)
[rtyper] specializing: 5500 / 11233 blocks   (48%)
[rtyper] specializing: 6000 / 11233 blocks   (53%)
[rtyper] specializing: 6600 / 11235 blocks   (58%)
[rtyper] specializing: 7100 / 11235 blocks   (63%)
[rtyper] specializing: 7700 / 11235 blocks   (68%)
[rtyper] specializing: 8300 / 11235 blocks   (73%)
[rtyper] specializing: 8800 / 11235 blocks   (78%)
[rtyper] specializing: 9400 / 11235 blocks   (83%)
[rtyper] specializing: 9900 / 11235 blocks   (88%)
[rtyper] specializing: 10500 / 11235 blocks   (93%)
[rtyper] specializing: 11100 / 11235 blocks   (98%)
[rtyper] -=- specialized 10775 more blocks -=-
[rtyper] -=- specialized 34 more blocks -=-
[rtyper] -=- specialized 0 more blocks -=-
[rtyper] -=- specialized 25 more blocks -=-
[rtyper] specializing: 11300 / 13151 blocks   (85%)
[rtyper] specializing: 11900 / 13158 blocks   (90%)
[rtyper] specializing: 12600 / 13235 blocks   (95%)
[rtyper] specializing: 13200 / 13245 blocks   (99%)
[rtyper] -=- specialized 1951 more blocks -=-
[rtyper] specializing: 13300 / 13336 blocks   (99%)
[rtyper] -=- specialized 91 more blocks -=-
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 1180 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 35 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[rtyper] -=- specialized 17 more blocks -=-
[rtyper] -=- specialized 12 more blocks -=-
 (somefailed=True in jit/backend/llsupport/test)
builder: rpython-macos-arm64 build #720*
test: jit/backend/llsupport/test/test_zrpy_gc_direct.py::test_guards_translated_without_gctypeptr