1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Asan: Refine asan warning message for macOS.

PICK 7bdb7270cf
This commit is contained in:
winlin 2022-12-31 19:27:21 +08:00
parent 3f7c4a7ff4
commit 6ad7787c14
4 changed files with 15 additions and 1 deletions

View file

@ -96,6 +96,13 @@ srs_error_t do_main(int argc, char** argv, char** envp)
// TODO: Might fail if change working directory.
_srs_binary = argv[0];
// For sanitizer on macOS, to avoid the warning on startup.
#if defined(SRS_OSX) && defined(SRS_SANITIZER)
if (!getenv("MallocNanoZone")) {
fprintf(stderr, "Asan: Please setup the env MallocNanoZone=0 to disable the warning, see https://stackoverflow.com/a/70209891/17679565\n");
}
#endif
// Initialize global and thread-local variables.
if ((err = srs_global_initialize()) != srs_success) {
return srs_error_wrap(err, "global init");