jit/metainterp/test/test_jitiface.py::TestJitHookInterface::()::test_abort_quasi_immut
self = <rpython.jit.metainterp.test.test_jitiface.TestJitHookInterface object at 0x0000000035440ec8>
def test_abort_quasi_immut(self):
reasons = []
class MyJitIface(JitHookInterface):
def on_abort(self, reason, jitdriver, greenkey, greenkey_repr, logops, ops):
assert jitdriver is myjitdriver
assert len(greenkey) == 1
reasons.append(reason)
assert greenkey_repr == 'blah'
assert len(ops) > 1
iface = MyJitIface()
myjitdriver = JitDriver(greens=['foo'], reds=['x', 'total'],
get_printable_location=lambda *args: 'blah')
class Foo:
_immutable_fields_ = ['a?']
def __init__(self, a):
self.a = a
def f(a, x):
foo = Foo(a)
total = 0
while x > 0:
myjitdriver.jit_merge_point(foo=foo, x=x, total=total)
# read a quasi-immutable field out of a Constant
total += foo.a
foo.a += 1
x -= 1
return total
#
assert f(100, 7) == 721
> res = self.meta_interp(f, [100, 7], policy=JitPolicy(iface))
jit/metainterp/test/test_jitiface.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
jit/metainterp/test/support.py:265: in meta_interp
return ll_meta_interp(*args, **kwds)
jit/metainterp/warmspot.py:89: in ll_meta_interp
return jittify_and_run(interp, graph, args, backendopt=backendopt, **kwds)
jit/metainterp/warmspot.py:127: in jittify_and_run
res = interp.eval_graph(graph, args)
rtyper/llinterp.py:102: in eval_graph
retval = llframe.eval()
rtyper/llinterp.py:300: in eval
nextblock, args = self.eval_block(nextblock)
rtyper/llinterp.py:324: in eval_block
self.eval_operation(op)
rtyper/llinterp.py:427: in eval_operation
retval = ophandler(*vals)
rtyper/llinterp.py:702: in op_direct_call
return self.perform_call(f, FTYPE.ARGS, args)
rtyper/llinterp.py:689: in perform_call
return self.invoke_callable_with_pyexceptions(f, *args)
rtyper/llinterp.py:512: in invoke_callable_with_pyexceptions
self.make_llexception()
rtyper/llinterp.py:489: in make_llexception
evalue = exdata.get_standard_ll_exc_instance_by_class(exc.__class__)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.exceptiondata.ExceptionData object at 0x0000000035611d38>
exceptionclass = <class 'rpython.rtyper.exceptiondata.UnknownException'>
def get_standard_ll_exc_instance_by_class(self, exceptionclass):
if exceptionclass not in self.standardexceptions:
> raise UnknownException(exceptionclass)
E UnknownException: <class 'rpython.rtyper.exceptiondata.UnknownException'>
rtyper/exceptiondata.py:42: UnknownException
---------- Captured stdout call ----------
~~~ Crash in JIT!
~~~ <class 'rpython.translator.platform.CompilationError'>: CompilationError(err="""
gcc: fatal error: cannot execute ‘/opt/rh/gcc-toolset-14/root/usr/libexec/gcc/x86_64-redhat-linux/14/cc1’: posix_spawn: Operation not permitted
compilation terminated.
""")
---------- Captured stderr call ----------
[rtyper] -=- specialized 11 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 7 more blocks -=-
[rtyper] -=- specialized 6 more blocks -=-
[rtyper] -=- specialized 17 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 3 more blocks -=-
[jitcodewriter:info] making JitCodes...
[jitcodewriter:info] There are 1 JitCode instances.
[jitcodewriter:info] There are 6 -live- ops. Size of liveness is 10 bytes
[jitcodewriter] compute_bitstrings:
[jitcodewriter] 0 effectinfos:
[jitcodewriter] 0 descrs for arrays
[jitcodewriter] 0 descrs for fields
[jitcodewriter] 0 descrs for interiorfields
[platform:Error] gcc: fatal error: cannot execute ‘/opt/rh/gcc-toolset-14/root/usr/libexec/gcc/x86_64-redhat-linux/14/cc1’: posix_spawn: Operation not permitted
[platform:Error] compilation terminated.
builder: rpython-linux-x86-64 build #948+
test: jit/metainterp/test/test_jitiface.py::TestJitHookInterface::()::test_abort_quasi_immut