Hi,
apply the attached patch and look for debug messages starting with
"***:" they should give us a clue about the len value...
Please send me the output (only that msgs).
regards,
bogdan
Bastian Schern wrote:
Hi,
I call record_route_present() directly from the script:
--- snip ---
#----------------------------------------------------------------
# record route section
#----------------------------------------------------------------
if( method == "INVITE" && client_nat_test( "3" ) ) {
xlog( "L_INFO", "$Tf: <$fu>;tag=$ft : record_route_preset(
\"217.160.188.74:5060;nat=yes\" )\n" );
record_route_preset( "217.160.188.74:5060;nat=yes" );
} else if( method != "REGISTER" ) {
xlog( "L_INFO", "$Tf: <$fu>;tag=$ft : record_route()\n" );
record_route();
}
--- snap ---
I don't see what's going wrong.
Regards
Bastian
Bogdan-Andrei Iancu schrieb:
Hi Bastian,
I made a fast overview/testing and I found no problem with
record_route_preset() function. Are you calling it directly from
script or from another module....the bogus length may by due an
invalid param.
regards,
bogdan
Bastian Schern wrote:
> Hi Bogdan,
>
> I compiled OpenSER with memory debugging and all other settings you
> recommend to me. After that I got the following debug output:
>
> --- snip ---
> [...]
> 0(31223) xl_printf: final buffer length 125
> 0(31223) Wed Feb 1 00:31:43 2006:
> <sip:00045977408@sipbase.de>;tag=77lh74wsus : record_route_preset(
> "217.160.188.74:5060;nat=yes" )
> 0(31223) qm_malloc(0x8114d40, 32) called from data_lump.c:
> anchor_lump(351)
> 0(31223) qm_malloc(0x8114d40, 32) returns address 0x815a390 frag.
> 0x815a378 (size=32) on 1 -th hit
> 0(31223) qm_malloc(0x8114d40, 1074638763) called from record.c:
> record_route_preset(373)
> 0(31223) record_route_preset(): No memory left
> 0(31223) parse_headers: flags=200
> [...]
> --- snip ---
>
> It looks like qm_malloc tries to allocate 1074638763 Bytes (1024 MB).
> I think this is really strange!
>
> In the memory dump I don't see something strange.
>
> Regards
> Bastian
>
>
> Bogdan-Andrei Iancu schrieb:
>
>> Hi,
>>
>> look like something is not right - please compile the memory debug
>> support (in Makefile.defs set DBG_QM_MALLOC define and remove
>> F_MALLOC - Note: you need to recompile everything).
>>
>> run in no fork mode with debug=9 and wait for the error to appear.
>> first, see how much memory the malloc tries to grab.
>> second, hit the process with SIGUSR1 to force memory dump - see if
>> there is something strange there.
>>
>> regards,
>> bogdan
>>
>> Bastian Schern wrote:
>>
>>> Bogdan-Andrei Iancu schrieb:
>>>
>>>> Hi Bastian,
>>>>
>>>> looks like you openser runs out of private memory (pkg memory) -
>>>> this may happen either because of insufficient mem, either due a
>>>> mem leak.
>>>>
>>>> Does is happens after running for a long time? or quite soon
>>>> after start?
>>>>
>>>
>>> It will occur quite soon after starting OpenSER.
>>>
>>>
>>>> first try to increase the pkg memory - see config.h file, the
>>>> PKG_MEM_POOL_SIZE define. By default, the size is of 1 M. If the
>>>> problem persists, please report back.
>>>>
>>>
>>> I changed PKG_MEM_POOL_SIZE to 2*1024*1024 but it is still the
>>> same. Is it still to low?
>>>
>>> Regards
>>> Bastian
>>>
>>>
>>>> regards,
>>>> bogdan
>>>>
>>>> Bastian Schern wrote:
>>>>
>>>>> Hello to all,
>>>>>
>>>>> I'm using the latest CVS 1_0_0 and I got the following message
>>>>> in the log after a "record_route_preset(
>>>>> "213.191.xxx.xxx:5060;nat=yes" )":
>>>>>
>>>>> record_route_preset(): No memory left
>>>>>
>>>>> Why this comes?
>>>>>
>>>>> Regards
>>>>> Bastian
>>>>
>>>>
____________
Virus checked by G DATA AntiVirusKit
Version: AVK 16.5183 from 30.01.2006
Virus news:
www.antiviruslab.com
? modules/rr/.record.c.swp
Index: modules/rr/record.c
===================================================================
RCS file: /cvsroot/openser/sip-server/modules/rr/record.c,v
retrieving revision 1.4
diff -u -r1.4 record.c
--- modules/rr/record.c 22 Nov 2005 12:35:30 -0000 1.4
+++ modules/rr/record.c 2 Feb 2006 14:01:58 -0000
@@ -329,6 +329,9 @@
char* hdr, *p;
int hdr_len;
+ DBG("***: str ptr=%p, str len=%d, str s=%p",((str*)_data),
+ ((str*)_data)->len, ((str*)_data)->s);
+
from = 0;
user.len = 0;
user.s = 0;
Index: modules/rr/rr_mod.c
===================================================================
RCS file: /cvsroot/openser/sip-server/modules/rr/rr_mod.c,v
retrieving revision 1.6
diff -u -r1.6 rr_mod.c
--- modules/rr/rr_mod.c 24 Jan 2006 20:56:27 -0000 1.6
+++ modules/rr/rr_mod.c 2 Feb 2006 14:01:58 -0000
@@ -170,6 +170,7 @@
s->s = (char*)*param;
s->len = strlen(s->s);
+ DBG("***: str ptr=%p, str len=%d, str s=%p",s,s->len,s->s);
*param = (void*)s;
}