Hi , Currently I am running kamailio 4.2 and now upgrading to kamailio 5.2 and was just going thru the changes.
In the file modules/usrloc/udomain.c inside the function free_udomain( ) , it appears that we are not protecting via lock_ulslot and unlock_ulslot doing free. Could it cause some race condition ? May be its intentional but going thru the github history its there since day 1. I checked all branches in kamailio 4.x and we have the protection. In 4.x
void free_udomain(udomain_t* _d) { int i; if (_d->table) { for(i = 0; i < _d->size; i++) { lock_ulslot(_d, i); deinit_slot(_d->table + i); unlock_ulslot(_d, i); } shm_free(_d->table); } shm_free(_d); } In 5.x void free_udomain(udomain_t* _d) { int i; if (_d->table) { for(i = 0; i < _d->size; i++) { deinit_slot(_d->table + i); } shm_free(_d->table); } shm_free(_d); }