MagicStack / MagicStack/uvloop

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

Ouverte
#574 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Cython
Étoiles
11.9k
Forks
616
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

  • 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
[…]

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

L'échec se produit dans test_cython_coro_is_coroutine ; commencez par exécuter make test avec les assertions de CPython activées et examinez la trace d'exécution à travers uvloop/loop.pyx et Objects/codeobject.c. La tâche est terminée lorsque le test n'interrompt plus son exécution avec cette configuration et que les tests d'intégration Cython passent toujours.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
testing-qa
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.