Open yihong0618 opened 1 year ago
after some search the root cause seems from PyObject_Repr(PyDict_GetItem(locals, name));
the repr and getattar caused the recursive.
but I am not sure it needs fix on viztracer
or pytorch
side.
@gaogaotiantian
It seems like using getattr on that object will cause infinite recursion? If this could be reproduced without viztracer, maybe it’s not a viztracer issue. Is there a note in torch for this? That users should not do it?
not exactly I did some search and no relate issues on pytorch.
but in cpython I found this one https://github.com/python/cpython/issues/86075 similar but not the same thing.
I will try use bare sys.settrace
to test later
os: ubuntu20.04 and MacOS m1 both test
cat foo.py
run this command the
viztracer
will hanguse py-spy to check the stack will see as follows:
seems loop in getattr (torch/_ops.py:480)