Files
Bright Chen 08d95ac3b1 Fix ASan stack range registration for main task (#3298)
On Linux, `pthread_attr_getstack(3)` returns the lowest address of the
stack, but brpc treats `StackStorage::bottom` as the highest address
(see `bthread/stack.h`). `TaskGroup::init` was registering the main
task's stack with the lowest address as `bottom`, so every per-jump
`BTHREAD_SCOPED_ASAN_FIBER_SWITCHER` told ASan a stack range
`stacksize` bytes below the real one. The first
`__asan_handle_no_return` (e.g. the C++ unwinder fired by
`throw bthread::ExitException` inside `bthread_exit`) then prints

  WARNING: ASan is ignoring requested __asan_handle_no_return:
    stack type: default top: ...; bottom ...; size: 0x62bdb000 (~1.5 GiB)
  False positive error reports may follow

Fix `PthreadAttrGetStack` to translate the lowest address to the
highest address before returning, matching `StackStorage::bottom`.
ASan-only path; non-ASan builds are unaffected.
2026-05-17 17:07:37 +08:00
..
2019-10-25 18:01:21 +08:00