[OpenSIPS-Devel] Doubt about hash ID

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Feb 5 04:43:20 EST 2018


Hi Daniel,

The issue was fixed and backported to the maintained versions too. See 
the fixes on the master branch:
https://github.com/OpenSIPS/opensips/commit/095dc57300b9665b090e999a540db8b391f8d22e
https://github.com/OpenSIPS/opensips/commit/a61fa8646e6f865b347b3e725c6362dc15d4e57b
https://github.com/OpenSIPS/opensips/commit/ed12eb97c06a23491c8b831124600361b0b63f2f

Again, many thanks for the report, this was an awesome catch - and if 
you plan to participate to the OpenSIPS Summit, keep it mind you have a 
free seat form us ;)

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/29/2018 11:54 PM, Bogdan-Andrei Iancu wrote:
> 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
>
>
>
> _______________________________________________
> 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/20180205/e4398b63/attachment.html>


More information about the Devel mailing list