wudisheng opened a new issue, #1932: URL: https://github.com/apache/incubator-brpc/issues/1932
**Describe the bug (描述bug)** [`MallocExtension`](https://github.com/apache/incubator-brpc/blob/dfe659ba364ab2ff59f94c70418d429904f2194f/src/brpc/details/tcmalloc_extension.h#L72) declaration in `brpc/details/tcmalloc_extension.h` is a (potentially mismatching) copy of `malloc_extension.h` provided by `google-perftools` package. I understand that BRPC **intentially** left it there with no virtual methods defined, hoping provided by linking `libtcmalloc.so` provided by `google-perftools` package. Otherwise (_i.e._ when linking `jemalloc` or using default implementation), `MallocExtension` has no key function. We can call it _WAI_ in most scenarios, but when not linking `tcmalloc` and in UBSAN build, a linking failure regarding `undefined reference to 'typeinfo for MallocExtension'` persists. Moreover, the modern `tcmalloc` (greatly different from the one provided by `google-perftools` package) has a totally different definition of `MallocExtension`, so evening linking _this_ `tcmalloc` won't help. I know that we can workaround this issue by `fno-sanitize=vptr`, but since `MallocExtension` is the **only** problematic type blocking linking, I would consider it's not worth the regression. **To Reproduce (复现方法)** Build a binary depending on `brpc` in UBSAN mode. **Expected behavior (期望行为)** Successful UBSAN build. **Versions (各种版本)** OS: Ubuntu 22.04 Compiler: Clang 12.0.1 brpc: 1.2.0 protobuf: 21.1 **Additional context/screenshots (更多上下文/截图)** Pending. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
