-
Notifications
You must be signed in to change notification settings - Fork 742
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 transport loop #3773
Fix transport loop #3773
Conversation
pjmedia/src/pjmedia/transport_loop.c
Outdated
@@ -239,7 +240,6 @@ static void tp_loop_on_destroy(void *arg) | |||
struct transport_loop *loop = (struct transport_loop*) arg; | |||
|
|||
PJ_LOG(4, (loop->base.name, "Loop transport destroyed")); | |||
pj_pool_release(loop->pool); |
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.
No need to erase this, it will cause leak.
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.
But then it the pool is released twice: the second time in
Line 404 in ca52557
pj_pool_release(pool); |
which leads to a crash.
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.
the issue is that, the pool is released when the tp is still in use. If the tp is not used any longer, then it will be safe to release the pool. Tested here without removing the pool release, and there's no crash
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.
I missed that there are two pools...
I have to continue debugging...
Anyway... due to 6dc9b8c I get a crash for a code that worked at least since 2.11.
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.
You are right - it is working for me too.
Transport "loop" need set the `base.grp_lock`, as also shown in `transport_adapter_sample.c` to have destroying of the loop transport working. Issue pjsip#3771
6933099
to
15fdec8
Compare
IIRC the group lock of transport loop is not exported to |
@nanangizz: In
grp_lock is nowhere stored in this function.
tp->grp_lock - which was never set.E.g. the pool address is stored by tp->pool = pool; at
|
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.
@wosrediinanatour You're absolutely right! Thanks for pointing it out.
Transport "loop" need set the `base.grp_lock`, as also shown in `transport_adapter_sample.c` to have destroying of the loop transport working. Issue #3771
Transport "loop" need set the
base.grp_lock
, as also shown intransport_adapter_sample.c
to have destroying of the loop transport working.Issue #3771