New issue 2868: Segfault with `*args` type annotation in inner function

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):


$ 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/
Fatal Python error: Segmentation fault

Stack (most recent call first, approximate line numbers):
  File "/tmp/", line 1 in f1
  File "/tmp/", line 1 in <module>
  File "<builtin>/", line 541 in exec_
  File "<builtin>/", line 769 in execfile
  File "<builtin>/", line 84 in run_toplevel
  File "<builtin>/", line 545 in run_command_line
  File "<builtin>/", 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).

pypy-issue mailing list

Reply via email to