c/driver_manager: Python bindings can segfault if AdbcDatabaseInit()
errors
#2264
Labels
Type: bug
Something isn't working
Milestone
What happened?
When testing the framework driver in #2186, the driver manager segfaulted when the database init errored. The segfault happened here:
arrow-adbc/c/driver_manager/adbc_driver_manager.cc
Line 670 in 5248c34
...because the function pointer for the error detail was
nullptr
.I think this is because the driver had been released on a call to
SetOption()
:arrow-adbc/c/driver_manager/adbc_driver_manager.cc
Line 956 in 5248c34
I am wondering if we hadn't seen this because typically database options are checked when the connection is initialized (or because drivers weren't zeroing the function pointers on release until using the framework).
An easy stopgap would be to also check that
error->private_driver->ErrorGetDetail != nullptr
here:arrow-adbc/c/driver_manager/adbc_driver_manager.cc
Lines 667 to 673 in 5248c34
..or to zero out the
error->private_driver
after releasing the driver.Stack Trace
No response
How can we reproduce the bug?
No response
Environment/Setup
No response
The text was updated successfully, but these errors were encountered: