traversc opened a new issue, #51198:
URL: https://github.com/apache/arrow/issues/51198

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `arrow::array_string_vector` `Elt()` method returns a newly created 
`CHARSXP` without keeping it reachable from the source vector, leading to a 
crash/segfault. Here is a short minimal reproducer: 
https://gist.github.com/traversc/a5204821451198d457edc38cceda9d90
   
   This is the same class of bug as in vroom 
https://github.com/tidyverse/vroom/pull/638. vroom's fix is to cache
   accessed strings on the external pointer's protected slot and reuse that 
cache on materialize.
   
   I understand when ALTREP became available, it was understood that CHARSXPs 
did not need to be rooted. But that was never correct and was a latent bug for 
many years. See here for more details: 
https://bugs.r-project.org/show_bug.cgi?id=19135
   
   ### Component(s)
   
   R


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