[OpenSIPS-Users] Mid-registrar with AOR throttling - clearing registration

2021-09-28 Thread Mark Allen
We have a mid-registrar (OpenSIPS 3.1) in front of an Asterisk node.
Mid-registrar saves with the 'memory only' flag. We are using AOR throttling

We've had a few occasions where something has gone wrong with the
registration on Asterisk so that Asterisk thinks an extension is no longer
registered, but OpenSIPS thinks it still is. We've resolved these
occurrences but they have raised a question for the future. In a
situation where mid-registrar is holding onto a registration but Asterisk
thinks the registration no longer exists, is there a way to tell the
mid-registrar to expire the registration, either forcing a re-register on
Asterisk, or at least so that the next re-register from a client is
forwarded on to Asterisk? Obviously, we have the option of restarting
OpenSIPS, but that would affect all registered clients rather than a single
problematic one.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in mid_registrar

2021-09-28 Thread Andrew Yager
Hi,

Since testing 3.2.2 we've noticed a segfault affecting registrations
pretty regularly through mid_registrar.

The issue occurs intermittently, but seemingly when the contact
doesn't exist and needs to be created. We are currently using
in-memory mid_registrar without DB backing to test; although we have
previously had DB backing.

We can "more commonly" trigger this with Zoiper as the client; but we
can't see any specific reason. Have checked the github issues and
can't see any particular reason why this would be happening in 3.2.2
but not 3.2.0.

Host OS is Ubuntu 20.04.

We're seeing the following trace from the info log.

Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:parse_headers:
flags=
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:parse_params:
Parsing params for:[expires=3599]
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:mid_registrar:save_restore_req_contacts: saving + restoring all
contact URIs ...
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:mid_registrar:calc_contact_expires: expires: 3599
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str domain='location'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str aor='1000'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:get_dummy_sip_msg:
reusing the static sip msg 0x7f343336a7c8
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:core:release_dummy_sip_msg: cleaning the static sip msg
0x7f343336a7c8
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:destroy_avp_list:
destroying list (nil)
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:usrloc:run_ul_callbacks: contact=0x7f3431eb4598, callback type
16/208, id 1 entered
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:mid_registrar:mid_reg_aor_event: AOR callback (16): contact='1000'
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:mid_registrar:save_restore_req_contacts: INSERTING contact with
expires 1632819655
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str domain='location'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str aor='1000'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str uri='sip:1000@1.1.1.1:53149;rinstance=718be353c21105be;transport=tls'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str received=''
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str path=''
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
int qval=-1
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str user_agent='Z 5.5.5 v2.10.15.2'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str socket='tls:2.2.2.2:5061'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
int bflags=14
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
int expires=1632819655
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str callid='c77MPaFAE7pAVYD5R-s1-w..'
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
int cseq=2
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str attr=''
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
int latency=0
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
str shtag=''
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:get_dummy_sip_msg:
reusing the static sip msg 0x7f343336a7c8
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:core:release_dummy_sip_msg: cleaning the static sip msg
0x7f343336a7c8
Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:destroy_avp_list:
destroying list (nil)
Sep 28 18:50:55 hvprxy-dev osips[1134252]: CRITICAL:core:sig_usr:
segfault in process pid: 1134252, id: 4
Sep 28 18:50:55 hvprxy-dev osips[1134252]:
DBG:core:restore_segv_handler: restoring SIGSEGV handler...

BT says:

Core was generated by `/usr/sbin/opensips -P
/run/opensips/opensips.pid -f /etc/opensips/opensips.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __memmove_avx_unaligned_erms () at
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:287
287 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such
file or directory.
(gdb) bt
#0  __memmove_avx_unaligned_erms () at
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:287
#1  0x7fcd40357065 in memcpy (__len=,
__src=, __dest=) at
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
#2  kv_put (_store=, _key=,
_val=0x7fff9752f750) at kv_store.c:87
#3  0x7fcd3dfc11e5 in store_ucontact_data (c=0x7fcd4434f458,
mri=0x7fcd4585fb80 , ct_uri=0x6152d9d6, expires=, expires_out=21925, last_reg_ts=94, last_cseq=0) at
ul_storage.c:201
#4  0x7fcd3dfc7349 in mid_reg_store_ct_data (c=,
info=) at save.c:243
#5  0x7fcd4034adf1 in insert_ucontact (_r=0x7fcd43b2f768,
_contact=0x7fcd44020a48, _ci=0x7fcd3dff4060 ,
match=0x7fcd44352e30, skip_replication=,
_c=0x7fff9752f8e0) at urecord.c:876
#6  0x7fcd3dfd34ef in save

Re: [OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in mid_registrar

2021-09-28 Thread Andrew Yager
Just further to this, I'm pretty sure this is a regression introduced in
https://github.com/OpenSIPS/opensips/commit/c11f92698c6f345d8921d645177f71aa36c9791d
.

On Tue, 28 Sept 2021 at 19:04, Andrew Yager  wrote:

> Hi,
>
> Since testing 3.2.2 we've noticed a segfault affecting registrations
> pretty regularly through mid_registrar.
>
> The issue occurs intermittently, but seemingly when the contact
> doesn't exist and needs to be created. We are currently using
> in-memory mid_registrar without DB backing to test; although we have
> previously had DB backing.
>
> We can "more commonly" trigger this with Zoiper as the client; but we
> can't see any specific reason. Have checked the github issues and
> can't see any particular reason why this would be happening in 3.2.2
> but not 3.2.0.
>
> Host OS is Ubuntu 20.04.
>
> We're seeing the following trace from the info log.
>
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:parse_headers:
> flags=
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:parse_params:
> Parsing params for:[expires=3599]
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:mid_registrar:save_restore_req_contacts: saving + restoring all
> contact URIs ...
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:mid_registrar:calc_contact_expires: expires: 3599
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str domain='location'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str aor='1000'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:get_dummy_sip_msg:
> reusing the static sip msg 0x7f343336a7c8
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:core:release_dummy_sip_msg: cleaning the static sip msg
> 0x7f343336a7c8
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:destroy_avp_list:
> destroying list (nil)
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:usrloc:run_ul_callbacks: contact=0x7f3431eb4598, callback type
> 16/208, id 1 entered
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:mid_registrar:mid_reg_aor_event: AOR callback (16): contact='1000'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:mid_registrar:save_restore_req_contacts: INSERTING contact with
> expires 1632819655
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str domain='location'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str aor='1000'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str uri='sip:1000@1.1.1.1:53149;rinstance=718be353c21105be;transport=tls'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str received=''
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str path=''
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> int qval=-1
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str user_agent='Z 5.5.5 v2.10.15.2'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str socket='tls:2.2.2.2:5061'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> int bflags=14
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> int expires=1632819655
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str callid='c77MPaFAE7pAVYD5R-s1-w..'
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> int cseq=2
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str attr=''
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> int latency=0
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:evi_param_set: set
> str shtag=''
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:get_dummy_sip_msg:
> reusing the static sip msg 0x7f343336a7c8
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:core:release_dummy_sip_msg: cleaning the static sip msg
> 0x7f343336a7c8
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: DBG:core:destroy_avp_list:
> destroying list (nil)
> Sep 28 18:50:55 hvprxy-dev osips[1134252]: CRITICAL:core:sig_usr:
> segfault in process pid: 1134252, id: 4
> Sep 28 18:50:55 hvprxy-dev osips[1134252]:
> DBG:core:restore_segv_handler: restoring SIGSEGV handler...
>
> BT says:
>
> Core was generated by `/usr/sbin/opensips -P
> /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __memmove_avx_unaligned_erms () at
> ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:287
> 287 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such
> file or directory.
> (gdb) bt
> #0  __memmove_avx_unaligned_erms () at
> ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:287
> #1  0x7fcd40357065 in memcpy (__len=,
> __src=, __dest=) at
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
> #2  kv_put (_store=, _key=,
> _val=0x7fff9752f750) at kv_store.c:87
> #3  0x7fcd3dfc11e5 in store_ucontact_data (c=0x7

Re: [OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in mid_registrar

2021-09-28 Thread Liviu Chircu

On 28.09.2021 14:00, Andrew Yager wrote:
Just further to this, I'm pretty sure this is a regression introduced 
in 
https://github.com/OpenSIPS/opensips/commit/c11f92698c6f345d8921d645177f71aa36c9791d 
.


Haha, that was a HUGE help, that IS the bug!  What is up with these 
anonymous struct bugs discovered in the last 24 hours, this is the 3rd 
one... it's almost like a viral idea that has entered our brains and has 
kept spreading throughout the entire codebase!!


Better come up with the vaccine, so we cure the code and stop the 
spread.  Will put up a fix soon, thanks again for the nice hint!


Cheers,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in mid_registrar

2021-09-28 Thread Liviu Chircu

On 28.09.2021 14:29, Liviu Chircu wrote:
Will put up a fix soon, thanks again for the nice hint! 


Done, see: 
https://github.com/OpenSIPS/opensips/commit/6765b7d95b99626ca81986561f3d7851b3e90c8f


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in mid_registrar

2021-09-28 Thread Andrew Yager
No worries; glad the detective work born out of frustration helped ;) (and 
thanks to my colleague Mark V who is lurking around here for his work in 
getting to this point!)

We’ll give it a test in the next nightly build!

A

From: Liviu Chircu 
Sent: Tuesday, September 28, 2021 9:56:43 PM
To: OpenSIPS users mailling list ; Andrew Yager 

Subject: Re: [OpenSIPS-Users] Segfault in 3.2.2 (inc nightly) but not 3.2 in 
mid_registrar

On 28.09.2021 14:29, Liviu Chircu wrote:
> Will put up a fix soon, thanks again for the nice hint!

Done, see:
https://github.com/OpenSIPS/opensips/commit/6765b7d95b99626ca81986561f3d7851b3e90c8f

--
Liviu Chircu
www.twitter.com/liviuchircu | 
www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users