[Home]

Summary:ASTERISK-29731: res_pjsip_outbound_publish: Reload results in invalid state and usage of freed memory
Reporter:Luke Escude (lukeescude)Labels:
Date Opened:2021-11-10 15:09:42.000-0600Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Resources/res_pjsip_outbound_publish Resources/res_pjsip_pubsub
Versions:16.22.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hello, playing around with outbound PUBLISH capabilities and ran into a bug.

When changing an outbound-publish context in pjsip.conf a core reload will throw the following errors:

[Nov 10 21:03:59] WARNING[8849]: res_pjsip_exten_state.c:658 exten_state_publisher_cb: PUBLISH client 'send-blfs-1' has no from_uri or server_uri defined.
[Nov 10 21:03:59] ERROR[8849]: res_pjsip_outbound_publish.c:561 sip_outbound_publish_client_get_publisher: FRACK!, Failed assertion bad magic number 0x0 for object 0x20a1d20 (0)
[Nov 10 21:03:59] ERROR[8849]:   Got 12 backtrace records
# 0: asterisk() [0x45da16]
# 1: asterisk() [0x460b63]
# 2: asterisk(__ao2_find+0x2e) [0x460d6e]
# 3: /usr/lib64/asterisk/modules/res_pjsip_outbound_publish.so(ast_sip_publish_client_get_user_from_uri+0x6e) [0x7f246cab022e]
# 4: /usr/lib64/asterisk/modules/res_pjsip_exten_state.so(+0x2f0a) [0x7f2465c92f0a]
# 5: asterisk(ast_taskprocessor_execute+0xbe) [0x5982ae]
# 6: asterisk() [0x59f380]
# 7: asterisk(ast_taskprocessor_execute+0xbe) [0x5982ae]
# 8: asterisk() [0x59ff90]
# 9: asterisk() [0x5a79c9]
#10: /lib64/libpthread.so.0(+0x7ea5) [0x7f24d34caea5]
#11: /lib64/libc.so.6(clone+0x6d) [0x7f24d2568b0d]


Even though from_uri and server_uri haven't changed.

To fix, an asterisk restart is required.

Here is the outbound publish context in question:

[send-blfs-1]
type=outbound-publish
transport=transport-tcp
server_uri=sip:SIPPROXY;transport=tcp
from_uri=sip:USER@SIPPROXY
event=dialog
multi_user=yes
@body=application/dialog-info+xml
@context=from-internal
Comments:By: Asterisk Team (asteriskteam) 2021-11-10 15:09:43.830-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Sean Bright (seanbright) 2021-11-10 15:27:04.755-0600

bq. When changing an outbound-publish context in pjsip.conf a core reload will throw the following errors:

What specifically are you changing? Is this consistently reproducible?

By: Luke Escude (lukeescude) 2021-11-10 15:35:09.753-0600

Yes, it happens every time, to any parameter except the @params.

So, set up a context like the above and start asterisk. Then, edit pjsip.conf and set multi_user to 'no' instead. core reload and you'll see the issue.

You can change the URIs, multi_user, event, etc. all that stuff will consistently cause it.