jit/backend/x86/test/test_recursive.py::TestRecursive::()::test_tco_doesnt_lead_to_infinite_tracing
self = <rpython.jit.backend.x86.test.test_recursive.TestRecursive instance at 0x00007f8ee703fb20>
def test_tco_doesnt_lead_to_infinite_tracing(self):
import multiprocessing
# this is super annoying to test too! since we have stack overflows in
# the llinterp, sort of random things can happen, depending on how much
# code in llinterp and pyjitpl are already jitted. therefore we run the
# function in a subprocess.
import subprocess, sys, os
env = os.environ.copy()
env["PYTHONPATH"] = os.pathsep.join(sys.path)
> subprocess.check_output("%s %s" % (sys.executable, __file__), shell=True, env=env)
jit/metainterp/test/test_recursive.py:1369:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = ('/Users/runner/hostedtoolcache/PyPy/2.7.18/x64/bin/pypy /Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/test_recursive.py',)
kwargs = {'env': {'ACTIONS_ORCHESTRATION_ID': 'f31b43fc-e7e1-4e3e-bb79-b896abccd5e6.test.jit-arch_macos-x86_64', 'ACTIONS_RUNNE...SDIRECTORY': '/Users/runner/hostedtoolcache', 'ANDROID_HOME': '/Users/runner/Library/Android/sdk', ...}, 'shell': True}
process = <subprocess.Popen object at 0x00007f8eec906598>
output = '\tbh: live [1] -> 3\n\tbh: goto_if_not_int_lt [100000, 0, 10, 8] -> 10\n\tbh: inline_call_ir_i [<rpython.jit.backend....rk/pypy/pypy/rpython/rtyper/lltypesystem/lltype.py(1264)__getattr__()\n-> o = self._obj._getattr(field_name)\n(Pdb) \n'
unused_err = None, retcode = 1
cmd = '/Users/runner/hostedtoolcache/PyPy/2.7.18/x64/bin/pypy /Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/test_recursive.py'
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example:
>>> check_output(["ls", "-l", "/dev/null"])
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = Popen(stdout=PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd, output=output)
E CalledProcessError: Command '/Users/runner/hostedtoolcache/PyPy/2.7.18/x64/bin/pypy /Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/test_recursive.py' returned non-zero exit status 1
../../../../hostedtoolcache/PyPy/2.7.18/x64/lib-python/2.7/subprocess.py:223: CalledProcessError
---------- Captured stderr call ----------
[rtyper] -=- specialized 12 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 2 JitCode instances.
[jitcodewriter:info] There are 6 -live- ops. Size of liveness is 4 bytes
[jitcodewriter] compute_bitstrings:
[jitcodewriter] 0 effectinfos:
[jitcodewriter] 0 descrs for arrays
[jitcodewriter] 0 descrs for fields
[jitcodewriter] 0 descrs for interiorfields
Traceback (most recent call last):
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/test_recursive.py", line 1410, in _run
tco_doesnt_lead_to_infinite_tracing()
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/test_recursive.py", line 1394, in tco_doesnt_lead_to_infinite_tracing
res = self.meta_interp(g, [4])
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/test/support.py", line 265, in meta_interp
return ll_meta_interp(*args, **kwds)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmspot.py", line 89, in ll_meta_interp
return jittify_and_run(interp, graph, args, backendopt=backendopt, **kwds)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmspot.py", line 127, in jittify_and_run
res = interp.eval_graph(graph, args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 97, in eval_graph
retval = llframe.eval()
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 295, in eval
nextblock, args = self.eval_block(nextblock)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 319, in eval_block
self.eval_operation(op)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 422, in eval_operation
retval = ophandler(*vals)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 697, in op_direct_call
return self.perform_call(f, FTYPE.ARGS, args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 684, in perform_call
return self.invoke_callable_with_pyexceptions(f, *args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 507, in invoke_callable_with_pyexceptions
self.make_llexception()
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 491, in invoke_callable_with_pyexceptions
return obj._callable(*args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmspot.py", line 954, in ll_portal_runner
portal_ptr)(*args)
File "/Users/runner/work/pypy/pypy/rpython/jit/codewriter/support.py", line 163, in on_top_of_llinterp
return llinterp.eval_graph(funcobj.graph, list(args))
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 97, in eval_graph
retval = llframe.eval()
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 295, in eval
nextblock, args = self.eval_block(nextblock)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 319, in eval_block
self.eval_operation(op)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 422, in eval_operation
retval = ophandler(*vals)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 697, in op_direct_call
return self.perform_call(f, FTYPE.ARGS, args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 684, in perform_call
return self.invoke_callable_with_pyexceptions(f, *args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 507, in invoke_callable_with_pyexceptions
self.make_llexception()
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 491, in invoke_callable_with_pyexceptions
return obj._callable(*args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmspot.py", line 581, in maybe_enter_jit
crash_in_jit(e)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmspot.py", line 579, in maybe_enter_jit
maybe_compile_and_run(state.increment_threshold, *args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmstate.py", line 468, in maybe_compile_and_run
bound_reached(hash, None, *args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/warmstate.py", line 442, in bound_reached
metainterp.compile_and_run_once(jitdriver_sd, *args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/pyjitpl.py", line 2895, in compile_and_run_once
return self._compile_and_run_once(original_boxes)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/pyjitpl.py", line 2911, in _compile_and_run_once
self.run_blackhole_interp_to_cancel_tracing(stb)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/pyjitpl.py", line 2955, in run_blackhole_interp_to_cancel_tracing
convert_and_run_from_pyjitpl(self, stb.raising_exception)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 1820, in convert_and_run_from_pyjitpl
_run_forever(firstbh, current_exc)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 1755, in _run_forever
current_exc = blackholeinterp._resume_mainloop(current_exc)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 1627, in _resume_mainloop
current_exc = get_llexception(self.cpu, e)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 1621, in _resume_mainloop
self.run()
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 360, in run
lle = get_llexception(self.cpu, e)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 354, in run
self.dispatch_loop(self, self.jitcode.code, self.position)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 95, in dispatch_loop
position = func(self, code, position)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 170, in handler
result = unboundmethod(*args)
File "/Users/runner/work/pypy/pypy/rpython/jit/metainterp/blackhole.py", line 1294, in bhimpl_inline_call_ir_i
args_i, args_r, None, jitcode.calldescr)
File "/Users/runner/work/pypy/pypy/rpython/jit/backend/llgraph/runner.py", line 613, in _do_call
return self.maybe_on_top_of_llinterp(func, args, TP.RESULT)
File "/Users/runner/work/pypy/pypy/rpython/jit/backend/llgraph/runner.py", line 603, in maybe_on_top_of_llinterp
res = self.llinterp.eval_graph(ptr._obj.graph, args)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 99, in eval_graph
log.error("LLEXCEPTION: %s" % (e, ))
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 54, in __str__
return '<LLException %r%s>' % (type_name(etype), extra)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/llinterp.py", line 65, in type_name
return ''.join(etype.name.chars)
File "/Users/runner/work/pypy/pypy/rpython/rtyper/lltypesystem/lltype.py", line 1264, in __getattr__
o = self._obj._getattr(field_name)
AttributeError: 'NoneType' object has no attribute '_getattr'
(somefailed=True in jit/backend/x86/test/test_recursive.py)
builder: rpython-macos-x86-64 build #730*
test: jit/backend/x86/test/test_recursive.py::TestRecursive::()::test_tco_doesnt_lead_to_infinite_tracing