[pypy-issue] Issue #2868: Segfault with `*args` type annotation in inner function (pypy/pypy)

Ben Darnell issues-reply at bitbucket.org
Sat Aug 11 13:16:22 EDT 2018


New issue 2868: Segfault with `*args` type annotation in inner function
https://bitbucket.org/pypy/pypy/issues/2868/segfault-with-args-type-annotation-in

Ben Darnell:

Running the following code in pypy3 (6.0.0 on mac, similar crashes have been seen on older versions of pypy3 running on linux) will segfault:

```
def f1():
    def f2(*args: int):
        pass

f1()
```

```
$ pypy3 --version
Python 3.5.3 (fdd60ed87e941677e8ea11acf9f1819466521bf2, Jul 30 2018, 08:59:51)
[PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
$ pypy3 -X faulthandler /tmp/test.py
Fatal Python error: Segmentation fault

Stack (most recent call first, approximate line numbers):
  File "/tmp/test.py", line 1 in f1
  File "/tmp/test.py", line 1 in <module>
  File "<builtin>/app_main.py", line 541 in exec_
  File "<builtin>/app_main.py", line 769 in execfile
  File "<builtin>/app_main.py", line 84 in run_toplevel
  File "<builtin>/app_main.py", line 545 in run_command_line
  File "<builtin>/app_main.py", line 840 in entry_point
Segmentation fault: 11
```

This example was reduced from a source file defining a decorator. The bug appears to require a type annotation on a `*args` or `**kwargs` parameter (not an ordinary parameter) in a function defined within the local scope of another function (top level functions and class methods are not affected).




More information about the pypy-issue mailing list