apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.52k stars 751 forks source link

Some `unsafe` code in arrow is seemingly unsound or not very well documented. #6020

Open veluca93 opened 3 months ago

veluca93 commented 3 months ago

Hi all, while going through the code in arrow, I spotted a few places in which the usage of unsafe code is unsound, and a few in which I could not determine whether it was or not.

I do not believe that the issues I found could cause problems today, but I prepared a PR nonetheless that fixes the unsound cases I could find, improves documentation in the cases in which I could figure out why the code is indeed sound, and leaves a FIXME comment for the remaining cases that were beyond my ability to figure out :-)

I hope this helps!

alamb commented 3 months ago

Thank you @veluca93

tustvold commented 3 months ago

Thank you for this, I've changed this to be labeled as an enhancement as I don't believe there is unsoundness in user-facing APIs and I'd like to avoid causing undue wailing and gnashing of teeth. Please do correct me if I have misunderstood

As an aside thank you for adopting a constructive tone, its unfortunately not a given when it comes to areas such as this