[OpenSIPS-Devel] Doubt about hash ID
Bogdan-Andrei Iancu
bogdan at opensips.org
Mon Jan 29 16:54:19 EST 2018
Hi Daniel,
Thanks for the report. Hard to believe but this may actually happen if
you run OpenSIPS for long time under heavy load, making the id counter
(per hash entry) to overflow the signed int.
Let me investigate more.
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
OpenSIPS Summit 2018
http://www.opensips.org/events/Summit-2018Amsterdam
On 01/26/2018 07:32 PM, Daniel Zanutti wrote:
> Hey
>
> I got this error on Opensips:
> */sbin/opensips[9189]: ERROR:dialog:parse_dlg_rr_param: invalid hash
> id 'efd60008'*
>
> Checking the failling function:
> inline static int reverse_hex2int( char *c, int len )
> {
> char *pc;
> int r;
> char mychar;
>
> r=0;
> for (pc=c+len-1; len>0; pc--, len--) {
> r <<= 4 ;
> mychar=*pc;
> if ( mychar >='0' && mychar <='9') r+=mychar -'0';
> else if (mychar >='a' && mychar <='f') r+=mychar -'a'+10;
> else if (mychar >='A' && mychar <='F') r+=mychar -'A'+10;
> else return -1;
> }
> return r;
> }
>
> Converting manually, looks like it passed int limit: efd60008 =
> 4023779336 > Limit 2147483647
>
> The doubt is: Shouldn't this function return "unsigned int" instead of
> "int"? Is this the problem or am I seeing something wrong?
>
> I'm using opensips 1.11.9.
>
> Thanks
>
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20180129/476adb6c/attachment.html>
More information about the Devel
mailing list