pitrou commented on issue #46863:
URL: https://github.com/apache/arrow/issues/46863#issuecomment-2999198620
Let's see... `ClientWithAsyncTemplateMethods` is a CRTP class, and
`Aws::S3::S3Client` derives from
`ClientWithAsyncTemplateMethods<Aws::S3::S3Client>`.
The `ClientWithAsyncTemplateMethods` constructor looks like this:
```c++
ClientWithAsyncTemplateMethods()
: m_isInitialized(true),
m_operationsProcessed(0)
{
AwsServiceClientT* pThis = static_cast<AwsServiceClientT*>(this);
Aws::Utils::ComponentRegistry::RegisterComponent(AwsServiceClientT::GetServiceName(),
pThis,
&AwsServiceClientT::ShutdownSdkClient);
}
```
where `AwsServiceClientT` is actually `Aws::S3::S3Client`.
I think ASan/UBSan checks that `static_cast<Aws::S3::S3Client*>(this)` is
well-defined by checking the concrete type of `this`. Unfortunately, we're in
the base class constructor, and the derived part of `this` is not fully
constructed yet, so ASan/UBSan thinks the cast is invalid.
The `static_cast` is probably harmless anyway if the pointer is only stored
by `RegisterComponent` for later use, but we must find a way to silence the
ASan/UBSan failure.
@bkietz Do you think this analysis is correct?
--
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]