troubleshooting pytype hangs/dict-of-lists
Thanks for pytype! I'm a big fan. :)
With the most recent release (2022.10.13), I've found a pytype hang (pytype consumes 100% CPU and never exists) that is new since the last release. I don't have a minimal reproduction case yet, but I was able to workaround it - code that periodically reinitializes a dict as x = {"a": [], "b": [], ...} causes pytype to hang, but changing to for i in ("a", "b"...): x[i] = [] runs fine.
I'll update this issue if I can come up with a compact way to reproduce this problem, but, are there any hints on how to troubleshoot a pytype hang like this? Also, is it possible to have ninja timeout, so pytype doesn't hang when run under CI?
Thanks,
if you have a repro without any imports other than stdlib, you can try running with pytype-single -v 4 file.py, to run pytype in verbose mode and show you the opcode at which it hangs. (it's slightly more complicated if you have imports because you then need to find the exact command line that ninja generates and run that)