Open zn123 opened 2 years ago
Coredump please upload attachments and binaries, or provide bt stack information.
TRANS_BY_GPT3
core_dump.zip @winlinvip Thank you
TRANS_BY_GPT3
Top
TRANS_BY_GPT3
Raspberry Pi 4 is also like this. Depressed. It should be caused by the streaming parameters of the client ffmpeg, -vcodec copy -acodec copy, which leads to the crash of SRS.
TRANS_BY_GPT3
Please provide the BT file. I don't have a Raspberry Pi environment, so I can't view it.
Please search on Baidu how to view the BT file for Core.
TRANS_BY_GPT3
Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/arm/armv6/strlen.S:26
26 ../sysdeps/arm/armv6/strlen.S: No such file or directory.
(gdb) bt
#0 strlen () at ../sysdeps/arm/armv6/strlen.S:26
#1 0x76c423f0 in __vfprintf_internal (s=0x76712650, s@entry=0x76c7b454 <__offtime+972>,
format=format@entry=0x50e900 "-> HLS time=%dms, sno=%d, ts=%s, dur=%dms, dva=%dp", ap=..., ap@entry=...,
mode_flags=mode_flags@entry=1987127320) at vfprintf-internal.c:1688
#2 0x76c5436c in __vsnprintf_internal (
string=0x75ffb1 "-> HLS time=10012876ms, sno=0, ts= increase, please open mix_correct.\nfps, 0.0s)\nels, 44100HZ)\napp]/[stream]-[seq].ts, aof=2.00, floor=0, clean=1, waitk=1, dispose=0ms, dts_directly=1\n--stat=on --http"...,
maxlen=<optimized out>, format=0x50e900 "-> HLS time=%dms, sno=%d, ts=%s, dur=%dms, dva=%dp", args=...,
mode_flags=mode_flags@entry=0) at vsnprintf.c:114
#3 0x76c543d0 in ___vsnprintf (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=...)
at vsnprintf.c:124
#4 0x0015a964 in SrsFileLog::trace (this=0x75ff60, tag=0x0, context_id=...,
fmt=0x50e900 "-> HLS time=%dms, sno=%d, ts=%s, dur=%dms, dva=%dp") at src/app/srs_app_log.cpp:134
#5 0x00147894 in SrsHls::hls_show_mux_log (this=0x92bbe0) at src/app/srs_app_hls.cpp:1358
#6 0x0014765c in SrsHls::on_video (this=0x92bbe0, shared_video=0x76712b28, format=0x92a658) at src/app/srs_app_hls.cpp:1342
#7 0x0012ef2c in SrsOriginHub::on_video (this=0x92aa60, shared_video=0x76712b28, is_sequence_header=false)
at src/app/srs_app_source.cpp:1065
#8 0x001360d8 in SrsLiveSource::on_video_imp (this=0x92bca8, msg=0x76712b28) at src/app/srs_app_source.cpp:2347
#9 0x00135c78 in SrsLiveSource::on_video (this=0x92bca8, shared_video=0x951418) at src/app/srs_app_source.cpp:2302
#10 0x00126aa4 in SrsRtmpConn::process_publish_message (this=0x7a9710, source=0x92bca8, msg=0x951418)
at src/app/srs_app_rtmp_conn.cpp:1064
#11 0x00126870 in SrsRtmpConn::handle_publish_message (this=0x7a9710, source=0x92bca8, msg=0x951418)
at src/app/srs_app_rtmp_conn.cpp:1036
#12 0x001d3934 in SrsPublishRecvThread::consume (this=0x9287a8, msg=0x951418) at src/app/srs_app_recv_thread.cpp:373
#13 0x001d2894 in SrsRecvThread::do_cycle (this=0x9287b8) at src/app/srs_app_recv_thread.cpp:131
#14 0x001d2698 in SrsRecvThread::cycle (this=0x9287b8) at src/app/srs_app_recv_thread.cpp:100
#15 0x00159f18 in SrsFastCoroutine::cycle (this=0x964538) at src/app/srs_app_st.cpp:272
#16 0x00159fb4 in SrsFastCoroutine::pfn (arg=0x964538) at src/app/srs_app_st.cpp:287
#17 0x0027b2e4 in _st_thread_main () at sched.c:363
#18 0x0027bda0 in st_thread_create (start=0x30, arg=0xf, joinable=2, stk_size=6) at sched.c:694
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
On the Raspberry Pi, when enabling the HLS configuration in SRS 4.0, the RTMP streaming client crashes after approximately 10 seconds. The following is the gdb backtrace information: When commenting out the HLS section in the configuration file, it runs normally. The normal configuration file is as follows:
lmp@lmp:~/srs/srs-server-4.0-r4/trunk $ cat conf/srs.conf
\# main config for srs.
\# @see full.conf for detail config.
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
vhost __defaultVhost__ {
\# hls {
\# enabled on;
\# }
}
TRANS_BY_GPT3
The bug is introduced by formarting log with string:
void SrsHls::hls_show_mux_log()
srs_trace("-> " SRS_CONSTS_LOG_HLS " time=%" PRId64 "ms, sno=%d, ts=%s, dur=%dms, dva=%dp",
pprint->age(), controller->sequence_no(), controller->ts_url().c_str(),
srsu2msi(controller->duration()), controller->deviation());
The only formating string is ts=%s
, so it should be the root cause.
I notice the FLV was requested, but user didn't enable it:
[2021-12-10 20:03:11.991][Trace][31203][d0916406] HTTP #0 192.168.3.205:54169 GET http://192.168.3.232:8080/live/livestream.flv, content-length=-1
[2021-12-10 20:03:11.991][Warn][31203][d0916406][2] http miss file=./objs/nginx/html/live/livestream.flv, pattern=/, upath=/live/livestream.flv
[2021-12-10 20:03:12.003][Trace][31203][d0916406] TCP: before dispose resource(HttpStream)(0x2a445b0), conns=2, zombies=0, ign=0, inz=0, ind=0
[2021-12-10 20:03:12.003][Warn][31203][d0916406][104] client disconnect peer. ret=1007
[2021-12-10 20:03:12.003][Trace][31203][84192ha6] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0
[2021-12-10 20:03:12.003][Trace][31203][d0916406] TCP: disposing #0 resource(HttpStream)(0x2a445b0), conns=2, disposing=1, zombies=0
Segmentation fault
May be caused by this problem, need to reproduce it.
Description When configuring HLS parameters and streaming with Raspberry Pi 3, SRS crashes after a few packets.
1. SRS Version:
4.0release
1. SRS Log:
srs end
Push end
1. The configuration of SRS is as follows (Config):
Other
All have been tested, the phenomenon is the same. Without adding the hls segment in the configuration file, only supporting rtmp is normal.
File generation is normal.
TRANS_BY_GPT3