New submission from Nick Drozd <>:

In certain very, very specific circumstances, Pylint can cause the interpreter 
to abort with a stack overflow error.

I've seen this issue on 3.5, 3.6, and 3.8 (I assume it affects 3.7 as well) and 
on both Mac and Ubuntu.

It requires:
  * 1.7 <= Pylint version < 1.9
  * 1.6.0 <= Astroid version < 1.6.2
    - (For interpreter versions > 3.6, commit
 is also required.)
  * The dependencies of Pylint and Astroid (I'm not aware of any specific 
versions needed.)

The crash comes from running Pylint on the file 
 This causes the interpreter to abort with the message "Fatal Python error: 
Cannot recover from stack overflow."

Now, it's not surprising that some kind of stack depth error occurs here, as 
the target code is recursive, Pylint is recursive, and and Astroid 1.6.0 had a 
bug in its handling of augmented assign statements (this bug was fixed in 1.6.2 
with a one-line change:
 But this recursion bug should be handled with a RecursionError instead of an 

What's strange is that running Pylint on the file 
 which differs from in just three characters, does end 
up with a RecursionError (neither file is large at all). So it looks like 
something subtle is happening here. I tried looking around to see if I could 
figure it out, and I could not. All I was able to discover is that changing 50 
to other numbers in _Py_CheckRecursiveCall causes the error to come from 
different places: at the beginning of the eval loop, "while calling a Python 
object" at several points, and "in comparison".

I've included the text of a shell session showing the errors.

Repo links to versions of Pylint and Astroid that cause the error:

See for further discussion.

components: Interpreter Core
files: shell-session
messages: 322328
nosy: nickdrozd
priority: normal
severity: normal
status: open
title: Pylint recusion stack overflow abort
type: crash
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to