jit/backend/x86/test/test_zrpy_releasegil.py::TestShadowStack::()::test_simple
cls = <class 'rpython.jit.backend.x86.test.test_zrpy_releasegil.TestShadowStack'>
def setup_class(cls):
funcs = []
name_to_func = {}
for fullname in dir(cls):
if not fullname.startswith('define'):
continue
definefunc = getattr(cls, fullname)
_, name = fullname.split('_', 1)
beforefunc, loopfunc, afterfunc = definefunc.im_func(cls)
if beforefunc is None:
def beforefunc(n, x):
return n, x, None, None, None, None, None, None, None, None, None, ''
if afterfunc is None:
def afterfunc(n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s):
pass
beforefunc.__name__ = 'before_'+name
loopfunc.__name__ = 'loop_'+name
afterfunc.__name__ = 'after_'+name
funcs.append((beforefunc, loopfunc, afterfunc))
assert name not in name_to_func
name_to_func[name] = len(name_to_func)
print(name_to_func)
def allfuncs(name, n):
x = X()
x.foo = 2
main_allfuncs(name, n, x)
x.foo = 5
return weakref.ref(x)
def main_allfuncs(name, n, x):
num = name_to_func[name]
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s = funcs[num][0](n, x)
while n > 0:
myjitdriver.can_enter_jit(num=num, n=n, x=x, x0=x0, x1=x1,
x2=x2, x3=x3, x4=x4, x5=x5, x6=x6, x7=x7, l=l, s=s)
myjitdriver.jit_merge_point(num=num, n=n, x=x, x0=x0, x1=x1,
x2=x2, x3=x3, x4=x4, x5=x5, x6=x6, x7=x7, l=l, s=s)
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s = funcs[num][1](
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s)
funcs[num][2](n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s)
myjitdriver = JitDriver(greens = ['num'],
reds = ['n', 'x', 'x0', 'x1', 'x2', 'x3', 'x4',
'x5', 'x6', 'x7', 'l', 's'], is_recursive=True)
cls.main_allfuncs = staticmethod(main_allfuncs)
cls.name_to_func = name_to_func
OLD_DEBUG = GcLLDescr_framework.DEBUG
try:
GcLLDescr_framework.DEBUG = True
cls.cbuilder = compile(get_entry(allfuncs), cls.gc,
gcrootfinder=cls.gcrootfinder, jit=True,
> thread=True)
jit/backend/llsupport/test/zrpy_gc_test.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
jit/backend/llsupport/test/zrpy_gc_test.py:120: in compile
cbuilder.compile()
translator/c/genc.py:341: in compile
extra_opts)
translator/platform/posix.py:277: in execute_makefile
self._handle_error(returncode, stdout, stderr, path.join('make'))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Darwin_x86_64 cc=clang>, returncode = 2
stdout = 'clang -O3 -fomit-frame-pointer -Wno-duplicate-decl-specifier -mmacosx-version-min=10.13 -arch x86_64 -mdynamic-no-pic.../rpython"/rlib/rjitlog/src -I"/Users/matti/build-worker-x86_64/rpython-macos-x86-64/build/rpython"/rlib/rvmprof/src \n'
stderr = "implement.c:1055:32: error: incompatible function pointer types passing 'int (*)(Signed, Signed)' (aka 'int (*)(long,... void *, const void *));\n | ^\n1 error generated.\nmake: *** [implement.o] Error 1\n"
outname = local('/tmp/buildbot-x86_64/usession-main-4396/testing_1/make')
def _handle_error(self, returncode, stdout, stderr, outname):
if returncode != 0:
errorfile = outname.new(ext='errors')
errorfile.write(stderr, 'wb')
if self.log_errors:
stderrlines = stderr.splitlines()
for line in stderrlines:
log.Error(line)
# ^^^ don't use ERROR, because it might actually be fine.
# Also, ERROR confuses lib-python/conftest.py.
> raise CompilationError(stdout, stderr)
E CompilationError: CompilationError(err="""
E implement.c:1055:32: error: incompatible function pointer types passing 'int (*)(Signed, Signed)' (aka 'int (*)(long, long)') to parameter of type 'int (* _Nonnull)(const void *, const void *)' [-Wincompatible-function-pointer-types]
E 1055 | qsort(l_a0_2, l_a1_2, l_a2_1, l_a3_0);
E | ^~~~~~
E /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h:157:22: note: passing argument to parameter '__compar' here
E 157 | int (* _Nonnull __compar)(const void *, const void *));
E | ^
E 1 error generated.
E make: *** [implement.o] Error 1
E """)
translator/platform/__init__.py:155: CompilationError
---------- Captured stdout setup ----------
{'close_stack': 0, 'get_set_errno': 1, 'simple': 2}
---------- Captured stderr setup ----------
[rtyper] specializing: 100 / 1219 blocks (8%)
[rtyper] specializing: 200 / 1336 blocks (14%)
[rtyper] specializing: 300 / 1336 blocks (22%)
[rtyper] specializing: 400 / 1340 blocks (29%)
[rtyper] specializing: 500 / 1340 blocks (37%)
[rtyper] specializing: 600 / 1340 blocks (44%)
[rtyper] specializing: 700 / 1340 blocks (52%)
[rtyper] specializing: 800 / 1340 blocks (59%)
[rtyper] specializing: 900 / 1340 blocks (67%)
[rtyper] specializing: 1000 / 1340 blocks (74%)
[rtyper] specializing: 1100 / 1340 blocks (82%)
[rtyper] specializing: 1200 / 1340 blocks (89%)
[rtyper] specializing: 1300 / 1340 blocks (97%)
[rtyper] -=- specialized 1340 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 27 more blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 7 more blocks -=-
[rtyper] -=- specialized 6 more blocks -=-
[rtyper] specializing: 1400 / 1407 blocks (99%)
[rtyper] -=- specialized 17 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[backendopt:removeassert] Removed 2 asserts
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 19 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 31 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[rtyper] -=- specialized 3 more blocks -=-
[jitcodewriter:info] making JitCodes...
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[jitcodewriter:info] There are 12 JitCode instances.
[jitcodewriter:info] There are 38 -live- ops. Size of liveness is 49 bytes
[jitcodewriter] compute_bitstrings:
[jitcodewriter] 11 effectinfos:
[jitcodewriter] 1 descrs for arrays
[jitcodewriter] 2 descrs for fields
[jitcodewriter] 0 descrs for interiorfields
[jitcodewriter] -> 2 bitstrings, mean length 0.5, max length 1
[rtyper] specializing: 2700 / 53193 blocks (5%)
[rtyper] specializing: 5600 / 55789 blocks (10%)
[rtyper] specializing: 8900 / 59189 blocks (15%)
[rtyper] specializing: 12400 / 61848 blocks (20%)
[rtyper] specializing: 15500 / 61848 blocks (25%)
[rtyper] specializing: 18600 / 61848 blocks (30%)
[rtyper] specializing: 21800 / 62071 blocks (35%)
[rtyper] specializing: 26500 / 66059 blocks (40%)
[rtyper] specializing: 29800 / 66109 blocks (45%)
[rtyper] specializing: 33100 / 66121 blocks (50%)
[rtyper] specializing: 36400 / 66127 blocks (55%)
[rtyper] specializing: 39800 / 66279 blocks (60%)
[rtyper] specializing: 43100 / 66296 blocks (65%)
[rtyper] specializing: 46500 / 66296 blocks (70%)
[rtyper] specializing: 49800 / 66296 blocks (75%)
[rtyper] specializing: 52200 / 66296 blocks (78%)
[rtyper] specializing: 55200 / 66401 blocks (83%)
[rtyper] specializing: 58500 / 66401 blocks (88%)
[rtyper] specializing: 61800 / 66401 blocks (93%)
[rtyper] specializing: 65100 / 66401 blocks (98%)
[rtyper] specializing: 66300 / 66403 blocks (99%)
[rtyper] -=- specialized 64987 more blocks -=-
[rtyper] -=- specialized 64 more blocks -=-
[rtyper] -=- specialized 0 more blocks -=-
[backendopt:removeassert] Could not remove 210 asserts, but removed 1885 asserts.
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 28502 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 4613 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[rtyper] -=- specialized 25 more blocks -=-
[rtyper] specializing: 66500 / 69129 blocks (96%)
[rtyper] specializing: 69200 / 69283 blocks (99%)
[rtyper] -=- specialized 2791 more blocks -=-
[rtyper] specializing: 69300 / 69326 blocks (99%)
[rtyper] -=- specialized 43 more blocks -=-
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 1668 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 26 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[rtyper] -=- specialized 17 more blocks -=-
[rtyper] -=- specialized 12 more blocks -=-
[rtyper] -=- specialized 21 more blocks -=-
[rtyper] -=- specialized 5 more blocks -=-
[rtyper] -=- specialized 0 more blocks -=-
[c] 1000 nodes [ array: 1049 framework rtti: 19 func: 168 group: 1 struct: 2455 ]
[c] 2000 nodes [ array: 3049 framework rtti: 19 func: 168 group: 1 struct: 2455 ]
[c] 3000 nodes [ array: 4295 framework rtti: 21 func: 217 group: 1 struct: 2519 ]
[c] 4000 nodes [ array: 4295 framework rtti: 21 func: 217 group: 1 struct: 2519 ]
[c] 5000 nodes [ array: 4295 framework rtti: 21 func: 217 group: 1 struct: 2519 ]
[c] 6000 nodes [ array: 4295 framework rtti: 21 func: 217 group: 1 struct: 2519 ]
[c] 7000 nodes [ array: 4318 framework rtti: 26 func: 245 group: 1 struct: 2612 ]
[c] 8000 nodes [ array: 4564 framework rtti: 39 func: 609 group: 1 struct: 3310 ]
[c] 9000 nodes [ array: 4844 framework rtti: 51 func: 805 group: 1 struct: 3819 ]
[c] 10000 nodes [ array: 4925 framework rtti: 64 func: 1153 group: 1 struct: 4073 ]
[c] 11000 nodes [ array: 4970 framework rtti: 163 func: 1452 group: 1 struct: 5893 ]
[c] 12000 nodes [ array: 4987 framework rtti: 294 func: 1661 group: 1 struct: 6064 ]
[c] 13000 nodes [ array: 5270 framework rtti: 294 func: 1712 group: 1 struct: 6163 ]
[c] 14000 nodes [ array: 5367 framework rtti: 301 func: 2191 group: 1 struct: 6414 ]
[c] 15000 nodes [ array: 5439 framework rtti: 304 func: 2750 group: 1 struct: 6930 ]
[c:database] GC transformer: finished helpers
[c] 16000 nodes [ array: 5761 framework rtti: 309 func: 2795 group: 1 struct: 7604 ]
[c] 17000 nodes [ array: 5903 framework rtti: 370 func: 3151 group: 1 struct: 7825 ]
[c] 18000 nodes [ array: 5954 framework rtti: 388 func: 3656 group: 1 struct: 8650 ]
[c] 19000 nodes [ array: 6016 framework rtti: 398 func: 3885 group: 1 struct: 8760 ]
[rtyper] specializing: 69400 / 69451 blocks (99%)
[rtyper] -=- specialized 70 more blocks -=-
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 7 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 16 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[c:database] GC transformer: finished tables
[gctransform:info] assigned 1036 typeids
[gctransform:info] added 26555 push/pop stack root instructions
[gctransform:info] inserted 1181 write barrier calls
[gctransform:info] inserted 1234 write_barrier_from_array calls
[gctransform:info] found 4 static roots
[c:database] Inlining GC helpers and postprocessing
[c] 19976 nodes [ array: 6208 framework rtti: 458 func: 4104 group: 1 struct: 9205 ]
[c:database] Completed
[c:writing] structdef.h
[c:writing] forwarddecl.h
[c:writing] preimpl.h
[c:writing] data_rpython_flowspace.c
[c:writing] data_rpython_jit_backend.c
[c:writing] data_rpython_jit_backend_llsupport.c
[c:writing] data_rpython_jit_backend_llsupport_test.c
[c:writing] data_rpython_jit_backend_x86.c
[c:writing] data_rpython_jit_codewriter.c
[c:writing] data_rpython_jit_metainterp.c
[c:writing] data_rpython_jit_metainterp_optimizeopt.c
[c:writing] data_rpython_memory_gc.c
[c:writing] data_rpython_memory_gctransform.c
[c:writing] data_rpython_rlib.c
[c:writing] data_rpython_rlib_rjitlog.c
[c:writing] data_rpython_rtyper.c
[c:writing] data_rpython_rtyper_lltypesystem.c
[c:writing] nonfuncnodes.c
[c:writing] data_rpython_jit_backend_llsupport_1.c
[c:writing] data_rpython_jit_backend_llsupport_test_1.c
[c:writing] data_rpython_jit_backend_x86_1.c
[c:writing] data_rpython_jit_metainterp_1.c
[c:writing] data_rpython_memory_gc_1.c
[c:writing] data_rpython_rlib_1.c
[c:writing] data_rpython_rlib_rjitlog_1.c
[c:writing] data_rpython_rlib_rvmprof.c
[c:writing] data_rpython_rtyper_lltypesystem_1.c
[c:writing] implement.c
[c:writing] rpython_flowspace.c
[c:writing] rpython_jit_backend.c
[c:writing] rpython_jit_backend_llsupport.c
[c:computedgoto] pypy_g_GcRewriterAssembler_handle_malloc_operation: 6 cases
[c:writing] rpython_jit_backend_llsupport_test.c
[c:writing] rpython_jit_backend_x86.c
[c:writing] rpython_jit_backend_x86_1.c
[c:writing] rpython_jit_backend_x86_2.c
[c:writing] rpython_jit_codewriter.c
[c:writing] rpython_jit_metainterp.c
[c:computedgoto] pypy_g_dispatch_loop: 47 cases
[c:computedgoto] pypy_g_HeapCache_clear_caches_not_necessary: 15 cases
[c:computedgoto] pypy_g_HeapCache_clear_caches_varargs: 11 cases
[c:writing] rpython_jit_metainterp_1.c
[c:computedgoto] pypy_g_execute_nonspec_const: 253 cases
[c:writing] rpython_jit_metainterp_2.c
[c:writing] rpython_jit_metainterp_optimizeopt.c
[c:computedgoto] pypy_g_OptHeap_check_postprocess_: 6 cases
[c:computedgoto] pypy_g_dispatch_postprocess___star_0: 6 cases
[c:computedgoto] pypy_g_OptString_optimize_CALL_I: 8 cases
[c:writing] rpython_jit_metainterp_optimizeopt_1.c
[c:writing] rpython_jit_metainterp_optimizeopt_2.c
[c:computedgoto] pypy_g_Optimizer_protect_speculative_operation: 8 cases
[c:writing] rpython_jit_metainterp_optimizeopt_3.c
[c:writing] rpython_memory.c
[c:writing] rpython_memory_gc.c
[c:writing] rpython_memory_gctransform.c
[c:writing] rpython_rlib.c
[c:writing] rpython_rlib_rjitlog.c
[c:writing] rpython_rlib_rvmprof.c
[c:writing] rpython_rtyper.c
[c:writing] rpython_rtyper_lltypesystem.c
[c:writing] rpython_rtyper_lltypesystem_1.c
[c:writing] rpython_translator.c
[c:writing] rpython_translator_c.c
[platform:execute] make in /tmp/buildbot-x86_64/usession-main-4396/testing_1
[platform:Error] implement.c:1055:32: error: incompatible function pointer types passing 'int (*)(Signed, Signed)' (aka 'int (*)(long, long)') to parameter of type 'int (* _Nonnull)(const void *, const void *)' [-Wincompatible-function-pointer-types]
[platform:Error] 1055 | qsort(l_a0_2, l_a1_2, l_a2_1, l_a3_0);
[platform:Error] | ^~~~~~
[platform:Error] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h:157:22: note: passing argument to parameter '__compar' here
[platform:Error] 157 | int (* _Nonnull __compar)(const void *, const void *));
[platform:Error] | ^
[platform:Error] 1 error generated.
[platform:Error] make: *** [implement.o] Error 1
builder: rpython-macos-x86-64 build #287+
test: jit/backend/x86/test/test_zrpy_releasegil.py::TestShadowStack::()::test_simple