Summary:ASTERISK-03148: When start asterisk with MOH support in Mac OS X, produce a memory allocation warning
Reporter:Fernando Romo (el_pop)Labels:
Date Opened:2004-12-31 13:18:10.000-0600Date Closed:2011-06-07 14:10:28
Versions:Frequency of
Description:In the last releases og res_musiconhold.c (version 1.42 and 1.43)under Mac OS X, when start the asterisk server produce the following warning: "shmget(): Cannot allocate memory".

If i commnet and disable the music on hold feature comment the definitions in "musiconhold.conf" the asterisk server work fine, but without MOH... :(

In Linux FC2 and FC3 with kernel 2.6.9.x works fine, the problem is reported only under Mac OS X 10 (Panther)

the problem is in the moh_files_alloc() aparently when call memset() the size on buffer is diferent under PPC arquitectures.


asterisk -c
Asterisk CVS-HEAD-09/09/04-13:05:52, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <markster@digium.com>
[ Booting.........Warning, flexible rate not heavily tested!
Found new ID3 Header
shmget(): Cannot allocate memory
Warning, flexible rate not heavily tested!
........................................................................................................ ]
Asterisk Ready.
Comments:By: twisted (twisted) 2004-12-31 14:27:23.000-0600

Reading the date on cvs in the output, it does not match the version you have listed in your report.  Please make sure you are running latest cvs.

Asterisk CVS-HEAD-09/09/04-13:05:52, Copyright (C) 1999-2004 Digium. <-- more than 3 months old.

By: Fernando Romo (el_pop) 2004-12-31 14:37:05.000-0600

???, I report in the version 1.42 and 1.43 of "res_musiconhold.c", i update to the last cvs version and the error still appear.

cvs log res_musiconhold.c      

RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
Working file: res_musiconhold.c
head: 1.43
locks: strict
access list:
symbolic names:
       v1-0-2: 1.39
       v1-0-1: 1.39
       v1-0-0: 1.39
       v-1_0_RC2: 1.37
       v1_0_rc_1: 1.35
       v0_9_0: 1.19
       v1-0_base: 1.19
       v0-7-2: 1.19
       v0-7-1: 1.19
       v_0_7_0: 1.19
       v0-5-0: 1.14
       v0-4-0: 1.7
       v0-3-0: 1.3
       v0-2-0: 1.2
       v0-1-12: 1.1
keyword substitution: kv
total revisions: 44;    selected revisions: 44
revision 1.43
date: 2004/12/26 00:33:17;  author: anthm;  state: Exp;  lines: +2 -3
misplaced chdir call on moh DoH\!
revision 1.42
date: 2004/12/24 01:40:07;  author: markster;  state: Exp;  lines: +366 -47
Merge anthm's native MOH patch (bug ASTERISK-2594) he promises me he'll rid it of ast_flag_moh...

By: Mark Spencer (markster) 2004-12-31 19:58:19.000-0600

Does the problem occur with native moh or mp3 moh?

By: Fernando Romo (el_pop) 2005-01-02 16:05:03.000-0600

The problem occur with MP3 support. i try to test with native mode.

By: Brian West (bkw918) 2005-01-02 17:03:52.000-0600

it makes sense to think that "shmget(): Cannot allocate memory" might be coming from mpg123 since we don't use shmget anywhere in asterisk?

All of these lines are from mpg123 not asterisk:

Warning, flexible rate not heavily tested!
Found new ID3 Header
shmget(): Cannot allocate memory
Warning, flexible rate not heavily tested!

By: Brian West (bkw918) 2005-01-02 17:04:49.000-0600

Yes I have looked thru the mpg123 code... this is from line 69 from xfermem.c in mpg123 not asterisk.