pitrou opened a new pull request, #48742:
URL: https://github.com/apache/arrow/pull/48742

   ### Rationale for this change
   
   When reading a CSV file encounters an early error, and the 
`AsyncThreadedTableReader` is only kept alive through the chain of futures and 
their callbacks, the `~AsyncThreadedTableReader` destructor will be executed at 
the end of a `TaskGroup` task and try to wait for the `TaskGroup` itself for 
finish. This will obviously deadlock.
   
   This issue was discovered by OSS-Fuzz in 
https://issues.oss-fuzz.com/issues/467451924
   
   ### What changes are included in this PR?
   
   Instead of waiting for the `TaskGroup` to finish in the 
`AsyncThreadedTableReader`, make sure that all async callbacks involved in CSV 
reading own their captured variables, to avoid use-after-free problems.
   
   This has the side effect of keeping the `AsyncThreadedTableReader` alive 
until all relevant async callbacks have executed.
   
   ### Are these changes tested?
   
   Yes, by existing tests and a new fuzz regression test.
   
   ### Are there any user-facing changes?
   
   No.


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