Hello Daniel

Thank you for your response. Kamailio from 4.3.2 source tarball
I got the core file now. After running backtrace i realized that the problem might be related to our custom module we are developing.
Here is the backtrace:

Reading symbols from /usr/local/sbin/kamailio...done.
[New LWP 6985]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/sbin/kamailio -f /usr/local/etc/kamailio/kamailio.cfg -P /var/run/ka'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:63
63      ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.
(gdb) backtrace
#0  __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:63
#1  0x00007f9aa1f08b09 in vg_digest_authenticate_hdr (msg=0x7f9aaae4eca8, realm=0x7ffe4af97700, hftype=HDR_PROXYAUTH_T, method=0x7f9aaae4ecd0, ahdr=0x7ffe4af976f8) at auth.c:75
#2  0x00007f9aa1f08da8 in w_vg_auth (pmsg=0x7f9aaae4eca8) at auth.c:230
#3  0x0000000000444a19 in do_action (h=0x7ffe4af97da0, a=0x7f9aaadaf628, msg=0x7f9aaae4eca8) at action.c:1053
#4  0x0000000000450a29 in run_actions (h=0x7ffe4af97da0, a=0x7f9aaadaf628, msg=0x7f9aaae4eca8) at action.c:1548
#5  0x0000000000451067 in run_actions_safe (h=0x7ffe4af99480, a=0x7f9aaadaf628, msg=0x7f9aaae4eca8) at action.c:1613
#6  0x000000000041da42 in rval_get_int (h=0x7ffe4af99480, msg=0x7f9aaae4eca8, i=0x7ffe4af98148, rv=0x7f9aaadaf750, cache=0x0) at rvalue.c:912
#7  0x0000000000421bf7 in rval_expr_eval_int (h=0x7ffe4af99480, msg=0x7f9aaae4eca8, res=0x7ffe4af98148, rve=0x7f9aaadaf748) at rvalue.c:1906
#8  0x0000000000421fc6 in rval_expr_eval_int (h=0x7ffe4af99480, msg=0x7f9aaae4eca8, res=0x7ffe4af98580, rve=0x7f9aaadafe48) at rvalue.c:1914
#9  0x0000000000444563 in do_action (h=0x7ffe4af99480, a=0x7f9aaadb10b0, msg=0x7f9aaae4eca8) at action.c:1029
#10 0x0000000000450a29 in run_actions (h=0x7ffe4af99480, a=0x7f9aaadb10b0, msg=0x7f9aaae4eca8) at action.c:1548
#11 0x0000000000444988 in do_action (h=0x7ffe4af99480, a=0x7f9aaadb2010, msg=0x7f9aaae4eca8) at action.c:1044
#12 0x0000000000450a29 in run_actions (h=0x7ffe4af99480, a=0x7f9aaadab968, msg=0x7f9aaae4eca8) at action.c:1548
#13 0x0000000000441770 in do_action (h=0x7ffe4af99480, a=0x7f9aaad68448, msg=0x7f9aaae4eca8) at action.c:677
#14 0x0000000000450a29 in run_actions (h=0x7ffe4af99480, a=0x7f9aaad68098, msg=0x7f9aaae4eca8) at action.c:1548
#15 0x000000000045112f in run_top_route (a=0x7f9aaad68098, msg=0x7f9aaae4eca8, c=0x0) at action.c:1634
#16 0x000000000056ffb4 in receive_msg (buf=0x7f9a9e14ff50 "PUBLISH sip:5678*0002@XXX.XXX.XX.XXX;transport=TCP SIP/2.0\r\nVia: SIP/2.0/TCP 192.168.1.20:41329;branch=z9hG4bK-524287-1---f71b84e56e32cb58\r\nMax-Forwards: 69\r\nContact: <sip:5678*0002@192.168.1.20:41329"..., len=1243,
    rcv_info=0x7f9a9e14fc78) at receive.c:196
#17 0x00000000005f389c in receive_tcp_msg (tcpbuf=0x7f9a9e14ff50 "PUBLISH sip:5678*0002@XXX.XXX.XX.XXX;transport=TCP SIP/2.0\r\nVia: SIP/2.0/TCP 192.168.1.20:41329;branch=z9hG4bK-524287-1---f71b84e56e32cb58\r\nMax-Forwards: 69\r\nContact: <sip:5678*0002@192.168.1.20:41329"..., len=1243,
    rcv_info=0x7f9a9e14fc78, con=0x7f9a9e14fc60) at tcp_read.c:1200
#18 0x00000000005f5389 in tcp_read_req (con=0x7f9a9e14fc60, bytes_read=0x7ffe4af9986c, read_flags=0x7ffe4af99868) at tcp_read.c:1401
#19 0x00000000005f78ff in handle_io (fm=0x7f9aaae3a9a8, events=1, idx=-1) at tcp_read.c:1568
#20 0x00000000005ec052 in io_wait_loop_epoll (h=0xa35940 <io_w>, t=2, repeat=0) at io_wait.h:1061
#21 0x00000000005f920b in tcp_receive_loop (unix_sock=74) at tcp_read.c:1733
#22 0x00000000004cc0c5 in tcp_init_children () at tcp_main.c:4787
#23 0x0000000000503f01 in main_loop () at main.c:1658
#24 0x00000000005097f7 in main (argc=9, argv=0x7ffe4af99d98) at main.c:2533



On Wed, Sep 30, 2015 at 9:51 AM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

are you running the last kamailio branch 4.3 or is from packages?

Do you get a core dump file? If yes, can you send the backtrace?

Daniel


On 29/09/15 23:07, huseyin kalyoncu wrote:
Hello Daniel,

I have been having some strange crashes after upgrade to 4.3.2

i did not configure for core dump but when i check the kern.log after crash i see this:

Sep 29 22:47:19 km1 kernel: [1815465.204612] kamailio[4211]: segfault at 60 ip 00007f64319df2e4 sp 00007ffe99c703b8 error 4 in libc-2.19.so[7f643194a000+19f000]
Sep 29 22:47:19 km1 kernel: [1815465.413074] kamailio[4201]: segfault at f0f0f100 ip 00007f64287c7915 sp 00007ffe99c72600 error 4 in pua_dialoginfo.so[7f64287be000+13000]


On Mon, Sep 28, 2015 at 1:15 PM, huseyin kalyoncu <hkalyoncu@gmail.com> wrote:

Hello Daniel

Sorry for the late response. Yes,  when i change subs_db_mode to 3 i see lots of error messages as below.
5678*002 is the subscriber for 5678*012 and 5678*011. When all phones idle, everything is fine all lamps are green. 
But when i make a call i see error messages and nothing changes with the lamps.
Sorry for inconvenience but I had to mask public IP addresses in the logs. 
I am using Kamailio version 4.3.2 and Postgresql-server 9.4.3 as DB.
root@km1:~# uname -a
Linux km1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux
 
Btw i tried to separate presence server from proxy but nothing changes and i saw the same errors as below.

Thanks

Huseyin 



1:45:45 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:277]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Sep 28 11:45:45 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:281]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*002, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012]
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:290]: db_postgres_submit_query(): 0x7f0dd4497060 PQsendQuery Error: ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*002, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012 Query: update presentity set etag='*#-OFFLINE-#*',expires=1443433545,body='<?xml version="1.0"?>#012<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="00000000000" state="full" entity="sip:5678*002@XXX.XXX.XX.XXX">#012  <dialog id="1074899713" call-id="1074899713" direction="recipient">#012    <state>terminated</state>#012    <remote>#012      <identity>sip:5678*011@XXX.XXX.XX.XXX</identity>#012      <target uri="sip:5678*011@XXX.XXX.XX.XXX:5060"/>#012    </remote>#012    <local>#012      <identity>sip:5678*002@XXX.XXX.XX.XXX:5060</identity>#012      <target uri="sip:5678*002@XXX.XXX.XX.XXX:5060"/>#012    </local>#012  </dialog>#012</dialog-info>#012' where username='5678*002' AND domain='XXX.XXX.XX.XXX' AND event='dialog' AND etag='a.1442821424.10032.187.0'
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: <core> [db_query.c:339]: db_do_update(): error while submitting query
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:580]: db_postgres_store_result(): invalid query, execution aborted
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:581]: db_postgres_store_result(): driver error: PGRES_FATAL_ERROR, ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*002, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.
Sep 28 11:45:45 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:690]: db_postgres_update(): unexpected result returned
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: presence [presentity.c:1324]: mark_presentity_for_delete(): unsuccessful sql update operation
Sep 28 11:45:45 km1 kamailio_presence[10037]: ERROR: presence [publish.c:169]: msg_presentity_clean(): Marking presentity
Sep 28 11:45:47 km1 kamailio_presence[10036]: INFO: presence [subscribe.c:1601]: get_database_info(): No matching subscription dialog found in database
Sep 28 11:45:47 km1 kamailio_presence[10036]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:45:55 km1 kamailio_presence[10035]: ERROR: presence [subscribe.c:1617]: get_database_info(): wrong sequence number received: 22 - stored: 22
Sep 28 11:45:55 km1 kamailio_presence[10035]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:45:55 km1 kamailio_presence[10036]: INFO: presence [subscribe.c:1601]: get_database_info(): No matching subscription dialog found in database
Sep 28 11:45:55 km1 kamailio_presence[10036]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:46:03 km1 kamailio_presence[10031]: ERROR: presence [subscribe.c:1617]: get_database_info(): wrong sequence number received: 22 - stored: 22
Sep 28 11:46:03 km1 kamailio_presence[10031]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:46:03 km1 kamailio_presence[10033]: INFO: presence [subscribe.c:1601]: get_database_info(): No matching subscription dialog found in database
Sep 28 11:46:03 km1 kamailio_presence[10033]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:46:11 km1 kamailio_presence[10034]: ERROR: presence [subscribe.c:1617]: get_database_info(): wrong sequence number received: 22 - stored: 22
Sep 28 11:46:11 km1 kamailio_presence[10034]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:46:11 km1 kamailio_presence[10035]: INFO: presence [subscribe.c:1601]: get_database_info(): No matching subscription dialog found in database
Sep 28 11:46:11 km1 kamailio_presence[10035]: INFO: presence [subscribe.c:949]: handle_subscribe(): getting stored info
Sep 28 11:46:25 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:277]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Sep 28 11:46:25 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:281]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012]
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:290]: db_postgres_submit_query(): 0x7f0dd4497060 PQsendQuery Error: ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012 Query: update presentity set etag='*#-OFFLINE-#*',expires=1443433585,body='<?xml version="1.0"?>#012<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="00000000000" state="full" entity="sip:5678*012@XXX.XXX.XX.XXX">#012  <dialog id="CLaNCoBMpzbMBIZ6wPvEFw.." call-id="CLaNCoBMpzbMBIZ6wPvEFw.." direction="recipient">#012    <state>terminated</state>#012    <remote>#012      <identity>sip:5678*002@XXX.XXX.XX.XXX;transport=TCP</identity>#012      <target uri="sip:5678*002@192.168.1.20:63157;transport=tcp;alias=XXX.XXX.XX.XXX~49663~2"/>#012    </remote>#012    <local>#012      <identity>sip:5678*012@XXX.XXX.XX.XXX;transport=TCP</identity>#012      <target uri="sip:5678*012@XXX.XXX.XX.XXX;transport=TCP"/>#012    </local>#012  </dialog>#012</dialog-info>#012' where username='5678*012' AND domain='XXX.XXX.XX.XXX' AND event='dialog' AND etag='a.1442821424.10036.177.0'
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: <core> [db_query.c:339]: db_do_update(): error while submitting query
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:580]: db_postgres_store_result(): invalid query, execution aborted
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:581]: db_postgres_store_result(): driver error: PGRES_FATAL_ERROR, ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.
Sep 28 11:46:25 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:690]: db_postgres_update(): unexpected result returned
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: presence [presentity.c:1324]: mark_presentity_for_delete(): unsuccessful sql update operation
Sep 28 11:46:25 km1 kamailio_presence[10037]: ERROR: presence [publish.c:169]: msg_presentity_clean(): Marking presentity
Sep 28 11:47:05 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:277]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)
Sep 28 11:47:05 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:281]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012]
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:290]: db_postgres_submit_query(): 0x7f0dd4497060 PQsendQuery Error: ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.#012 Query: update presentity set etag='*#-OFFLINE-#*',expires=1443433625,body='<?xml version="1.0"?>#012<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="00000000000" state="full" entity="sip:5678*012@XXX.XXX.XX.XXX">#012  <dialog id="CLaNCoBMpzbMBIZ6wPvEFw.." call-id="CLaNCoBMpzbMBIZ6wPvEFw.." direction="recipient">#012    <state>terminated</state>#012    <remote>#012      <identity>sip:5678*002@XXX.XXX.XX.XXX;transport=TCP</identity>#012      <target uri="sip:5678*002@192.168.1.20:63157;transport=tcp;alias=XXX.XXX.XX.XXX~49663~2"/>#012    </remote>#012    <local>#012      <identity>sip:5678*012@XXX.XXX.XX.XXX;transport=TCP</identity>#012      <target uri="sip:5678*012@XXX.XXX.XX.XXX;transport=TCP"/>#012    </local>#012  </dialog>#012</dialog-info>#012' where username='5678*012' AND domain='XXX.XXX.XX.XXX' AND event='dialog' AND etag='a.1442821424.10036.177.0'
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: <core> [db_query.c:339]: db_do_update(): error while submitting query
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:580]: db_postgres_store_result(): invalid query, execution aborted
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: db_postgres [km_dbase.c:581]: db_postgres_store_result(): driver error: PGRES_FATAL_ERROR, ERROR:  duplicate key value violates unique constraint "presentity_presentity_idx"#012DETAIL:  Key (username, domain, event, etag)=(5678*012, XXX.XXX.XX.XXX, dialog, *#-OFFLINE-#*) already exists.
Sep 28 11:47:05 km1 kamailio_presence[10037]: WARNING: db_postgres [km_dbase.c:690]: db_postgres_update(): unexpected result returned
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: presence [presentity.c:1324]: mark_presentity_for_delete(): unsuccessful sql update operation
Sep 28 11:47:05 km1 kamailio_presence[10037]: ERROR: presence [publish.c:169]: msg_presentity_clean(): Marking presentity


  

On Fri, Sep 11, 2015 at 1:16 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

I will adjust the tutorial to make the note about PUBLISH looping back and need to authorize it by IP check.

Regarding "db_mode", are you referring to "subs_db_mode" parameter?

Cheers,
Daniel




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users