This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年07月22日 13:13 by Albert.Zeyer, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue12608.patch | meador.inge, 2011年08月07日 01:20 | Patch against tip (3.3.0a0) | review | |
| Messages (8) | |||
|---|---|---|---|
| msg140873 - (view) | Author: Albert Zeyer (Albert.Zeyer) * | Date: 2011年07月22日 13:13 | |
Code:
```
import ast
globalsDict = {}
fAst = ast.FunctionDef(
name="foo",
args=ast.arguments(
args=[], vararg=None, kwarg=None, defaults=[],
kwonlyargs=[], kw_defaults=[]),
body=[], decorator_list=[])
exprAst = ast.Interactive(body=[fAst])
ast.fix_missing_locations(exprAst)
compiled = compile(exprAst, "<foo>", "single")
eval(compiled, globalsDict, globalsDict)
print(globalsDict["foo"])
```
Also CPython 2.6, 2.7, 3.0 and PyPy 1.5 crashes on this.
|
|||
| msg140874 - (view) | Author: Albert Zeyer (Albert.Zeyer) * | Date: 2011年07月22日 13:17 | |
PyPy bug report: https://bugs.pypy.org/issue806 |
|||
| msg140875 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年07月22日 13:24 | |
So does default. |
|||
| msg141733 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年08月07日 01:20 | |
Thanks for the test case Albert. The attached patch adds a unit test based off of the given repro case and fixes the bug in the FunctionDef compiler. The compiler was hitting a NULL pointer deref on FunctionDefs with empty list bodies. Reproduced and fixed on tip. Full test suite ran on Fedora 15; no regressions. |
|||
| msg141848 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2011年08月10日 01:14 | |
Officially fixed by #12575. |
|||
| msg141867 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年08月10日 15:23 | |
I have verified that the code checked in for issue12575 keep the test case from this issue from crashing the interpreter: [meadori@motherbrain cpython]$ ./python test.py Traceback (most recent call last): File "test.py", line 14, in <module> compiled = compile(exprAst, "<foo>", "single") ValueError: empty body on FunctionDef Do we have any intent on fixing this crasher for 3.2 and 2.7? |
|||
| msg141869 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2011年08月10日 15:30 | |
2011年8月10日 Meador Inge <report@bugs.python.org>: > > Meador Inge <meadori@gmail.com> added the comment: > > I have verified that the code checked in for issue12575 keep the test case from this issue from crashing the interpreter: > > [meadori@motherbrain cpython]$ ./python test.py > Traceback (most recent call last): > File "test.py", line 14, in <module> > compiled = compile(exprAst, "<foo>", "single") > ValueError: empty body on FunctionDef > > Do we have any intent on fixing this crasher for 3.2 and 2.7? Probably not. Everything is rather broken before 3.3 now. |
|||
| msg141882 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年08月10日 19:59 | |
OK, I am marking this as fixed then. If someone decides to fix this in 3.2 or 3.7, then they can reopen the issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:20 | admin | set | github: 56817 |
| 2011年08月10日 19:59:05 | meador.inge | set | status: open -> closed resolution: fixed messages: + msg141882 stage: patch review -> resolved |
| 2011年08月10日 15:30:06 | benjamin.peterson | set | messages: + msg141869 |
| 2011年08月10日 15:23:10 | meador.inge | set | messages: + msg141867 |
| 2011年08月10日 01:14:09 | benjamin.peterson | set | messages: + msg141848 |
| 2011年08月07日 01:20:23 | meador.inge | set | files:
+ issue12608.patch nosy: + meador.inge messages: + msg141733 keywords: + patch stage: patch review |
| 2011年07月23日 12:05:40 | benjamin.peterson | set | dependencies: + add a AST validator |
| 2011年07月22日 22:17:20 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2011年07月22日 17:32:46 | daniel.urban | set | nosy:
+ daniel.urban |
| 2011年07月22日 13:24:30 | r.david.murray | set | versions:
+ Python 2.7, Python 3.3 nosy: + r.david.murray, benjamin.peterson messages: + msg140875 type: crash |
| 2011年07月22日 13:17:45 | Albert.Zeyer | set | messages: + msg140874 |
| 2011年07月22日 13:13:26 | Albert.Zeyer | create | |