1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00
srs/trunk/research
Winlin 8f48a0e2d1
ASAN: Support coroutine context switching and stack tracing (#4153)
For coroutine, we should use `__sanitizer_start_switch_fiber` which
similar to`VALGRIND_STACK_REGISTER`, see
https://github.com/google/sanitizers/issues/189#issuecomment-1346243598
for details. If not fix this, asan will output warning:

```
==72269==WARNING: ASan is ignoring requested __asan_handle_no_return: stack type: default top: 0x00016f638000; bottom 0x000106bec000; size: 0x000068a4c000 (1755627520)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
```

It will cause asan failed to get the stack, see
`research/st/asan-switch.cpp` for example:

```
==71611==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x000103600733 at pc 0x0001009d3d7c bp 0x000100b4bd40 sp 0x000100b4bd38
WRITE of size 1 at 0x000103600733 thread T0
    #0 0x1009d3d78 in foo(void*) asan-switch.cpp:13
```

After fix this issue, it should provide the full stack when crashing:

```
==73437==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x000103300733 at pc 0x000100693d7c bp 0x00016f76f550 sp 0x00016f76f548
WRITE of size 1 at 0x000103300733 thread T0
    #0 0x100693d78 in foo(void*) asan-switch.cpp:13
    #1 0x100693df4 in main asan-switch.cpp:23
    #2 0x195aa20dc  (<unknown module>)
```

For primordial coroutine, if not set the stack by
`st_set_primordial_stack`, then the stack is NULL and asan can't get the
stack tracing. Note that it's optional and only make it fail to display
the stack information, no other errors.

---

Co-authored-by: john <hondaxiao@tencent.com>
2024-08-22 17:12:39 +08:00
..
api-server Upgrade hls.js and set in low latency mode. v6.0.112 (#3924) 2024-02-05 21:37:29 +08:00
apm APM: Extract research to projects. 2022-09-19 13:30:22 +08:00
arm Merge 4.0release, migrate to new website. 2022-07-31 18:34:18 +08:00
code-statistic SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3 2021-05-31 13:42:20 +08:00
console Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
ffempty SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3 2021-05-31 13:42:20 +08:00
frame Update 2021-03-06 10:46:07 +08:00
golang refine srs player to play hls. 2016-03-19 19:11:31 +08:00
gperftools Squash: Fix bugs 2021-12-26 17:30:51 +08:00
hls SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3 2021-05-31 13:42:20 +08:00
msg_zerocopy ST: Simplify it, only Linux/Darwin, epoll/kqueue, single process. 5.0.2 2021-05-19 18:25:49 +08:00
players Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
python-subprocess finish the research for python-subprocess 2014-06-11 11:14:43 +08:00
srt-proxy A demo for SRT proxy. (#3869) 2023-12-30 08:55:01 +08:00
st ASAN: Support coroutine context switching and stack tracing (#4153) 2024-08-22 17:12:39 +08:00
thread-model Research: Add udp connect 2021-02-05 11:07:53 +08:00
wireshark GB28181: Support GB28181-2016 protocol. v5.0.74 (#3201) 2022-10-06 17:40:58 +08:00
favicon.ico Upgrade hls.js and set in low latency mode. v6.0.112 (#3924) 2024-02-05 21:37:29 +08:00
index.html Upgrade hls.js and set in low latency mode. v6.0.112 (#3924) 2024-02-05 21:37:29 +08:00