ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.47k stars 5.35k forks source link

Asan: CentOS7 daemon start SRS failed. #3757

Closed winlinvip closed 6 months ago

winlinvip commented 1 year ago

CentOS 7:

(LSAN_OPTIONS=verbosity=1:log_threads=1 SRS_DAEMON=on \
SRS_DISABLE_DAEMON_FOR_DOCKER=off ./objs/srs -c conf/srs.conf; \
echo "SRS exit with $?") &&
ps aux|grep srs
==10==AddressSanitizer: libc interceptors initialized
|| `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
|| `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
|| `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||
|| `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
|| `[0x000000000000, 0x00007fff7fff]` || LowMem     ||
MemToShadow(shadow): 0x00008fff7000 0x000091ff6dff 0x004091ff6e00 0x02008fff6fff
redzone=16
max_redzone=2048
quarantine_size_mb=256M
thread_local_quarantine_size_kb=1024K
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 0x7fff8000
==10==Installed the sigaction for signal 11
==10==Installed the sigaction for signal 7
==10==Installed the sigaction for signal 8
==10==T0: stack [0x7ffc218a0000,0x7ffc220a0000) size 0x800000; local=0x7ffc2209efe4
==10==AddressSanitizer Init done
==10==unpoisoning: 0x7ffc2209e660 400
[2023-08-07 03:28:23.643][INFO][10][6u31d889] XCORE-SRS/5.0.170(Bee)
[2023-08-07 03:28:23.643][INFO][10][6u31d889] config parse complete
[2023-08-07 03:28:23.643][INFO][10][6u31d889] write log to console
[2023-08-07 03:28:23.643][INFO][10][6u31d889] SRS/5.0.170(Bee), MIT
[2023-08-07 03:28:23.643][INFO][10][6u31d889] authors: Winlin<winlin@vip.126.com> ZhaoWenjie<zhaowenjie@tal.com> ShiWei<shiwei05@kuaishou.com> XiaoZhihong<hondaxiao@tencent.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> XiaLixin<xialixin@kanzhun.com> LiPeng<mozhan.lp@alibaba-inc.com> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenHaibo<nmgchenhaibo@foxmail.com> and https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors
[2023-08-07 03:28:23.643][INFO][10][6u31d889] cwd=/usr/local/srs, work_dir=./, build: 2023-08-02 03:19:17, configure: --gb28181=on, uname: Linux buildkitsandbox 5.15.0-1041-azure #48~20.04.1-Ubuntu SMP Wed Jun 21 15:03:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux, osx: 0, env: 1, pkg: dcis
[2023-08-07 03:28:23.643][INFO][10][6u31d889] configure detail: --prefix=/usr/local/srs --config=conf/srs.conf --osx=off --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-converter=on --http-api=on --utest=off --srt=on --rtc=on --gb28181=on --simulator=off --cxx11=on --cxx14=off --backtrace=on --ffmpeg-fit=on --ffmpeg-opus=off --nasm=on --srtp-nasm=on --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=off --shared-ffmpeg=off --log-verbose=off --log-info=off --log-trace=on --log-level_v2=on --gcov=off --apm=off --debug=off --debug-stats=off --cross-build=off --sanitizer=on --sanitizer-static=off --sanitizer-log=off --cygwin64=off --single-thread=off --generic-linux=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
==10==unpoisoning: 0x7ffc2209ecc0 188
==10==poisoning: 0x7ffc2209ecc0 188
[2023-08-07 03:28:23.643][INFO][10][6u31d889] srs checking config...
[2023-08-07 03:28:23.644][INFO][10][6u31d889] ips, iface[0] eth0 ipv4 0x11043 172.17.0.11
[2023-08-07 03:28:23.644][INFO][10][6u31d889] devices, intranet eth0 172.17.0.11
[2023-08-07 03:28:23.644][WARN][10][6u31d889][2] stats network use index=0, ip=172.17.0.11, ifname=eth0
[2023-08-07 03:28:23.644][WARN][10][6u31d889][2] stats disk not configed, disk iops disabled.
[2023-08-07 03:28:23.644][INFO][10][6u31d889] write log to console
[2023-08-07 03:28:23.644][INFO][10][6u31d889] features, rch:on, dash:on, hls:on, hds:off, srt:on, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on
==10==poisoning: 0x7ffc2209e3a0 188
==10==unpoisoning: 0x7ffc2209e570 188
[2023-08-07 03:28:23.644][INFO][10][6u31d889] SRS on amd64 x86_64, conf:conf/srs.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
==10==poisoning: 0x7ffc2209e570 188
==10==unpoisoning: 0x7ffc2209e740 188
[2023-08-07 03:28:23.644][INFO][10][6u31d889] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
==10==poisoning: 0x7ffc2209e740 188
==10==unpoisoning: 0x7ffc2209e910 188
[2023-08-07 03:28:23.644][INFO][10][6u31d889] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
==10==poisoning: 0x7ffc2209e910 188
[2023-08-07 03:28:23.644][INFO][10][6u31d889] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
[2023-08-07 03:28:23.644][INFO][10][6u31d889] start daemon mode...
[2023-08-07 03:28:23.645][INFO][11][6u31d889] father process exit
[2023-08-07 03:28:23.645][INFO][12][6u31d889] son(daemon) process running.
[2023-08-07 03:28:23.646][INFO][12][6u31d889] write pid=12 to ./objs/srs.pid success!
[2023-08-07 03:28:23.646][INFO][12][6u31d889] Thread #1(primordial): init name=srs-master-1, interval=5000ms
==13==Could not attach to thread 11 (errno 1).
==13==Failed suspending threads.
==11==LeakSanitizer has encountered a fatal error.
==11==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==11==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
==12==T1: stack [0x7f046ab68000,0x7f046b366d40) size 0x7fed40; local=0x7f046b366c44
[2023-08-07 03:28:23.647][INFO][12][t7p33u8c] Thread #2: run with tid=14, entry=0x60c000000280, label=hybrid, name=srs-hybrid-2
[2023-08-07 03:28:23.650][INFO][10][6u31d889] grandpa process exit.
[2023-08-07 03:28:23.656][INFO][12][t7p33u8c] fingerprint=9E:27:D4:D2:52:F6:3C:DB:D0:B5:9B:3E:04:33:07:54:31:6D:B0:4D:70:20:4A:DF:4E:34:C6:BD:AD:29:12:37
==15==Could not attach to thread 10 (errno 1).
==15==Failed suspending threads.
[2023-08-07 03:28:23.656][INFO][12][t7p33u8c] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
==10==LeakSanitizer has encountered a fatal error.
==10==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==10==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
[2023-08-07 03:28:23.656][INFO][12][t7p33u8c] http flv live stream, vhost=__defaultVhost__, mount=[vhost]/[app]/[stream].flv
[2023-08-07 03:28:23.656][INFO][12][t7p33u8c] http: root mount to ./objs/nginx/html
[2023-08-07 03:28:23.656][INFO][12][t7p33u8c] server main cid=t7p33u8c, pid=12, ppid=1, asprocess=0
[2023-08-07 03:28:23.657][INFO][12][t7p33u8c] RTMP listen at tcp://0.0.0.0:1935, fd=9
[2023-08-07 03:28:23.657][INFO][12][t7p33u8c] HTTP-API listen at tcp://0.0.0.0:1985, fd=10
[2023-08-07 03:28:23.657][INFO][12][t7p33u8c] HTTP-Server listen at tcp://0.0.0.0:8080, fd=11
[2023-08-07 03:28:23.657][INFO][12][t7p33u8c] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
[2023-08-07 03:28:23.657][INFO][12][t7p33u8c] http: api mount /console to ./objs/nginx/html/console

SRS exit with 1

[2023-08-07 03:28:23.658][INFO][12][6u31d889] Pool: Start threads primordial=1, hybrids=1 ok
[2023-08-07 03:28:23.658][INFO][12][t7p33u8c] rtc listen at udp://0.0.0.0:8000, fd=12
==12==unpoisoning: 0x7f046be53130 160
[2023-08-07 03:28:23.658][INFO][12][n6445zu7] Hybrid cpu=0.00%,23MB
[2023-08-07 03:28:23.659][WARN][12][6r3z0t0p][22] use private address as ip: 172.17.0.11, ifname=eth0
[2023-08-07 03:28:23.659][INFO][12][6r3z0t0p] Startup query id=vid-0124667, session=vid-3wo92y8, eip=172.17.0.11, wait=300s
[2023-08-07 03:28:23.659][INFO][12][ab66r621] TCP: connection manager run, conns=0
[2023-08-07 03:28:23.659][WARN][12][t7p33u8c][11] enable auto reload for docker
[2023-08-07 03:28:23.659][INFO][12][t7p33u8c] auto reload watching fd=13, watch=1, file=conf
[2023-08-07 03:28:23.659][INFO][12][2p58e166] GB: connection manager run, conns=0
[2023-08-07 03:28:23.659][INFO][12][2x7413l8] SRT: connection manager run, conns=0
[2023-08-07 03:28:23.659][INFO][12][7h663053] UDP #12 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=16777216, expect=10485760, actual=20971520, r0=0), SO_RCVBUF(default=16777216, expect=10485760, actual=20971520, r0=0)
[2023-08-07 03:28:23.659][INFO][12][21037200] RTC: connection manager run, conns=0
==12==unpoisoning: 0x7f0469faa3a0 1000

root        12  0.0  1.3 21474949636 25112 pts/0 Sl 03:28   0:00 ./objs/srs -c conf/srs.conf

SRS terminated with a status of 1 due to an ASAN failure, although it actually executed successfully:

==13==Could not attach to thread 11 (errno 1).
==13==Failed suspending threads.
==11==LeakSanitizer has encountered a fatal error.
==11==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==11==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

==15==Could not attach to thread 10 (errno 1).
==15==Failed suspending threads.
==10==LeakSanitizer has encountered a fatal error.

SRS exit with 1

root        12  0.0  1.3 21474949636 25112 pts/0 Sl 03:28   0:00 ./objs/srs -c conf/srs.conf
winlinvip commented 6 months ago

Disabled asan for CentOS 7, and also disabled it by default because it sometime cause crash occasionally, except utest.