-
-
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
RTC: Call on_play before create session, for it might be freed for timeout. #3455
Conversation
6a108fab6d#diff-2d94fb08a8b76aa40f71a392bb00afc19bb96767bd874cf74582a011488dc88cR207 Here is a comment written, stating that there is a sequential dependency, but from the code, there doesn't seem to be any dependency.
|
|
@xiaozhihong I haven't enabled webrtc protocol distribution on my side, only http-flv and rtmp live protocol distribution are enabled, but it still reports the crash mentioned in #3413.
|
c056094
to
2ac9eb8
Compare
…meout. v5.0.149, v6.0.37 (#3455) PICK d875571 Co-authored-by: winlin <[email protected]> Co-authored-by: ChenGH <[email protected]>
…meout. v5.0.149, v6.0.37 (ossrs#3455) Co-authored-by: winlin <[email protected]> Co-authored-by: ChenGH <[email protected]>
When callback the on_play, it might be blocked and context will be switched to other coroutine, then the created session might be freed for timeout. After the callback is done, the destroied session will be used and cause the crash.
I changed the order to call on_play before create session, in order to avoid destroying the session object. However, the best solution is use shared ptr, and we're developing it.