Files
apache--tvm/python/tvm/_ffi
Andrew Reusch 929717a03a Fix stack overflow when partially-__init__ Node raises exception. (#7481)
* Fix stack overflow when partially-__init__ Node raises exception.

 * If a Node subclass raises an exception and ctypes is in use before
   __init_handle_by_constructor__ is called (or self.handle is
   otherwise set), a Python stack overflow could result. This is
   because the unset handle slot causes self.handle accesses to
   fallback on the getattr(self, 'handle') method, invoking
   NodeGetAttr.
 * Then I believe this causes an infinite loop.
 * The fix is to make Node.__getattr__ raise AttributeError for all
   attributes in __slots__, then make __del__ tolerant to missing
   self.handle.
 * I don't believe cython is affected because it implements a
   descriptor to access its underlying chandle and that shouldn't be unset.

* black format

* actually use handle instead of self.handle
2021-02-23 18:29:07 -05:00
..
2020-02-04 17:01:01 -08:00