BusyJay opened a new issue, #3302:
URL: https://github.com/apache/brpc/issues/3302

   **Describe the bug**
   Tracer caught signal 11: addr=0x7f57067db000 pc=0x7f572d0c3010 
sp=0x7f5721313d10
   ==140089==LeakSanitizer has encountered a fatal error.
   ==140089==HINT: For debugging, try setting environment variable 
LSAN_OPTIONS=verbosity=1:log_threads=1
   ==140089==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
   
   
   **To Reproduce**
   None yet.
   
   **Expected behavior**
   It works.
   
   **Versions**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots**
   
   Analysis from AI:
   ```
   ## 根因
   
   新版 brpc 在 `BUTIL_USE_ASAN` 路径下,对每段 bthread 协程栈(small/normal/large,1MB ~ 
8MB)调用 `__asan_poison_memory_region`,把整段栈在 ASan shadow memory 里标为 unaddressable:
   
   ```cpp
   BUTIL_FORCE_INLINE void ASanPoisonMemoryRegion(const StackStorage& storage) {
       if (NULL == storage.bottom) return;
       BUTIL_ASAN_POISON_MEMORY_REGION(
           (char*)storage.bottom - storage.stacksize, storage.stacksize);
   }
   ```
   
   调用点:
   
   - `stack_inl.h:136` — Wrapper 构造时 poison
   - `stack_inl.h:158` — `return_stack` 把协程栈归还 ObjectPool 时 poison
   
   每个 worker pthread 持有数十段协程栈,进程内累积 GB 级 poisoned mmap 区域。
   
   进程退出时触发链路:
   
   ```
   __cxa_finalize
     → __lsan::DoLeakCheck()
       → StopTheWorld
         → ListThreads (getdents /proc/<pid>/task)
         → GetThreadRangesLocked (读 AsanThread 的 stack/TLS 范围)
         → ScanRangeForPointers (扫描每个线程栈作为 root set)
           → 触碰被 brpc poison 的协程栈区域
             → ASan shadow check 内部异常
               → SIGSEGV
                 → mysqld abnormal exit
                   → shutdown_report fail
   ```


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

Reply via email to