nleerollergh commented on PR #55168:
URL: https://github.com/apache/arrow/pull/55168#issuecomment-6378134560

   **Why the call crashes**
   
   In Cython, a parameter declared as Statistics other is checked to be a 
Statistics instance, but None is also allowed through unless you write not 
None. None is not a Statistics, so it has no .statistics attribute set up. 
Cython reads that attribute as a raw C++ field. The method body then runs 
deref(other.statistics.get()), and with other as None that reads garbage memory 
or a null pointer. Plain Python would raise AttributeError here. Cython does a 
direct struct access instead, so the process segfaults.
   
   **Why `not None` fixes it**
   
   With `other not None`, Cython adds a check at the very start of the call. If 
other is None, it raises TypeError immediately. That happens before the method 
body, so the dereference never runs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to