MagicStack / MagicStack/uvloop

test_cython_coro_is_coroutine: python: Objects/codeobject.c:771: PyCode_Addr2Line: Assertion `addrq >= 0 && addrq < _PyCode_NBYTES(co)' failed.

オープン
#574 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Cython
スター
11.9k
フォーク
616
PR マージ指標
30日以内にマージされた PR はありません

説明

  • uvloop version: v0.18.0 (5ddf38bccad1107e6488357fd3dbb6b886b95134), also earier
  • Python version: 3.11.6
  • Platform: Gentoo Linux amd64
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes
  • Does uvloop behave differently from vanilla asyncio? How?: n/a

When CPython is built with assertions enabled (i.e. configure --with-assertions), test_cython_coro_is_coroutine is causing a crash:

$ make test
[…]
test_cython_coro_is_coroutine (test_cython.TestCythonIntegration.test_cython_coro_is_coroutine) ... python: Objects/codeobject.c:771: PyCode_Addr2Line: Assertion `addrq >= 0 && addrq < _PyCode_NBYTES(co)' failed.
Backtrace via gdb
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f67050a2e2f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f6705052cc2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f670503b4ed in __GI_abort () at abort.c:79
#4  0x00007f670503b415 in __assert_fail_base (fmt=0x7f67051b8b98 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7f670562f638 "addrq >= 0 && addrq < _PyCode_NBYTES(co)", 
    file=file@entry=0x7f670562f377 "Objects/codeobject.c", line=line@entry=771, 
    function=function@entry=0x7f670562fe50 <__PRETTY_FUNCTION__.12> "PyCode_Addr2Line") at assert.c:92
#5  0x00007f670504b5e2 in __assert_fail (assertion=0x7f670562f638 "addrq >= 0 && addrq < _PyCode_NBYTES(co)", 
    file=0x7f670562f377 "Objects/codeobject.c", line=771, function=0x7f670562fe50 <__PRETTY_FUNCTION__.12> "PyCode_Addr2Line")
    at assert.c:101
#6  0x00007f670538ebb3 in PyCode_Addr2Line (co=0x7f6702fe71b0, addrq=0) at Objects/codeobject.c:771
#7  0x00007f670550ee7c in _PyInterpreterFrame_GetLine (frame=0x7f67004ba3e0) at Python/frame.c:169
#8  0x00007f67053b32e8 in PyFrame_GetLineNumber (f=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 ())
    at Objects/frameobject.c:43
#9  0x00007f67053b3306 in frame_getlineno (f=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 (), 
    closure=0x0) at Objects/frameobject.c:50
#10 0x00007f6705395e26 in getset_get (descr=0x7f6704f58840, 
    obj=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 (), type=<type at remote 0x7f6705785ea0>)
    at Objects/descrobject.c:202
#11 0x00007f67053f8ae5 in _PyObject_GenericGetAttrWithDict (
    obj=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 (), name='f_lineno', dict=0x0, suppress=0)
    at Objects/object.c:1278
#12 0x00007f67053f8e4b in PyObject_GenericGetAttr (
    obj=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 (), name='f_lineno') at Objects/object.c:1368
#13 0x00007f67053f7d98 in PyObject_GetAttr (v=Frame 0x7f67004ba3e0, for file uvloop/loop.pyx, line ?, in _test_coroutine_1 (), 
    name='f_lineno') at Objects/object.c:916
#14 0x00007f67054cf45c in _PyEval_EvalFrameDefault (tstate=0x7f67058a9218 <_PyRuntime+166328>, frame=0x7f6705a3ba88, throwflag=0)
    at Python/ceval.c:3452
#15 0x00007f67054bfa5a in _PyEval_EvalFrame (tstate=0x7f67058a9218 <_PyRuntime+166328>, frame=0x7f6705a3b8a8, throwflag=0)
    at ./Include/internal/pycore_ceval.h:73
#16 0x00007f67054e1162 in _PyEval_Vector (tstate=0x7f67058a9218 <_PyRuntime+166328>, func=0x7f67041b42c0, locals=0x0, 
    args=0x7ffffb985bf0, argcount=2, kwnames=0x0) at Python/ceval.c:6425
#17 0x00007f6705385531 in _PyFunction_Vectorcall (func=<function at remote 0x7f67041b42c0>, stack=0x7ffffb985bf0, nargsf=2, 
    kwnames=0x0) at Objects/call.c:393
--Type <RET> for more, q to quit, c to continue without paging--c
#18 0x00007f670538893f in _PyObject_VectorcallTstate (tstate=0x7f67058a9218 <_PyRuntime+166328>, 
    callable=<function at remote 0x7f67041b42c0>, args=0x7ffffb985bf0, nargsf=2, kwnames=0x0) at ./Include/internal/pycore_call.h:92
#19 0x00007f670538914b in method_vectorcall (method=<method at remote 0x7f67031afe40>, args=0x7f6701e5d2b8, nargsf=1, kwnames=0x0)
    at Objects/classobject.c:89
#20 0x00007f6705384e5b in _PyVectorcall_Call (tstate=0x7f67058a9218 <_PyRuntime+166328>, func=0x7f6705388ef7 <method_vectorcall>, 
    callable=<method at remote 0x7f67031afe40>, 
    tuple=(<TextTestResult(failfast=False, failures=[], errors=[], testsRun=122, skipped=[(<Test_AIO_Context(_testMethodName='test_create_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb60>: 'assertTupleEqual', <type at remote 0x7f670578de20>: 'assertSetEqual', <type at remote 0x7f670578e160>: 'assertSetEqual', <type at remote 0x7f67057921a0>: 'assertMultiLineEqual'}, loop=None, _check_unclosed_resources_in_debug=True, _BaseTestCase__unhandled_exceptions=[]) at remote 0x7f6702b38590>, 'this seems to be a bug in asyncio'), (<Test_AIO_Context(_testMethodName='test_create_ssl_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb...(truncated), kwargs={})
    at Objects/call.c:245
#21 0x00007f6705385233 in _PyObject_Call (tstate=0x7f67058a9218 <_PyRuntime+166328>, callable=<method at remote 0x7f67031afe40>, 
    args=(<TextTestResult(failfast=False, failures=[], errors=[], testsRun=122, skipped=[(<Test_AIO_Context(_testMethodName='test_create_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb60>: 'assertTupleEqual', <type at remote 0x7f670578de20>: 'assertSetEqual', <type at remote 0x7f670578e160>: 'assertSetEqual', <type at remote 0x7f67057921a0>: 'assertMultiLineEqual'}, loop=None, _check_unclosed_resources_in_debug=True, _BaseTestCase__unhandled_exceptions=[]) at remote 0x7f6702b38590>, 'this seems to be a bug in asyncio'), (<Test_AIO_Context(_testMethodName='test_create_ssl_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb...(truncated), kwargs={})
    at Objects/call.c:328
#22 0x00007f670538532c in PyObject_Call (callable=<method at remote 0x7f67031afe40>, 
    args=(<TextTestResult(failfast=False, failures=[], errors=[], testsRun=122, skipped=[(<Test_AIO_Context(_testMethodName='test_create_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb60>: 'assertTupleEqual', <type at remote 0x7f670578de20>: 'assertSetEqual', <type at remote 0x7f670578e160>: 'assertSetEqual', <type at remote 0x7f67057921a0>: 'assertMultiLineEqual'}, loop=None, _check_unclosed_resources_in_debug=True, _BaseTestCase__unhandled_exceptions=[]) at remote 0x7f6702b38590>, 'this seems to be a bug in asyncio'), (<Test_AIO_Context(_testMethodName='test_create_ssl_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb...(truncated), kwargs={})
    at Objects/call.c:355
#23 0x00007f67054e4445 in do_call_core (tstate=0x7f67058a9218 <_PyRuntime+166328>, func=<method at remote 0x7f67031afe40>, 
    callargs=(<TextTestResult(failfast=False, failures=[], errors=[], testsRun=122, skipped=[(<Test_AIO_Context(_testMethodName='test_create_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb60>: 'assertTupleEqual', <type at remote 0x7f670578de20>: 'assertSetEqual', <type at remote 0x7f670578e160>: 'assertSetEqual', <type at remote 0x7f67057921a0>: 'assertMultiLineEqual'}, loop=None, _check_unclosed_resources_in_debug=True, _BaseTestCase__unhandled_exceptions=[]) at remote 0x7f6702b38590>, 'this seems to be a bug in asyncio'), (<Test_AIO_Context(_testMethodName='test_create_ssl_server_manual_connection_lost', _outcome=None, _testMethodDoc=None, _cleanups=[], _subtest=None, _type_equality_funcs={<type at remote 0x7f67057889e0>: 'assertDictEqual', <type at remote 0x7f67057874c0>: 'assertListEqual', <type at remote 0x7f670578eb...(truncated), kwdict={}, use_tracing=0)
    at Python/ceval.c:7343
#24 0x00007f67054dc36e in _PyEval_EvalFrameDefault (tstate=0x7f67058a9218 <_PyRuntime+166328>, frame=0x7f6705a3b820, throwflag=0)
    at Python/ceval.c:5367
#25 0x00007f67054bfa5a in _PyEval_EvalFrame (tstate=0x7f67058a9218 <_PyRuntime+166328>, frame=0x7f6705a3b820, throwflag=0)
    at ./Include/internal/pycore_ceval.h:73
#26 0x00007f67054e1162 in _PyEval_Vector (tstate=0x7f67058a9218 <_PyRuntime+166328>, func=0x7f67041b44a0, locals=0x0, 
    args=0x7ffffb988310, argcount=2, kwnames=0x0) at Python/ceval.c:6425
#27 0x00007f6705385531 in _PyFunction_Vectorcall (func=<function at remote 0x7f67041b44a0>, stack=0x7ffffb988310, nargsf=2, 
    kwnames=0x0) at Objects/call.c:393
#28 0x00007f6705384968 in _PyObject_FastCallDictTstate (tstate=0x7f67058a9218 <_PyRuntime+166328>, 
    callable=<function at remote 0x7f67041b44a0>, args=0x7ffffb988310, nargsf=2, kwargs=0x0) at Objects/call.c:141
[…]

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

失敗は test_cython_coro_is_coroutine で発生しています。まず CPython のアサーションを有効にして make test を実行し、uvloop/loop.pyx と Objects/codeobject.c を通じて traceback を調査してください。この構成でテストが abort せず、Cython の統合テストも引き続き成功すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。