
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2018-07-14 20:54 byvandyswa, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 8517 | merged | python-dev,2018-07-28 10:40 | |
| Messages (5) | |||
|---|---|---|---|
| msg321661 -(view) | Author: Andrew Valencia (vandyswa) | Date: 2018-07-14 20:54 | |
Build with -DLLTRACE, then:>>> __lltrace__ = 1>>> a = [1, 2, 3]0: 100, 0push 13: 100, 1push 26: 100, 2push 39: 103, 3pop 3pop 2pop 1push [1, 2, 3]12: 90, 0pop [1, 2, 3]15: 100, 3push None18: 83pop None>>> a[0] = 10: 100, 0push 13: 101, 0push [1, 2, 3]6: 100, 1push 09: 60Program received signal SIGSEGV, Segmentation fault.0x004535ae in internal_print (op=0x84002364, fp=0xb7f3bd60 <_IO_2_1_stdout_>, flags=0, nesting=0) atObjects/object.c:293293 if (op->ob_refcnt <= 0)(gdb) bt#0 0x004535ae in internal_print (op=0x84002364, fp=0xb7f3bd60 <_IO_2_1_stdout_>, flags=0, nesting=0) atObjects/object.c:293#1 0x0045370a in PyObject_Print (op=0x84002364, fp=0xb7f3bd60 <_IO_2_1_stdout_>, flags=0) atObjects/object.c:330#2 0x004ada11 in prtrace (v=0x84002364, str=0x54b61d "stackadj") atPython/ceval.c:3979#3 0x004a505b in PyEval_EvalFrameEx (f=0xb7d11994, throwflag=0) atPython/ceval.c:1919#4 0x004ace97 in PyEval_EvalCodeEx (co=0xb7ce7bf0, globals=0xb7d7c714, locals=0xb7d7c714, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) atPython/ceval.c:3604#5 0x004a0671 in PyEval_EvalCode (co=0xb7ce7bf0, globals=0xb7d7c714, locals=0xb7d7c714) atPython/ceval.c:669#6 0x004d26ab in run_mod (mod=0x646d78, filename=0x53ddfe "<stdin>", globals=0xb7d7c714, locals=0xb7d7c714, flags=0xbffff568, arena=0x5f2b10) atPython/pythonrun.c:1385#7 0x004d1106 in PyRun_InteractiveOneFlags (fp=0xb7f3b5a0 <_IO_2_1_stdin_>, filename=0x53ddfe "<stdin>", flags=0xbffff568) atPython/pythonrun.c:866#8 0x004d0e72 in PyRun_InteractiveLoopFlags (fp=0xb7f3b5a0 <_IO_2_1_stdin_>, filename=0x53ddfe "<stdin>", flags=0xbffff568) atPython/pythonrun.c:786#9 0x004d0d1a in PyRun_AnyFileExFlags (fp=0xb7f3b5a0 <_IO_2_1_stdin_>, filename=0x53ddfe "<stdin>", closeit=0, flags=0xbffff568) atPython/pythonrun.c:755#10 0x0041d798 in Py_Main (argc=1, argv=0xbffff694) atModules/main.c:645#11 0x0041c5eb in main (argc=1, argv=0xbffff694) at ./Modules/python.c:20 | |||
| msg322559 -(view) | Author: Petr Viktorin (petr.viktorin)*![]() | Date: 2018-07-28 13:18 | |
The problem here is that tracing for STACKADJ prints out the top of the stack *after* adjustment. This is OK for growing the stack, but not for shrinking it (e.g. calling STACKADJ(-3) pops off three things at once, which can leave TOP undefined when it's printed out).On the EuroPython sprints, I recommended splitting STACKADJ into STACKADJ_GROW and STACKADJ_SHRINK, since the printing behavior should be different.This is performance-critical code; it needs to be reviewed carefully. | |||
| msg322817 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-07-31 20:47 | |
By the way, see alsobpo-25571. | |||
| msg322819 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-07-31 20:55 | |
New changeset8ed317f1ca42a43df14282bbc3ccc0b5610432f4 by Victor Stinner (costypetrisor) in branch 'master':bpo-34113: Fix a crash when using LLTRACE is on (GH-8517)https://github.com/python/cpython/commit/8ed317f1ca42a43df14282bbc3ccc0b5610432f4 | |||
| msg322820 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-07-31 20:58 | |
Thanks Constantin Petrisor to fix and thanks Andrew Valencia for the bug report!It was the first time that I see a bug report on LLTRACE on the last 5 years, it seems like almost no one uses it. Likely because you need to compile Python manually (or find a binary compiled in debug mode). So I don't think that it's worth it to backport the fix to 2.7, 3.6 and 3.7 branches. I'm not comfortable to modify ceval.c in stable branches. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:03 | admin | set | github: 78294 |
| 2018-07-31 20:58:45 | vstinner | set | status: open -> closed resolution: fixed messages: +msg322820 stage: patch review -> resolved |
| 2018-07-31 20:55:17 | vstinner | set | messages: +msg322819 |
| 2018-07-31 20:47:19 | vstinner | set | nosy: +vstinner messages: +msg322817 |
| 2018-07-28 13:18:32 | petr.viktorin | set | messages: +msg322559 |
| 2018-07-28 13:10:52 | petr.viktorin | set | nosy: +petr.viktorin |
| 2018-07-28 10:40:46 | python-dev | set | keywords: +patch stage: patch review pull_requests: +pull_request8033 |
| 2018-07-14 20:54:22 | vandyswa | create | |