-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix disconnect RTSP connection has assertion, resulting in program exit #1612
Conversation
@@ -179,6 +179,7 @@ SrsRtspListener::SrsRtspListener(SrsServer* svr, SrsListenerType t, SrsConfDirec | |||
srs_assert(type == SrsListenerRtsp); | |||
if (type == SrsListenerRtsp) { | |||
caster = new SrsRtspCaster(c); | |||
caster->initialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize has a return value, so it should be checked.
Currently, it may not return an error, but someone may modify the implementation of this function in the future without necessarily modifying the corresponding check.
This could potentially lead to unexpected behavior, where errors are present but the program continues to run.
TRANS_BY_GPT3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added TODO.
TRANS_BY_GPT3
srs_error_t err = srs_success; | ||
if ((err = manager->start()) != srs_success) { | ||
return srs_error_wrap(err, "start manager"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return an error, otherwise there may be unknown behavior. It has already been fixed.
TRANS_BY_GPT3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En, you still consider everything comprehensively ^_^
TRANS_BY_GPT3
I'm on the latest version of srs (4.0release)
And I'm getting this crash of srs:
Here are the logs around the error:
One thing I have noticed, is that the crash always happens after a "stream is busy" message. Perhaps that has something to do with it? It seems like i'm connected on the same IP with two different clients?
|
` ffmpeg -re -i class.mp4 -vcodec copy -codec copy -f rtsp rtsp://210.37.1.20:554/live/rtsp SRS opens the RTSP switch. SRS prints logs. [2021-04-12 16:05:02.273][Trace][31688][9o5713ef] rtsp: serve 10.130.7.75:59224
|
After the RTSP connection is disconnected, an assertion error occurs when releasing the RTSP connection, causing the program to exit.
[2020-02-17 18:00:54.353][Trace][8480][897] rtsp: ignore header User-Agent=Lavf57.56.101
srs: src/app/srs_app_st.cpp:146: virtual void SrsSTCoroutine::stop(): Assertion `!r0' failed.
Aborted
[root@iZ8vbd93czg2ytwfhy1fmnZ trunk]#
TRANS_BY_GPT3