[Home]

Summary:ASTERISK-27126: "pjsip show aors" returns Memory Allocation Failure errors when using MariaDB ODBC connector
Reporter:HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u)Labels:
Date Opened:2017-07-11 08:44:00Date Closed:2020-01-14 11:13:36.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:pjproject/pjsip
Versions:14.5.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:fresh installed asterisk odbc realitime and pjsip. Amount of memory more than enough.

extconfig.conf
{noformat}
[settings]
ps_endpoints => odbc,asterisk
ps_auths => odbc,asterisk
ps_aors => odbc,asterisk
ps_domain_aliases => odbc,asterisk
ps_endpoint_id_ips => odbc,asterisk
ps_contacts => odbc,asterisk
ps_registrations => odbc,asterisk
ps_globals => odbc,asterisk
ps_systems => odbc,asterisk
{noformat}

sourcery.conf
{noformat}
[res_pjsip] ; Realtime PJSIP configuration wizard
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts
global=realtime,ps_globals

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
{noformat}

pjsip.conf
{noformat}
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
{noformat}

{noformat}
gsmpmnl*CLI> pjsip show aors

     Aor:  <Aor..............................................>  <MaxContact>
   Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

     Aor:  9991111                                             10


Objects found: 1

[Jul 11 15:33:04] ERROR[453]: /usr/src/my/asterisk-14.5.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 823 of /usr/src/my/asterisk-14.5.0/include/asterisk/strings.h
[Jul 11 15:33:04] ERROR[453]: /usr/src/my/asterisk-14.5.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 823 of /usr/src/my/asterisk-14.5.0/include/asterisk/strings.h
*error repeats numerous times*
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2017-07-11 08:44:01.618-0500

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.

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].

By: HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u) 2017-07-11 11:07:49.687-0500

Issue related to mariadb ODBC connector. Mysql ODBC connector works without issue

By: Rusty Newton (rnewton) 2017-07-18 19:21:55.301-0500

* What version of pjproject if it is not bundled?
* What version of mariadb odbc connector?
* What version of unixodbc?

What log channels did you have active on the console when you ran "pjsip show aors" ?

Can you run that again, with error,warning,notice,verbose,debug - where verbose and debug are both turned up above 5 ?



By: HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u) 2017-07-21 05:45:12.940-0500

1) Lastest from pjsip project i guess 2.6
2) lastest from mariadb project mysql-connector-odbc-5.3.8-linux-ubuntu16.10-x86-64bit.tar.gz
3) 2.3.4-1 lastest from ubuntu 17.04

[Jul 21 12:51:52] DEBUG[5556]: res_odbc.c:869 _ast_odbc_request_obj2: Reusing ODBC handle 0x5587be36f548 from class 'asterisk'
[Jul 21 12:51:52] DEBUG[5556]: res_config_odbc.c:116 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_auths WHERE id LIKE ? ORDER BY id
[Jul 21 12:51:52] DEBUG[5556]: res_config_odbc.c:132 custom_prepare: Parameter 1 ('id LIKE') = '%'
[Jul 21 12:51:52] ERROR[5556]: /usr/src/my/asterisk-14.4.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 822 of /usr/src/my/asterisk-14.4.0/include/asterisk/strings.h
[Jul 21 12:51:52] ERROR[5556]: /usr/src/my/asterisk-14.4.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 822 of /usr/src/my/asterisk-14.4.0/include/asterisk/strings.h
[Jul 21 12:51:52] ERROR[5556]: /usr/src/my/asterisk-14.4.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 822 of /usr/src/my/asterisk-14.4.0/include/asterisk/strings.h
[Jul 21 12:51:52] ERROR[5556]: /usr/src/my/asterisk-14.4.0/include/asterisk/utils.h:625 _ast_realloc: Memory Allocation Failure in function ast_str_make_space at line 822 of /usr/src/my/asterisk-14.4.0/include/asterisk/strings.h
...... SKIPPED SAME......
[Jul 21 12:51:52] DEBUG[5556]: res_odbc.c:718 ast_odbc_release_obj: Releasing ODBC handle 0x5587be36f548 into pool
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
[Jul 21 12:51:52] DEBUG[5556]: config.c:3742 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives [32](0)
... SKIPPED SAME ...


By: Rusty Newton (rnewton) 2017-07-24 18:12:26.760-0500

Thanks for the additional information. We should go ahead and get MALLOC_DEBUG output during reproduction as welll:

https://wiki.asterisk.org/wiki/display/AST/MALLOC_DEBUG+Compiler+Flag

By: Asterisk Team (asteriskteam) 2017-08-08 12:00:02.388-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

By: HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u) 2017-08-09 02:28:57.597-0500

And what you expect from me ? I reported issue . So solve it please. Or just include in documentation that asterisk not fully compatible with OBDC.

By: Asterisk Team (asteriskteam) 2017-08-09 02:28:58.229-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Joshua C. Colp (jcolp) 2017-08-14 10:50:48.700-0500

Rusty requested MALLOC_DEBUG information in order to isolate this. Without this it's hard to find the issue. Asterisk itself does work with ODBC and there was conversation recently on the mailing list which resulted in a wiki comment about using MariaDB and ODBC - and after changing a MariaDB option it worked for the user, so it's not broken for everyone.

[1] https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime?refresh=1501592246325&refresh=1501592309852&refresh=1501592385401&focusedCommentId=37455051#comment-37455051

By: HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u) 2017-08-15 02:24:14.126-0500

You can easy recreate yourself. All information to do it you have. I just reported issue. From my side was much easy to switch to another driver because as usual asterisk not compatible with anything except mysql.  

By: Joshua C. Colp (jcolp) 2017-08-15 05:01:28.092-0500

[~y2fbo4IevYm5Ve9u] At least one other individual (I linked to their comment) is using this setup perfectly fine, so it's not happening for everyone. So far you appear to be the only individual experiencing the problem in fact. This could be down to the precise version of your stuff, or the entries in your database (you haven't stated how many in the database, or what they look like).

By: HZMI8gkCvPpom0tM (y2fbo4IevYm5Ve9u) 2017-08-15 05:05:39.881-0500

Ok. If issue not exist on you point of view than just close it.

By: Joshua C. Colp (jcolp) 2017-08-15 05:08:27.218-0500

[~y2fbo4IevYm5Ve9u] I'm not saying the issue doesn't exist, I'm saying we need additional information if anyone is going to be able to further isolate and determine precisely what is going on. The less information we have the more time we (or a member of the community) has to spend trying every possible thing in order to determine what is going on. The more information we have the less time it takes.

By: Rusty Newton (rnewton) 2017-08-16 09:07:06.783-0500

Further adding to what Josh is saying, we often cannot reproduce these types of issues despite how simple it appears on your end. That is why we need precise information and lots of debug in order to see what is going on.

Please let us know if you are unable to provide the requested debug.

By: Asterisk Team (asteriskteam) 2017-08-30 12:00:02.945-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines