新增/删除 vhost 配置后调用 /api/v1/raw?rpc=reload 出现空指针异常
Closed this issue · 0 comments
!!! Before submitting a new bug report, make sure you have asked the AI about your issue, because we have setup the project with docs for AI, so AI know everything including questions, usage, bugs, features, workflows, etc.
Describe the bug
A clear and concise description of what the bug is.
Version
Desribe your SRS Server version here.
7.0.95
To Reproduce
Steps to reproduce the behavior:
- 正常启动srs服务
- 更新srs.conf 配置文件, 新增配置如下
vhost one_week {
enabled on;
hls {
enabled on;
hls_fragment 60;
hls_window 604800;
hls_path ./objs/nginx/html;
hls_m3u8_file [vhost]/[app]/[stream]/data.srs.m3u8;
hls_ts_file [vhost]/[app]/[stream]/data/[timestamp].ts;
hls_dispose 0;
hls_ctx off;
hls_ts_ctx off;
}
} - 使用 ./etc/init.d/srs reload 或者调用 /api/v1/raw?rpc=reload
- 出现如下异常
Expected behavior
能够正常重启并且重新reload配置
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
SRS: cpu=3.00%,525MB, cid=3,1, timer=62,0,0, clock=0,44,4,0,0,0,1,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:279,oth:0,buf:0)
[2025-10-16 10:00:04.256][INFO][53388][2k5487y3] starting reload config.
[2025-10-16 10:00:04.256][INFO][53388][2k5487y3] config parse complete
[2025-10-16 10:00:04.256][INFO][53388][2k5487y3] srs checking config...
[2025-10-16 10:00:04.257][WARN][53388][2k5487y3][11] stats network use index=0, ip=172.20.0.2, ifname=eth0
[2025-10-16 10:00:04.257][WARN][53388][2k5487y3][11] stats disk not configed, disk iops disabled.
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] you can check log by: tail -n 30 -f ./objs/srs.log
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] please check SRS by: ./etc/init.d/srs status
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] reload vhost defaultVhost
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] reload vhost one_day
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] reload vhost three_hours
[2025-10-16 10:00:04.257][INFO][53388][2k5487y3] reload vhost one_week
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] =================================================================
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] ==53388==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x56191ceb8664 bp 0x7ffd06871080 sp 0x7ffd06870b80 T0)
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] ==53388==The signal is caused by a READ memory access.
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] ==53388==Hint: address points to the zero page.
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] #0 0x56191ceb8664 in SrsConfig::reload_conf(SrsConfig*) src/app/srs_app_config.cpp:1513, r0=1093
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] #1 0x56191ceb766a in SrsConfig::reload(SrsReloadState*) src/app/srs_app_config.cpp:1464, r0=1093
[2025-10-16 10:00:04.318][ERROR][53388][2k5487y3][0] #2 0x56191cdf469a in SrsServer::do2_cycle() src/app/srs_app_server.cpp:1034, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #3 0x56191cdf4df8 in SrsServer::do_cycle() src/app/srs_app_server.cpp:1070, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #4 0x56191cdf34ea in SrsServer::cycle() src/app/srs_app_server.cpp:916, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #5 0x56191cdeadf8 in SrsServer::run() src/app/srs_app_server.cpp:548, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #6 0x56191d210b5f in run_srs_server() src/main/srs_main_server.cpp:470, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #7 0x56191d210878 in run_directly_or_daemon() src/main/srs_main_server.cpp:443, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #8 0x56191d20dbba in do_main(int, char**, char**) src/main/srs_main_server.cpp:229, r0=1093
[2025-10-16 10:00:04.319][ERROR][53388][2k5487y3][0] #9 0x56191d20df78 in main src/main/srs_main_server.cpp:245, r0=1093
[2025-10-16 10:00:04.380][ERROR][53388][2k5487y3][0] #10 0x7f896d230d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f), 0x00000
[2025-10-16 10:00:04.412][ERROR][53388][2k5487y3][0] #11 0x7f896d230e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f), 0x00000
[2025-10-16 10:00:04.443][ERROR][53388][2k5487y3][0] #12 0x56191ca50854 in _start (/home/srs/trunk/objs/srs+0x401854), 0x00000
[2025-10-16 10:00:04.443][ERROR][53388][2k5487y3][0] AddressSanitizer can not provide additional info.
[2025-10-16 10:00:04.443][ERROR][53388][2k5487y3][0] SUMMARY: AddressSanitizer: SEGV src/app/srs_app_config.cpp:1513 in SrsConfig::reload_conf(SrsConfig*)