### Description
Periodically Kamailio crashes, log shows that it happens on REGISTER request with incorrect params. I don't know if it is a network problem or somebody sends incorrect request, but there are records in logs:
#### Log Messages
Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: ERROR: <core> [core/parser/parse_from.c:53]: parse_from_header(): bad msg or missing FROM header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: ERROR: dialog [dlg_cseq.c:93]: dlg_cseq_prepare_msg(): cannot parse FROM header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: ERROR: pv [pv_core.c:664]: pv_get_callid(): cannot parse Call-Id header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: {1 <null> <null>} ERROR: <core> [core/parser/parse_from.c:53]: parse_from_header(): bad msg or missing FROM header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: {1 <null> <null>} ERROR: pv [pv_core.c:468]: pv_get_from_attr(): cannot parse From header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: {1 <null> <null>} ERROR: pv [pv_core.c:664]: pv_get_callid(): cannot parse Call-Id header Jan 30 03:49:29 kam /usr/sbin/kamailio[20718]: {1 <null> <null>} NOTICE: <script>: REQ: M='REGISTER sip:1.2.3.208:5060' F='<null>' T='<null>' CI='<null>' SRC='113.128.105.127:49556' AU='<null>' Jan 30 03:49:29 kam /usr/sbin/kamailio[20736]: CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 15 Jan 30 03:49:29 kam /usr/sbin/kamailio[20713]: ALERT: <core> [main.c:746]: handle_sigs(): child process 20718 exited by a signal 11 Jan 30 03:49:29 kam /usr/sbin/kamailio[20713]: ALERT: <core> [main.c:749]: handle_sigs(): core was not generated Jan 30 03:49:29 kam /usr/sbin/kamailio[20713]: INFO: <core> [main.c:771]: handle_sigs(): terminating due to SIGCHLD
### Additional Information
version: kamailio 5.2.0-dev2 (i386/linux) flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled with gcc 4.9.2
* **Operating System**: Linux kam 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
Having the coredump will help to find the issue, please try to enable it. https://www.kamailio.org/wiki/tutorials/troubleshooting/coredumpfile
Having the SIP message that produces the issue too, please provide a pcap. https://github.com/irontec/sngrep/ is a really easy tool for that
Thanks, I'll get the core dump. It is harder to get a siptrace, as our SIP message tracking systems seem to ignore this request, maybe due to its incorrect format. I'll try to dump a traffic for some time with tcpdump and give details about SIP message.
@kbdfck - if you get the coredump, the sip message will be inside it. Having the backtrace from corefile with gdb is important here.
@miconda thanks, got it. For some reason I can't reproduce this yet, maybe due to absence of production load. I activated core dumps, will update issue in case of reproduction.
Closed #1420.
OK, closing it then. Reopen or create a new item if something wrongs pops up again.
Seems it crashes when receiving register request like this:
REGISTER sip:1.2.3.4:5060 SIP/2.0 Via: SIP/2.0/UDP 1.2.3.4:5060;branch=z9hG4bK724588683
I can't reproduce this:
0(15468) DEBUG: <core> [core/udp_server.c:491]: udp_rcv_loop(): received on udp socket: (90/87/87) [[REGISTER sip:1.2.3.4:5060 SIP/2.0 0A Via: SIP/2.0/UDP 1.2.3.4:5060;branch=z9hG4bK724588683]] 0(15468) DEBUG: <core> [core/parser/msg_parser.c:610]: parse_msg(): SIP Request: 0(15468) DEBUG: <core> [core/parser/msg_parser.c:612]: parse_msg(): method: <REGISTER> 0(15468) DEBUG: <core> [core/parser/msg_parser.c:614]: parse_msg(): uri: sip:1.2.3.4:5060 0(15468) DEBUG: <core> [core/parser/msg_parser.c:616]: parse_msg(): version: <SIP/2.0> 0(15468) ERROR: <core> [core/parser/parse_via.c:1324]: parse_via_param(): failure parsing via param 0(15468) ERROR: <core> [core/parser/parse_via.c:2704]: parse_via(): parsing via on: <SIP/2.0/UDP 1.2.3.4:5060;branch=z9hG4bK724588683> 0(15468) ERROR: <core> [core/parser/parse_via.c:2710]: parse_via(): via parse error 0(15468) ERROR: <core> [core/parser/msg_parser.c:125]: get_hdr_field(): bad via 0(15468) DEBUG: <core> [core/parser/msg_parser.c:279]: get_hdr_field(): error exit 0(15468) ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [Via: SIP/2.0/UDP 1.2.3.4:5060;branch=z9hG4bK724588683] 0(15468) ERROR: <core> [core/parser/msg_parser.c:681]: parse_msg(): ERROR: parse_msg: message=<REGISTER sip:1.2.3.4:5060 SIP/2.0 Via: SIP/2.0/UDP 1.2.3.4:5060;branch=z9hG4bK724588683> 0(15468) ERROR: <core> [core/receive.c:231]: receive_msg(): core parsing of SIP message failed (127.0.0.1:38418/1)
./kamailio -V version: kamailio 5.2.0-dev7 (x86_64/linux) 491e19
Can you post a backtrace with gdb, and ideally a debug log of the crash?
Reopened #1420.
@kbdfck - any update on this?
Closed #1420.
Closing again on no update after not being able to reproduce.