zanmato1984 commented on issue #41407:
URL: https://github.com/apache/arrow/issues/41407#issuecomment-2081421263

   Thank you for reporting and locating the issue. I confirm that it is 
introduced by my PR #40237.
   
   The cause is that we are down-casting a CRTP base class's `this` to the 
derived class in base class's constructor. UBSAN's "vptr" checking treats it as 
an UB. I'm not entirely sure if this is true-positive, since I don't find a 
clear statement about this case in C++ standard (I'm not a language lawyer so 
maybe there is, I appreciate if someone can point it to me).
   
   If we consider it a false-positive, then we can simply add a suppression in 
[1]. Otherwise I can make the `FillScratchSpace` method static to avoid this 
down-casting, which should have no performance impact, nor extra complexity.
   
   What do you think? @bkietz 
   
   [1] https://github.com/apache/arrow/blob/main/r/tools/ubsan.supp


-- 
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