[Asterisk-code-review] res pjsip: Patch for res pjsip * module load/reload crash (asterisk[master])
Corey Farrell
asteriskteam at digium.com
Mon Nov 19 05:55:19 CST 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/10617 )
Change subject: res_pjsip: Patch for res_pjsip_* module load/reload crash
......................................................................
Patch Set 8: Code-Review-1
(7 comments)
https://gerrit.asterisk.org/#/c/10617/8/include/asterisk/res_pjsip_session.h
File include/asterisk/res_pjsip_session.h:
https://gerrit.asterisk.org/#/c/10617/8/include/asterisk/res_pjsip_session.h@262
PS8, Line 262: struct ast_module *module;
This breaks the ABI of modules which provide session supplements. Not an issue for 'master' but if we want this in 13/16 we'll probably need to figure out how to deal with this.
https://gerrit.asterisk.org/#/c/10617/8/include/asterisk/res_pjsip_session.h@591
PS8, Line 591: ast_sip_session_register_supplement_with_module(ast_module_info->self, supplement)
This should use AST_MODULE_SELF in 16+. ast_module_info->self is only available from the main module source file, AST_MODULE_SELF can be used by any source.
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip/include/res_pjsip_private.h
File res/res_pjsip/include/res_pjsip_private.h:
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip/include/res_pjsip_private.h@224
PS8, Line 224: int ast_res_pjsip_init_message_filter(const struct ast_module_info *module);
If we find a way to cherry-pick this to 13 I'd prefer this pass 'struct ast_module *module'. For 16+ it's unneeded as the function can just use the regular macro that will use AST_MODULE_SELF.
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip/pjsip_session.c
File res/res_pjsip/pjsip_session.c:
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip/pjsip_session.c@41
PS8, Line 41: if(!supplement) {
: ast_assert(0);
: }
This should simply use `ast_assert(supplement != NULL);`.
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip/pjsip_session.c@104
PS8, Line 104: if (copy->module) {
ast_module_ref checks that the module is not NULL so no need to also check here.
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip_session.c
File res/res_pjsip_session.c:
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip_session.c@3331
PS8, Line 3331: if (!session) {
: return;
: }
:
: ast_log(LOG_DEBUG, "Fired handle_session_destroy.\n");
It's impossible to reach this point with a NULL session so please remove the NULL check. Also I think this debug message should be removed.
https://gerrit.asterisk.org/#/c/10617/8/res/res_pjsip_session.c@3347
PS8, Line 3347: if (!session) {
: return;
: }
:
: ast_log(LOG_DEBUG, "Fired handle_session_end.\n");
Same
--
To view, visit https://gerrit.asterisk.org/10617
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5b82be3a75d702cf1933d8d1417f44aa10ad1029
Gerrit-Change-Number: 10617
Gerrit-PatchSet: 8
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Mon, 19 Nov 2018 11:55:19 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181119/b1f5cf70/attachment-0001.html>
More information about the asterisk-code-review
mailing list