<div dir="ltr"><div>Hi, Danial</div><div><br></div><div>I had modified ims_usrloc_pcscf/udomain.c about hash function and related codes. <br>ex. via_host replaces with aor <br></div><div><br></div><div>aorhash = get_aor_hash(_d, &contact_info->aor, contact_info->via_port, contact_info->via_prot);<br>        //aorhash = get_aor_hash(_d, &contact_info->via_host, contact_info->via_port, contact_info->via_prot);<br></div><div>
//aorhash = get_aor_hash(_d, &contact_info->via_host, contact_info->via_port, contact_info->via_prot);<br>        //aorhash = get_aor_hash(_d, &contact_info->via_host, contact_info->via_port, contact_info->via_prot);

<br></div><div><br></div><div>When PCSCF DB is empty, it's OK.<br></div><div>But if there are data in PCSCF DB, the PCSCF process was crashed.</div><div>Below is the gdb content.</div><div>Could you help to find the problem? <br></div><div>Thanks.<br></div><div><br>(gdb) bt full<br>#0  0x00007f9a2c688fc3 in core_hash (s1=0x7f9a2c89e908 <ci.13657+8>, s2=0x0, size=0)<br>    at ../../hashes.h:276<br>        p = 0x0<br>        end = 0x0<br>        v = 389295844<br>        h = 0<br>#1  0x00007f9a2c68ac01 in get_aor_hash (_d=0x7f9a173436e0,<br>    via_host=0x7f9a2c89e908 <ci.13657+8>, via_port=5080, via_proto=53877)<br>    at usrloc.c:147<br>        aorhash = 0<br>        __FUNCTION__ = "get_aor_hash"<br>#2  0x00007f9a2c68a8a9 in get_hash_slot (_d=0x7f9a173436e0,<br>    via_host=0x7f9a2c89e908 <ci.13657+8>, via_port=5080, via_proto=53877)<br>    at usrloc.c:137<br>        sl = 2000<br>        __FUNCTION__ = "get_hash_slot"<br>#3  0x00007f9a2c66e9f4 in lock_udomain (_d=0x7f9a173436e0,<br>    via_host=0x7f9a2c89e908 <ci.13657+8>, via_port=5080, via_proto=53877)<br>    at udomain.c:273<br>        sl = 0<br>#4  0x00007f9a2c67994d in preload_udomain (_c=0x7f9a2e3162f8, _d=0x7f9a173436e0)<br>    at udomain.c:866<br>        ci = 0x7f9a2c89e900 <ci.13657><br>        row = 0x7f9a2e340210<br>        columns = {0x7f9a2c89e2b0 <domain_col>, 0x7f9a2c89e2c0 <aor_col>,<br>          0x7f9a2c89e2d0 <host_col>, 0x7f9a2c89e2e0 <port_col>,<br>          0x7f9a2c89e2f0 <protocol_col>, 0x7f9a2c89e300 <received_col>,<br>          0x7f9a2c89e310 <received_port_col>, 0x7f9a2c89e320 <received_proto_col>,<br>          0x7f9a2c89e350 <rx_session_id_col>, 0x7f9a2c89e360 <reg_state_col>,<br>          0x7f9a2c89e370 <expires_col>, 0x7f9a2c89e390 <socket_col>,<br>          0x7f9a2c89e380 <service_routes_col>, 0x7f9a2c89e3a0 <public_ids_col>,<br>          0x7f9a2c89e330 <path_col>}<br>        res = 0x7f9a2e33ff40<br>        aor = {s = 0xb83059 "sip:d4173c5dcbdd1529@172.28.20.225:5080;transport=udp",<br>          len = 53}<br>        i = 0<br>        n = 0<br>        c = 0x7f9a2e335c20<br>        __FUNCTION__ = "preload_udomain"<br>#5  0x00007f9a2c68852d in child_init (_rank=1) at ul_mod.c:249<br>        ptr = 0x7f9a17342c70<br>        __FUNCTION__ = "child_init"<br>#6  0x00000000005308c6 in init_mod_child (m=0x7f9a2e2fbcf0, rank=1) at sr_module.c:921<br>        __FUNCTION__ = "init_mod_child"<br>#7  0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fbfa0, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#8  0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fcc80, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#9  0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fd260, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#10 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fd610, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#11 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fdc40, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#12 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fe158, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#13 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fe460, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#14 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2fedc8, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#15 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2ff418, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#16 0x00000000005305e3 in init_mod_child (m=0x7f9a2e2ffb48, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#17 0x00000000005305e3 in init_mod_child (m=0x7f9a2e3000f0, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>---Type <return> to continue, or q <return> to quit---<br>#18 0x00000000005305e3 in init_mod_child (m=0x7f9a2e300510, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#19 0x00000000005305e3 in init_mod_child (m=0x7f9a2e301898, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#20 0x00000000005305e3 in init_mod_child (m=0x7f9a2e302130, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#21 0x00000000005305e3 in init_mod_child (m=0x7f9a2e3026d8, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#22 0x00000000005305e3 in init_mod_child (m=0x7f9a2e302a50, rank=1) at sr_module.c:918<br>        __FUNCTION__ = "init_mod_child"<br>#23 0x0000000000530bfe in init_child (rank=1) at sr_module.c:947<br>No locals.<br>#24 0x0000000000485bd5 in fork_process (child_id=1,<br>    desc=0x7ffe9c85acc0 "udp receiver child=0 sock=<a href="http://172.28.20.216:4060">172.28.20.216:4060</a>", make_sock=1)<br>    at pt.c:327<br>        pid = 0<br>        child_process_no = 1<br>        ret = -1<br>        new_seed1 = 570787820<br>        new_seed2 = 1356713246<br>        sockfd = {-1, -1}<br>        __FUNCTION__ = "fork_process"<br>#25 0x000000000052024c in main_loop () at main.c:1586<br>        i = 0<br>        pid = 32766<br>        si = 0x7f9a2e2f1f10<br>        si_desc = "udp receiver child=0 sock=<a href="http://172.28.20.216:4060">172.28.20.216:4060</a>\000\177\000\000$[d\000\000\000\000\000\b\000\000\000\000\000\000\000(,4\027\232\177\000\000\000\360\f\027\232\177\000\000P,4\027\232\177\000\000`\000\000\000\000\000\000\000`\255\205\234\001\000\000\000\230t\r\027\232\177\000\000`\255\205\234\376\177\000\000H\036\064.\232\177\000"<br>        nrprocs = 8<br>        woneinit = 0<br>        __FUNCTION__ = "main_loop"<br>---Type <return> to continue, or q <return> to quit---<br>#26 0x0000000000527a79 in main (argc=7, argv=0x7ffe9c85b0d8) at main.c:2616<br>        cfg_stream = 0xad6010<br>        c = -1<br>        r = 0<br>        tmp = 0x7ffe9c85b818 ""<br>        tmp_len = 0<br>        port = 0<br>        proto = 0<br>        options = 0x74b160 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:"<br>        ret = -1<br>        seed = 2634858459<br>        rfd = 4<br>        debug_save = 0<br>        debug_flag = 0<br>        dont_fork_cnt = 0<br>        n_lst = 0x0<br>        p = 0x0<br>        st = {st_dev = 19, st_ino = 72092, st_nlink = 2, st_mode = 16832, st_uid = 0,<br>          st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096,<br>          st_blocks = 0, st_atim = {tv_sec = 1532054497, tv_nsec = 553300960},<br>          st_mtim = {tv_sec = 1532054692, tv_nsec = 531753344}, st_ctim = {<br>            tv_sec = 1532054692, tv_nsec = 531753344}, __unused = {0, 0, 0}}<br>        __FUNCTION__ = "main"<br>(gdb)<br><br> <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-07-16 15:54 GMT+08:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<div><div class="h5"><br>
<br>
On 04.07.18 09:25, tyd wrote:<br>
> Dear all,<br>
><br>
> I'm trying Kamailio 5.1.4 and IMS module.<br>
> When registering to Kamailio IMS using the same ip and port for 30<br>
> users (different contact user part), the P-CSCF get the same hash<br>
> number and aor value.<br>
><br>
> The function get_aor_hash(_d, &_ci->via_host, _ci->via_port,<br>
> _ci->via_prot) in ims_usrloc_pcscf pcontact.c seems the problem.<br>
> Because hashing with host, port, prot will get the same hash value.<br>
><br>
> Anyone can help this ?<br>
</div></div>I am not using the ims module, but the hash id is typically for speeding<br>
up the searching, there can be collisions also for different values, so<br>
I expect there is a matching rule on other attributes at some point, not<br>
only the hash id.<br>
<br>
Cheers,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" rel="noreferrer" target="_blank">www.asipto.com</a><br>
<a href="http://www.twitter.com/miconda" rel="noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer" target="_blank">www.linkedin.com/in/miconda</a><br>
Kamailio World Conference -- <a href="http://www.kamailioworld.com" rel="noreferrer" target="_blank">www.kamailioworld.com</a><br>
<br>
</font></span></blockquote></div><br></div>