Commit deee39f4 authored by Jason Madden's avatar Jason Madden

Update tblib to 2.0

parent 85a6d079
......@@ -11,3 +11,5 @@ Related changes include:
- ``setup.py`` no longer includes the ``setup_requires`` keyword.
Installation with a tool that understands ``pyproject.toml`` is
recommended.
- The bundled tblib has been updated to version 2.0.
- On Python 3.12b3, dumping tracebacks of greenlets is not available.
This diff is collapsed.
......@@ -374,16 +374,42 @@ class GreenletTree(object):
@staticmethod
def __render_tb(tree, label, frame, limit):
tree.child_data(label)
# XXX: Issues with tblib?
# 3.12b3 is crashing walking the stack on macOS;
# on Linux CI, it is failing with a nice attribute error
# XXX: Issues with tblib? Seen with tblib 1.3 and 2.0.
# More likely, it's something wrong in greenlet and the way it's
# keeping track of the frames?
#
# In a test like this:
#
# g = gevent.spawn(util.print_run_info, file=io)
# g.join() (test__util.py, line 53)
#
# 3.12b3 is crashing walking the stack on macOS:
# It's a simple segfault on line 340, ``f = f.f_back``.
# I have confirmed that the object is a real frame object.
#
# It seems unlikely to be a greenlet thing though, because the frame we're
# crashing on is the root frame:
#
# <frame at 0x.., file '/gevent/tests/test__util.py', line 53, code root>
#
# Interestingly, we see the test case dump the stack of the greenlet (successfully),
# then dump the stack of the main thread (successfully) --- this ends in line 53 --,
# and then get _another_ frame for line 53, and this is where it crashes.
# The difference? The successful dump does not list it as a root frame,
# where the failed one does.
#
#
# on Linux CI (not sure what frame), it is failing with a nice attribute error
# (which watches where the macOS is failing, inside a call to
# Py_GetAttr):
#
# File "/opt/hostedtoolcache/Python/3.12.0-beta.3/x64/lib/python3.12/traceback.py", line 339, in walk_stack
# File "//python3.12/traceback.py", line 339, in walk_stack
# yield f, f.f_lineno
# AttributeError: 'dict' object has no attribute 'f_lineno'
#
# A workaround on macOS is to not dump the root frame, but that only fixes
# test__util. test__threadpool:test_greenlet_class crashes similarly, but
# not 100% of the time.
if sys.version_info != (3, 12, 0, 'beta', 3):
tb = ''.join(traceback.format_stack(frame, limit))
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment