apache / rocketmq-client-cpp

Apache RocketMQ cpp client
https://rocketmq.apache.org/
Apache License 2.0
366 stars 159 forks source link

heap-use-after-free risk caused by direct deconstruction in factory manager test. #277

Closed ShannonDing closed 4 years ago

ShannonDing commented 4 years ago
  1. Please tell us about your environment:

    • What is your OS? centos7.2
    • What is your client version? 2.0.1
    • What is your RocketMQ version? 4.6.0
  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
    • The ASAN Report [==========]Running 2 tests from 1 test case. [----------]Global test environment set-up. [----------]2 tests from MQClientManagerTest [ RUN ]MQClientManagerTest.getClientFactory

      ==124436==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110000096f8 at pc 0x7efe51699cba bp 0x7efe4bdfac20 sp 0x7efe4bdfac18 WRITE of size 8 at 0x6110000096f8 thread T4 (RemotingAsioT) [ OK ] MQClientManagerTest.getClientFactory (14 ms) [ RUN ] MQClientManagerTest.removeClientFactory [ OK ] MQClientManagerTest.removeClientFactory (0 ms) [----------] 2 tests from MQClientManagerTest (14 ms total) [----------] Global test environment tear-down [==========] 2 tests from 1 test case ran. (14 ms total) [ PASSED ] 2 tests.