Title: Crash on AST with misordered linenos · Issue #92597 · python/cpython · GitHub
Open Graph Title: Crash on AST with misordered linenos · Issue #92597 · python/cpython
X Title: Crash on AST with misordered linenos · Issue #92597 · python/cpython
Description: Compile 3.11 branch ./python.exe -m ensurepip ./python.exe -m pip install pytest-cov ./python.exe -m pytest Crashes with Assertion failed: (i->i_end_lineno >= i->i_lineno), function write_location_info_long_form, file compile.c, line 753...
Open Graph Description: Compile 3.11 branch ./python.exe -m ensurepip ./python.exe -m pip install pytest-cov ./python.exe -m pytest Crashes with Assertion failed: (i->i_end_lineno >= i->i_lineno), function write_location_...
X Description: Compile 3.11 branch ./python.exe -m ensurepip ./python.exe -m pip install pytest-cov ./python.exe -m pytest Crashes with Assertion failed: (i->i_end_lineno >= i->i_lineno), function write_...
Opengraph URL: https://github.com/python/cpython/issues/92597
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on AST with misordered linenos","articleBody":"- Compile 3.11 branch\r\n- `./python.exe -m ensurepip`\r\n- `./python.exe -m pip install pytest-cov`\r\n- `./python.exe -m pytest`\r\n\r\nCrashes with `Assertion failed: (i-\u003ei_end_lineno \u003e= i-\u003ei_lineno), function write_location_info_long_form, file compile.c, line 7532.`\r\n\r\nlldb stack trace:\r\n\r\n```\r\n(lldb) bt\r\n* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert\r\n frame #0: 0x00007fff203cd92e libsystem_kernel.dylib`__pthread_kill + 10\r\n frame #1: 0x00007fff203fc5bd libsystem_pthread.dylib`pthread_kill + 263\r\n frame #2: 0x00007fff20351406 libsystem_c.dylib`abort + 125\r\n frame #3: 0x00007fff203507d8 libsystem_c.dylib`__assert_rtn + 314\r\n * frame #4: 0x000000010027c183 python.exe`write_location_info_long_form.cold.2 at compile.c:7532:5 [opt]\r\n frame #5: 0x000000010018f469 python.exe`write_location_info_long_form(a=\u003cunavailable\u003e, i=\u003cunavailable\u003e, length=\u003cunavailable\u003e) at compile.c:7532:5 [opt]\r\n frame #6: 0x000000010018f27d python.exe`write_location_info_entry(a=0x00007ffeefbfe5d0, i=0x000000010388ac98, isize=1) at compile.c:7590:5 [opt]\r\n frame #7: 0x000000010018d2cd python.exe`assemble_emit_location(a=0x00007ffeefbfe5d0, i=0x000000010388ac98) at compile.c:7605:12 [opt]\r\n frame #8: 0x000000010017e9fa python.exe`assemble(c=\u003cunavailable\u003e, addNone=\u003cunavailable\u003e) at compile.c:8411:18 [opt]\r\n frame #9: 0x000000010017d4a3 python.exe`compiler_mod(c=0x00007ffeefbfe6b8, mod=\u003cunavailable\u003e) at compile.c:2203:10 [opt]\r\n frame #10: 0x000000010017d2b3 python.exe`_PyAST_Compile(mod=0x00000001038852b0, filename=0x000000010654d630, flags=\u003cunavailable\u003e, optimize=\u003cunavailable\u003e, arena=0x00000001064b0100) at compile.c:581:10 [opt]\r\n frame #11: 0x00000001001634e0 python.exe`builtin_compile_impl(module=\u003cunavailable\u003e, source=0x00000001065a3fc0, filename=0x000000010654d630, mode=\u003cunavailable\u003e, flags=\u003cunavailable\u003e, dont_inherit=1, optimize=-1, feature_version=-1) at bltinmodule.c:818:33 [opt]\r\n frame #12: 0x0000000100161fb6 python.exe`builtin_compile(module=\u003cunavailable\u003e, args=0x00007ffeefbfe7f0, nargs=\u003cunavailable\u003e, kwnames=\u003cunavailable\u003e) at bltinmodule.c.h:328:20 [opt]\r\n frame #13: 0x00000001000cbb08 python.exe`cfunction_vectorcall_FASTCALL_KEYWORDS(func=0x0000000100b9f4d0, args=0x0000000100c6fe00, nargsf=\u003cunavailable\u003e, kwnames=0x0000000102c72260) at methodobject.c:443:24 [opt]\r\n frame #14: 0x0000000100087018 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100486930, callable=0x0000000100b9f4d0, args=0x0000000100c6fe00, nargsf=9223372036854775811, kwnames=0x0000000102c72260) at pycore_call.h:92:11 [opt]\r\n frame #15: 0x0000000100086fa0 python.exe`PyObject_Vectorcall(callable=\u003cunavailable\u003e, args=\u003cunavailable\u003e, nargsf=\u003cunavailable\u003e, kwnames=\u003cunavailable\u003e) at call.c:299:12 [opt]\r\n frame #16: 0x0000000100170d7c python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100486930, frame=0x0000000100c6fd70, throwflag=\u003cunavailable\u003e) at ceval.c:4826:23 [opt]\r\n frame #17: 0x000000010016680d python.exe`_PyEval_EvalFrame(tstate=\u003cunavailable\u003e, frame=\u003cunavailable\u003e, throwflag=\u003cunavailable\u003e) at pycore_ceval.h:66:16 [opt]\r\n frame #18: 0x0000000100166726 python.exe`_PyEval_Vector(tstate=0x0000000100486930, func=0x0000000104737d80, locals=0x0000000000000000, args=0x00007ffeefbfeb80, argcount=3, kwnames=\u003cunavailable\u003e) at ceval.c:6468:24 [opt]\r\n frame #19: 0x0000000100087330 python.exe`_PyFunction_Vectorcall(func=0x0000000104737d80, stack=0x00007ffeefbfeb80, nargsf=\u003cunavailable\u003e, kwnames=0x0000000000000000) at call.c:0:45 [opt]\r\n frame #20: 0x0000000100089fd8 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100486930, callable=0x0000000104737d80, args=0x00007ffeefbfeb80, nargsf=3, kwnames=0x0000000000000000) at pycore_call.h:92:11 [opt]\r\n frame #21: 0x0000000100089644 python.exe`method_vectorcall(method=\u003cunavailable\u003e, args=0x00000001064c9788, nargsf=\u003cunavailable\u003e, kwnames=0x0000000000000000) at classobject.c:89:18 [opt]\r\n frame #22: 0x0000000100086f3d python.exe`_PyVectorcall_Call(tstate=0x0000000100486930, func=(python.exe`method_vectorcall at classobject.c:44), callable=0x000000010640d310, tuple=0x00000001064c9770, kwargs=0x0000000000000000) at call.c:245:16 [opt]\r\n frame #23: 0x0000000100087148 python.exe`_PyObject_Call(tstate=0x0000000100486930, callable=0x000000010640d310, args=0x00000001064c9770, kwargs=0x0000000000000000) at call.c:328:16 [opt]\r\n frame #24: 0x0000000100087209 python.exe`PyObject_Call(callable=\u003cunavailable\u003e, args=\u003cunavailable\u003e, kwargs=\u003cunavailable\u003e) at call.c:355:12 [opt]\r\n frame #25: 0x0000000100177419 python.exe`do_call_core(tstate=0x0000000100486930, func=0x000000010640d310, callargs=0x00000001064c9770, kwdict=0x0000000000000000, use_tracing=\u003cunavailable\u003e) at ceval.c:0:13 [opt]\r\n frame #26: 0x00000001001733b0 python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100486930, frame=0x0000000100c6f580, throwflag=\u003cunavailable\u003e) at ceval.c:5431:22 [opt]\r\n frame #27: 0x000000010016680d python.exe`_PyEval_EvalFrame(tstate=\u003cunavailable\u003e, frame=\u003cunavailable\u003e, throwflag=\u003cunavailable\u003e) at pycore_ceval.h:66:16 [opt]\r\n frame #28: 0x0000000100166726 python.exe`_PyEval_Vector(tstate=0x0000000100486930, func=0x0000000104053490, locals=0x0000000000000000, args=0x00000001064c0a48, argcount=1, kwnames=\u003cunavailable\u003e) at ceval.c:6468:24 [opt]\r\n frame #29: 0x0000000100087330 python.exe`_PyFunction_Vectorcall(func=0x0000000104053490, stack=0x00000001064c0a48, nargsf=\u003cunavailable\u003e, kwnames=0x00000001064c8f50) at call.c:0:45 [opt]\r\n frame #30: 0x00000001000866b2 python.exe`_PyObject_FastCallDictTstate(tstate=0x0000000100486930, callable=0x0000000104053490, args=0x00007ffeefbfef70, nargsf=1, kwargs=0x00000001064c6d50) at call.c:152:15 [opt]\r\n frame #31: 0x00000001000875e4 python.exe`_PyObject_Call_Prepend(tstate=\u003cunavailable\u003e, callable=\u003cunavailable\u003e, obj=0x000000010622f3a0, args=\u003cunavailable\u003e, kwargs=\u003cunavailable\u003e) at call.c:482:24 [opt]\r\n frame #32: 0x00000001000ee1f9 python.exe`slot_tp_call(self=0x000000010622f3a0, args=0x000000010046c5a0, kwds=0x00000001064c6d50) at typeobject.c:7604:15 [opt]\r\n frame #33: 0x000000010008689c python.exe`_PyObject_MakeTpCall(tstate=0x0000000100486930, callable=0x000000010622f3a0, args=0x0000000100c6f408, nargs=\u003cunavailable\u003e, keywords=0x0000000104694960) at call.c:214:18 [opt]\r\n frame #34: 0x0000000100087049 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100486930, callable=0x000000010622f3a0, args=0x0000000100c6f408, nargsf=9223372036854775808, kwnames=0x0000000104694960) at pycore_call.h:90:16 [opt]\r\n frame #35: 0x0000000100086fa0 python.exe`PyObject_Vectorcall(callable=\u003cunavailable\u003e, args=\u003cunavailable\u003e, nargsf=\u003cunavailable\u003e, kwnames=\u003cunavailable\u003e) at call.c:299:12 [opt]\r\n frame #36: 0x0000000100170d7c python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100486930, frame=0x0000000100c6f380, throwflag=\u003cunavailable\u003e) at ceval.c:4826:23 [opt]\r\n frame #37: 0x000000010016680d python.exe`_PyEval_EvalFrame(tstate=\u003cunavailable\u003e, frame=\u003cunavailable\u003e, throwflag=\u003cunavailable\u003e) at pycore_ceval.h:66:16 [opt]\r\n frame #38: 0x0000000100166726 python.exe`_PyEval_Vector(tstate=0x0000000100486930, func=0x0000000102881b20, locals=0x0000000102830350, args=0x0000000000000000, argcount=0, kwnames=\u003cunavailable\u003e) at ceval.c:6468:24 [opt]\r\n frame #39: 0x0000000100166615 python.exe`PyEval_EvalCode(co=\u003cunavailable\u003e, globals=0x0000000102830350, locals=0x0000000102830350) at ceval.c:1207:21 [opt]\r\n frame #40: 0x0000000100163b09 python.exe`builtin_exec_impl(module=\u003cunavailable\u003e, source=0x000000010617f230, globals=0x0000000102830350, locals=0x0000000102830350, closure=\u003cunavailable\u003e) at bltinmodule.c:1080:17 [opt]\r\n frame #41: 0x000000010016224d python.exe`builtin_exec(module=\u003cunavailable\u003e, args=0x0000000100c6f180, nargs=2, kwnames=0x0000000000000000) at bltinmodule.c.h:465:20 [opt]\r\n frame #42: 0x00000001000cbb08 python.exe`cfunction_vectorcall_FASTCALL_KEYWORDS(func=0x0000000100b9f6b0, args=0x0000000100c6f180, nargsf=\u003cunavailable\u003e, kwnames=0x0000000000000000) at methodobject.c:443:24 [opt]\r\n frame #43: 0x0000000100087018 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100486930, callable=0x0000000100b9f6b0, args=0x0000000100c6f180, nargsf=9223372036854775810, kwnames=0x0000000000000000) at pycore_call.h:92:11 [opt]\r\n frame #44: 0x0000000100086fa0 python.exe`PyObject_Vectorcall(callable=\u003cunavailable\u003e, args=\u003cunavailable\u003e, nargsf=\u003cunavailable\u003e, kwnames=\u003cunavailable\u003e) at call.c:299:12 [opt]\r\n frame #45: 0x0000000100170d7c python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100486930, frame=0x0000000100c6f0d8, throwflag=\u003cunavailable\u003e) at ceval.c:4826:23 [opt]\r\n frame #46: 0x000000010016680d python.exe`_PyEval_EvalFrame(tstate=\u003cunavailable\u003e, frame=\u003cunavailable\u003e, throwflag=\u003cunavailable\u003e) at pycore_ceval.h:66:16 [opt]\r\n frame #47: 0x0000000100166726 python.exe`_PyEval_Vector(tstate=0x0000000100486930, func=0x0000000102c5eaf0, locals=0x0000000000000000, args=0x0000000102894ba8, argcount=2, kwnames=\u003cunavailable\u003e) at ceval.c:6468:24 [opt]\r\n frame #48: 0x0000000100087330 python.exe`_PyFunction_Vectorcall(func=0x0000000102c5eaf0, stack=0x0000000102894ba8, nargsf=\u003cunavailable\u003e, kwnames=0x0000000000000000) at call.c:0:45 [opt]\r\n frame #49: 0x0000000100086f3d python.exe`_PyVectorcall_Call(tstate=0x0000000100486930, func=(python.exe`_PyFunction_Vectorcall at call.c:385), callable=0x0000000102c5eaf0, tuple=0x0000000102894b90, kwargs=0x0000000000000000) at call.c:245:16 [opt]\r\n frame #50: 0x0000000100087148 python.exe`_PyObject_Call(tstate=0x0000000100486930, callable=0x0000000102c5eaf0, args=0x0000000102894b90, kwargs=0x0000000000000000) at call.c:328:16 [opt]\r\n frame #51: 0x0000000100087209 python.exe`PyObject_Call(callable=\u003cunavailable\u003e, args=\u003cunavailable\u003e, kwargs=\u003cunavailable\u003e) at call.c:355:12 [opt]\r\n frame #52: 0x00000001001d9f3d python.exe`pymain_run_module(modname=\u003cunavailable\u003e, set_argv0=\u003cunavailable\u003e) at main.c:300:14 [opt]\r\n frame #53: 0x00000001001d982d python.exe`pymain_run_python(exitcode=0x00007ffeefbff7dc) at main.c:595:21 [opt]\r\n frame #54: 0x00000001001d9718 python.exe`Py_RunMain at main.c:680:5 [opt]\r\n frame #55: 0x00000001001d99af python.exe`pymain_main(args=\u003cunavailable\u003e) at main.c:710:12 [opt]\r\n frame #56: 0x00000001001d99fb python.exe`Py_BytesMain(argc=\u003cunavailable\u003e, argv=\u003cunavailable\u003e) at main.c:734:12 [opt]\r\n frame #57: 0x0000000100001999 python.exe`main(argc=\u003cunavailable\u003e, argv=\u003cunavailable\u003e) at python.c:15:12 [opt]\r\n frame #58: 0x00007fff20417f3d libdyld.dylib`start + 1\r\n```\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on: 3.11 current head\r\n- Operating system and architecture: macOS\r\n\r\nI put print statements in that show the file it crashes on is `'/usr/local/lib/python3.11/site-packages/pytest_cov/plugin.py'`, but just running Python on that file doesn't reproduce the crash. I'll try to debug some more.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2022-05-10T04:12:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/92597/cpython/issues/92597"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eef98705-82b4-da6c-bd5f-7798d86c9a59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9C0:7F615:9707F5:CB331A:696991BB |
| html-safe-nonce | 4a1455f77194316c5f39eeab150d9ed16ead6fde1673b2d1ad04d05abf874213 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUMwOjdGNjE1Ojk3MDdGNTpDQjMzMUE6Njk2OTkxQkIiLCJ2aXNpdG9yX2lkIjoiMTg5NDIyMTE0MDY5OTIyMjQ1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f3f24c39e80c5dcfbccaef6b027415c34a65c5c0ce88ae25cdffe63729e5a53a |
| hovercard-subject-tag | issue:1230591540 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/92597/issue_layout |
| twitter:image | https://opengraph.githubassets.com/335f9915c006cfa1ca4ffe751852e485ad98129064f8e94ac1e7c0ca7f226c9c/python/cpython/issues/92597 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/335f9915c006cfa1ca4ffe751852e485ad98129064f8e94ac1e7c0ca7f226c9c/python/cpython/issues/92597 |
| og:image:alt | Compile 3.11 branch ./python.exe -m ensurepip ./python.exe -m pip install pytest-cov ./python.exe -m pytest Crashes with Assertion failed: (i->i_end_lineno >= i->i_lineno), function write_location_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width