Author: Armin Rigo <[email protected]>
Branch: improve-vmprof-testing
Changeset: r86087:e39187569474
Date: 2016-08-08 15:08 +0200
http://bitbucket.org/pypy/pypy/changeset/e39187569474/
Log: We get nonsense with stacklets, but avoid crashing, at least
diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -98,6 +98,9 @@
def leave_code(s):
if not we_are_translated():
+ # xxx this assertion may be false in the presence of
+ # stacklets, but let's assume we never run untranslated
+ # tests with stacklets and rvmprof
assert vmprof_tl_stack.getraw() == s
vmprof_tl_stack.setraw(s.c_next)
lltype.free(s, flavor='raw')
@@ -140,5 +143,9 @@
enter_code(unique_id) # ignore the return value
else:
s = vmprof_tl_stack.getraw()
- assert s.c_value == unique_id
- leave_code(s)
+ #assert s.c_value == unique_id and s.c_kind == VMPROF_CODE_TAG
+ #^^^ this is false in the presence of stacklets.
+ # we get random nonsense then; let's say it's ok for now
+ # and avoid crashing.
+ if s.c_value == unique_id and s.c_kind == VMPROF_CODE_TAG:
+ leave_code(s)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit