python testrunner/pypyjit_tests.py
in dir /Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build (timeout 4000 secs)
watching logfiles {'pytestLog': 'pypyjit_new.log'}
argv: ['python', 'testrunner/pypyjit_tests.py']
environment:
HOME=/Users/matti
HOMEBREW_CELLAR=/opt/homebrew_x86_64/Cellar
HOMEBREW_PREFIX=/opt/homebrew_x86_64
HOMEBREW_REPOSITORY=/opt/homebrew_x86_64
INFOPATH=/opt/homebrew_x86_64/share/info:
LANG=en_US.UTF-8
LC_ADDRESS=en_AU.UTF-8
LC_IDENTIFICATION=en_AU.UTF-8
LC_MEASUREMENT=en_AU.UTF-8
LC_MONETARY=en_AU.UTF-8
LC_NAME=en_AU.UTF-8
LC_NUMERIC=en_AU.UTF-8
LC_PAPER=en_AU.UTF-8
LC_TELEPHONE=en_AU.UTF-8
LC_TIME=en_AU.UTF-8
LOGNAME=matti
OLDPWD=/Users/matti
PATH=/Users/matti/oss/pypy-x86_64-buildbot/bin:/opt/homebrew_x86_64/bin:/opt/homebrew_x86_64/sbin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin
PKG_CONFIG_PATH=/opt/homebrew_x86_64/opt/openssl@1.1/lib/pkgconfig
PWD=/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build
PYPY_USESSION_DIR=/tmp/buildbot-x86_64
SHELL=/bin/zsh
SHLVL=2
SSH_CLIENT=10.0.0.17 57960 22
SSH_CONNECTION=10.0.0.17 57960 10.0.0.16 22
SSH_TTY=/dev/ttys000
TERM=xterm-256color
TMPDIR=/tmp/buildbot-x86_64/pytest
USER=matti
_=/Users/matti/oss/pypy-x86_64-buildbot/bin/buildslave
using PTY: False
/Users/matti/oss/pypy-x86_64-buildbot/site-packages/hypothesis/extra/pytestplugin.py:61: HypothesisWarning:
You are using Pytest version 2.9.2. Hypothesis tests work with any test
runner, but our Pytest plugin requires Pytest 4.3 or newer.
Note that the Pytest developers no longer support this version either!
Disabling the Hypothesis pytest plugin...
warnings.warn(PYTEST_TOO_OLD_MESSAGE % (pytest.__version__,), HypothesisWarning)
============================= test session starts ==============================
platform darwin -- Python 2.7.18[pypy-7.3.17-final], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
pytest-2.9.2 from /Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/pytest.pyc
rootdir: /Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build, inifile: pytest.ini
plugins: hypothesis-4.57.1
collected 1194 items / 1 skipped
pypy/module/pypyjit/test_pypy_c/test_00_model.py ........................
pypy/module/pypyjit/test_pypy_c/test_alloc.py ...................................................
pypy/module/pypyjit/test_pypy_c/test_array.py ........
pypy/module/pypyjit/test_pypy_c/test_boolrewrite.py ......................................................................................................................................................................................................................................................................................................................................
pypy/module/pypyjit/test_pypy_c/test_buffers.py F.
pypy/module/pypyjit/test_pypy_c/test_bug.py s
pypy/module/pypyjit/test_pypy_c/test_call.py .........................s.
pypy/module/pypyjit/test_pypy_c/test_capture_locals.py .
pypy/module/pypyjit/test_pypy_c/test_cprofile.py .
pypy/module/pypyjit/test_pypy_c/test_exception.py .....
pypy/module/pypyjit/test_pypy_c/test_ffi.py s..s...F..
pypy/module/pypyjit/test_pypy_c/test_generators.py ...
pypy/module/pypyjit/test_pypy_c/test_getframe.py ..
pypy/module/pypyjit/test_pypy_c/test_globals.py .
pypy/module/pypyjit/test_pypy_c/test_import.py ....
pypy/module/pypyjit/test_pypy_c/test_instance.py ...........F...
pypy/module/pypyjit/test_pypy_c/test_intbound.py ...................................................................................................................................................................................................................................................................................
pypy/module/pypyjit/test_pypy_c/test_itertools.py ..
pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py F
pypy/module/pypyjit/test_pypy_c/test_math.py ..s..
pypy/module/pypyjit/test_pypy_c/test_micronumpy.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
pypy/module/pypyjit/test_pypy_c/test_min_max.py ...
pypy/module/pypyjit/test_pypy_c/test_misc.py .......................
pypy/module/pypyjit/test_pypy_c/test_shift.py ...........................................................................................................................................................................................................................
pypy/module/pypyjit/test_pypy_c/test_string.py ......x............
pypy/module/pypyjit/test_pypy_c/test_struct.py ....F.
pypy/module/pypyjit/test_pypy_c/test_thread.py ...
pypy/module/pypyjit/test_pypy_c/test_weakref.py .
=================================== FAILURES ===================================
__________________________ TestBuffers.test_re_match ___________________________
self = <pypy.module.pypyjit.test_pypy_c.test_buffers.TestBuffers object at 0x00007fb6f0a8fbe8>
def test_re_match(self):
def main(n):
import re
import array
p = re.compile(b'.+')
a = array.array('B', b'test' * 1000)
i = 0
while i < n:
i += 1
p.match(a) # ID: match
return i
log = self.run(main, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('match', """
guard_not_invalidated(descr=...)
p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
i74 = instance_ptr_eq(_, p71)
guard_false(i74, descr=...)
i65 = getfield_gc_i(p18, descr=...)
i67 = int_gt(0, i65)
guard_false(i67, descr=...)
i69 = int_gt(#, i65)
guard_true(i69, descr=...)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_buffers.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x00007fb6f0d7d4b0>
cond = False, message = 'operation mismatch'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: operation mismatch
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'match'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
guard_not_invalidated(descr=<Guard0x7f89c08bf3d0>)
p73 = getfield_gc_r(p14, descr=<FieldP pypy.module._sre.interp_sre.W_SRE_Pattern.inst_w_pattern 56>)
guard_nonnull_class(p73, ConstClass(W_BytesObject), descr=<Guard0x7f89c0863a60>)
i76 = instance_ptr_eq(ConstPtr(ptr75), p73)
guard_false(i76, descr=<Guard0x7f89c08bf440>)
i77 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)
===== HERE =====
i79 = int_add(i77, 1)
i80 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 40>)
i82 = int_gt(0, i80)
guard_false(i82, descr=<Guard0x7f89c08bf4b0>)
i84 = int_gt(9223372036854775807, i80)
guard_true(i84, descr=<Guard0x7f89c08bf520>)
guard_not_invalidated(descr=<Guard0x7f89c08bf600>)
i98 = getfield_raw_i(4604368240, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i100 = int_lt(i98, 0)
guard_false(i100, descr=<Guard0x7f89c08bf670>)
Expected:
guard_not_invalidated(descr=...)
p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
i74 = instance_ptr_eq(_, p71)
guard_false(i74, descr=...)
i65 = getfield_gc_i(p18, descr=...)
i67 = int_gt(0, i65)
guard_false(i67, descr=...)
i69 = int_gt(#, i65)
guard_true(i69, descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
_______________ Test__ffi.test_cffi_call_guard_not_forced_fails ________________
self = <pypy.module.pypyjit.test_pypy_c.test_ffi.Test__ffi object at 0x00007fb6b1db8250>
def test_cffi_call_guard_not_forced_fails(self):
# this is the test_pypy_c equivalent of
# rpython/jit/metainterp/test/test_fficall::test_guard_not_forced_fails
#
# it requires cffi to be installed for pypy in order to run
def main():
import sys
try:
import cffi
except ImportError:
sys.stderr.write('SKIP: cannot import cffi\n')
return 0
ffi = cffi.FFI()
ffi.cdef("""
typedef void (*functype)(int);
int foo(int n, functype func);
""")
lib = ffi.verify("""
#include <signal.h>
typedef void (*functype)(int);
int foo(int n, functype func) {
if (n >= 2000) {
func(n);
}
return n*2;
}
""")
@ffi.callback("functype")
def mycallback(n):
if n < 5000:
return
# make sure that guard_not_forced fails
d = {}
f = sys._getframe()
while f:
d.update(f.f_locals)
f = f.f_back
n = 0
while n < 10000:
res = lib.foo(n, mycallback) # ID: cfficall
# this is the real point of the test: before the
# refactor-call_release_gil branch, the assert failed when
# res == 5000
assert res == n*2
n += 1
return n
log = self.run(main, [], import_site=True,
> discard_stdout_before_last_line=True) # <- for Win32
pypy/module/pypyjit/test_pypy_c/test_ffi.py:320:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.test_ffi.Test__ffi object at 0x00007fb6b1db8250>
func_or_src = <function main at 0x00007fb6c0c16110>, args = []
import_site = True, discard_stdout_before_last_line = True
jitopts = {'disable_unrolling': 9999, 'threshold': 200}
src = <py._code.source.Source object at 0x00007fb6b1db8288>, funcname = 'main'
arglist = ''
f = <closed file '/tmp/buildbot-x86_64/usession-py3.12-2967/test-pypy-jit/test_cffi_call_guard_not_forced_fails.py', mode 'w' at 0x00007fb6b1d70520>
logfile = local('/tmp/buildbot-x86_64/usession-py3.12-2967/test-pypy-jit/test_cffi_call_guard_not_forced_fails.log')
cmdline = ['/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/pypy/goal/pypy3.12-c', '--jit', 'threshold=200,disable_unrolling=9999', '/tmp/buildbot-x86_64/usession-py3.12-2967/test-pypy-jit/test_cffi_call_guard_not_forced_fails.py']
key = 'disable_unrolling'
def run(self, func_or_src, args=[], import_site=False,
discard_stdout_before_last_line=False, **jitopts):
jitopts.setdefault('threshold', 200)
jitopts.setdefault('disable_unrolling', 9999)
if self.pypy_c is None:
py.test.skip("run with --pypy=PATH")
src = py.code.Source(func_or_src)
if isinstance(func_or_src, types.FunctionType):
funcname = func_or_src.func_name
else:
funcname = 'main'
# write the snippet
arglist = ', '.join(map(repr, args))
with self.filepath.open("w") as f:
# we don't want to see the small bridges created
# by the checkinterval reaching the limit
f.write("import sys\n")
f.write("sys.setcheckinterval(10000000)\n")
f.write(str(src) + "\n")
f.write("print(%s(%s))\n" % (funcname, arglist))
#
# run a child pypy-c with logging enabled
logfile = self.filepath.new(ext='.log')
#
cmdline = [self.pypy_c]
if not import_site:
cmdline.append('-S')
if jitopts:
jitcmdline = ['%s=%s' % (key, value)
for key, value in jitopts.items()]
cmdline += ['--jit', ','.join(jitcmdline)]
cmdline.append(str(self.filepath))
#
env = os.environ.copy()
# TODO old logging system
env['PYPYLOG'] = self.log_string + ':' + str(logfile)
jitlogfile = str(logfile) + '.jlog'
env['JITLOG'] = str(jitlogfile)
pipe = subprocess.Popen(cmdline,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = pipe.communicate()
if pipe.wait() < 0:
raise IOError("subprocess was killed by signal %d" % (
pipe.returncode,))
if stderr.startswith('SKIP:'):
py.test.skip(stderr)
#if stderr.startswith('debug_alloc.h:'): # lldebug builds
# stderr = ''
#assert not stderr
if not stdout:
raise Exception("no stdout produced; stderr='''\n%s'''"
> % (stderr,))
E Exception: no stdout produced; stderr='''
E Traceback (most recent call last):
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/_shimmed_dist_utils.py", line 12, in <module>
E import setuptools
E ModuleNotFoundError: No module named 'setuptools'
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/tmp/buildbot-x86_64/usession-py3.12-2967/test-pypy-jit/test_cffi_call_guard_not_forced_fails.py", line 50, in <module>
E print(main())
E ^^^^^^
E File "/tmp/buildbot-x86_64/usession-py3.12-2967/test-pypy-jit/test_cffi_call_guard_not_forced_fails.py", line 18, in main
E lib = ffi.verify("""
E ^^^^^^
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/api.py", line 468, in verify
E lib = self.verifier.load_library()
E ^^^^^^^^^^^^
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/verifier.py", line 105, in load_library
E self._compile_module()
E ^^^^^^^^^^^^^^^
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/verifier.py", line 209, in _compile_module
E output_rel_filename = ffiplatform.compile(tmpdir, self.get_extension())
E ^^^^^^^^^^^^^
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/verifier.py", line 126, in get_extension
E return ffiplatform.get_extension(sourcename, modname, **self.kwds)
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/ffiplatform.py", line 38, in get_extension
E from cffi._shimmed_dist_utils import Extension
E File "/Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/lib_pypy/cffi/_shimmed_dist_utils.py", line 16, in <module>
E raise Exception("This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.") from ex
E Exception: This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.
E '''
pypy/module/pypyjit/test_pypy_c/test_00_model.py:96: Exception
__________________ TestInstance.test_namedtuple_construction ___________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x00007fb6f124e678>
def test_namedtuple_construction(self):
def main():
from collections import namedtuple
A = namedtuple("A", "x y")
res = 0
i = 0
while i < 2000:
res += A(i, 0).x
i += 1
log = self.run(main, [])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i5, 2000)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
p1 = force_token()
p2 = force_token()
i20 = int_add_ovf(i19, i5)
guard_no_overflow(descr=...)
i9 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:390:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:177: in match
return matcher.match(expected_src, **kwds)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x00007fb6c3b23d00>
cond = False, message = 'operation mismatch'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: operation mismatch
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = None
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
i77 = int_lt(i71, 2000)
guard_true(i77, descr=<Guard0x7fe6f8814480>)
guard_not_invalidated(descr=<Guard0x7fe6f8823da8>)
p78 = force_token()
===== HERE =====
p81 = new_with_vtable(descr=<SizeDescr 32>)
setfield_gc(p81, ConstPtr(ptr82), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 24 pure>)
i86 = call_i(ConstClass(ll_call_lookup_function_trampoline__v2224___simple_call__function_), p46, p81, -4271678147626733788, 0, descr=<Calli 8 rrii EF=5 OS=4>)
setfield_gc(p81, ConstPtr(null), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__index_storage 8>)
setfield_gc(p81, 10, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length 16 pure>)
guard_no_exception(descr=<Guard0x7fe6f88144d0>)
i90 = int_lt(i86, 0)
guard_false(i90, descr=<Guard0x7fe6f8823e18>)
p91 = getinteriorfield_gc_r(p57, i86, descr=<InteriorFieldDescr <FieldP odictentry.value 8>>)
guard_value(p91, ConstPtr(ptr92), descr=<Guard0x7fe6f8814520>)
p94 = force_token()
i98 = int_add_ovf(i69, i71)
guard_no_overflow(descr=<Guard0x7fe6f8823e50>)
i100 = int_add(i71, 1)
i102 = getfield_raw_i(4574397808, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i104 = int_lt(i102, 0)
guard_false(i104, descr=<Guard0x7fe6f8823ec0>)
jump(p0, p1, p8, i98, i100, p33, p46, p34, p57, descr=TargetToken(140629988540448))
Expected:
i7 = int_lt(i5, 2000)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
p1 = force_token()
p2 = force_token()
i20 = int_add_ovf(i19, i5)
guard_no_overflow(descr=...)
i9 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
______________________________ TestLogParser.test ______________________________
self = <pypy.module.pypyjit.test_pypy_c.test_jitlogparser.TestLogParser object at 0x00007fb7044880c8>
def test(self):
def fn_with_bridges(N):
def is_prime(x):
for y in range(2, x):
if x % y == 0:
return False
return True
result = 0
for x in range(N):
if x % 3 == 0:
result += 5
elif x % 5 == 0:
result += 3
elif is_prime(x):
result += x
elif x == 99:
result *= 2
return result
#
N = 10000
_log = self.run(fn_with_bridges, [N])
log, loops = import_log(_log.logfile)
parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
is_prime_loops = []
fn_with_bridges_loops = []
bridges = {}
for loop in loops:
if hasattr(loop, 'force_asm'):
try:
> loop.force_asm()
pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rpython/tool/jitlogparser/parser.py:472: in <lambda>
dump_start=start_ofs))
rpython/tool/jitlogparser/parser.py:110: in postprocess
backend_tp, dump_start)
rpython/tool/jitlogparser/parser.py:151: in _asm_disassemble
return list(machine_code_dump(d, origin_addr, tp))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
data = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...xfaASM\x8d\x9b\x80\xe7\xff\xffA\xff\xe3\xff5\x86\xf7\xff\xffM\x8d\x9b\x80\x00m\xfaASM\x8d\x9b\xc0\xe6\xff\xffA\xff\xe3'
originaddr = 4442335840L, backend_name = 'x86_64', label_list = None
def machine_code_dump(data, originaddr, backend_name, label_list=None):
objdump_machine_option = {
'x86': 'i386',
'x86-without-sse2': 'i386',
'x86_32': 'i386',
'x86_64': 'i386:x86-64',
'x86-64': 'i386:x86-64',
'i386': 'i386',
'arm': 'arm',
'arm_32': 'arm',
'aarch64': 'aarch64',
'ppc' : 'powerpc:common64',
'ppc-64' : 'powerpc:common64',
'riscv64': 'riscv:rv64',
's390x': 's390:64-bit',
}
machine_endianness = {
# default value: 'little'
'ppc' : sys.byteorder, # i.e. same as the running machine...
'ppc-64' : sys.byteorder, # i.e. same as the running machine...
's390x' : sys.byteorder, # i.e. same as the running machine...
}
cmd = find_objdump()
objdump = ('%(command)s -b binary -m %(machine)s '
'--endian=%(endianness)s '
'--disassembler-options=intel-mnemonics '
'--adjust-vma=%(origin)d -D %(file)s')
#
f = open(tmpfile, 'wb')
f.write(data)
f.close()
p = subprocess.Popen(objdump % {
'command': cmd,
'file': tmpfile,
'origin': originaddr,
'machine': objdump_machine_option[backend_name],
'endianness': machine_endianness.get(backend_name, 'little'),
}, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
assert not p.returncode, ('Encountered an error running objdump: %s' %
> stderr)
E AssertionError: Encountered an error running objdump: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: error: unknown argument '-b'
rpython/jit/backend/tool/viewcode.py:82: AssertionError
----------------------------- Captured stdout call -----------------------------
loading symbols from /Users/matti/build-worker-x86_64/pypy-c-jit-macos-x86-64/build/pypy/goal/pypy3.12-c...
3 symbols found
----------------------------- Captured stderr call -----------------------------
0%..loaded
_____________________ TestStruct.test_pack_into_raw_buffer _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x00007fb6c212efa8>
def test_pack_into_raw_buffer(self):
def main(n):
import array
import struct
buf = array.array('b', b'\x00'*8)
i = 1
while i < n:
struct.pack_into("h", buf, 4, i) # ID: pack_into
i += 1
return i
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('pack_into', """\
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x00007fb6f0fce250>
cond = False, message = 'operation mismatch'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: operation mismatch
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'pack_into'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
guard_not_invalidated(descr=<Guard0x7fdbc0778ad8>)
===== HERE =====
setfield_gc(p14, i45, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)
i65 = int_le(i58, 32767)
guard_true(i65, descr=<Guard0x7fdbc075b4c0>)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
Expected:
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
=========================== short test summary info ============================
FAIL pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_re_match
FAIL pypy/module/pypyjit/test_pypy_c/test_ffi.py::Test__ffi::()::test_cffi_call_guard_not_forced_fails
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_namedtuple_construction
FAIL pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py::TestLogParser::()::test
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_pack_into_raw_buffer
======= 5 failed, 1027 passed, 162 skipped, 1 xfailed in 291.11 seconds ========
program finished with exit code 1
elapsedTime=292.532069