{"action":"created","issue":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/1687","repository_url":"https://api.github.com/repos/kamailio/kamailio","labels_url":"https://api.github.com/repos/kamailio/kamailio/issues/1687/labels{/name}","comments_url":"https://api.github.com/repos/kamailio/kamailio/issues/1687/comments","events_url":"https://api.github.com/repos/kamailio/kamailio/issues/1687/events","html_url":"https://github.com/kamailio/kamailio/issues/1687","id":373705190,"node_id":"MDU6SXNzdWUzNzM3MDUxOTA=","number":1687,"title":"Core generated by Kamailio when a bad char is found in header","user":{"login":"joelsdc","id":16212586,"node_id":"MDQ6VXNlcjE2MjEyNTg2","avatar_url":"https://avatars1.githubusercontent.com/u/16212586?v=4","gravatar_id":"","url":"https://api.github.com/users/joelsdc","html_url":"https://github.com/joelsdc","followers_url":"https://api.github.com/users/joelsdc/followers","following_url":"https://api.github.com/users/joelsdc/following{/other_user}","gists_url":"https://api.github.com/users/joelsdc/gists{/gist_id}","starred_url":"https://api.github.com/users/joelsdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelsdc/subscriptions","organizations_url":"https://api.github.com/users/joelsdc/orgs","repos_url":"https://api.github.com/users/joelsdc/repos","events_url":"https://api.github.com/users/joelsdc/events{/privacy}","received_events_url":"https://api.github.com/users/joelsdc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-24T22:40:17Z","updated_at":"2018-10-25T05:12:44Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n\r\nKamailio dies complaining about a bad char in some header.  I can say that I just updated from the nightly-devel apt repo, this problem never happened in latest v5.1 release.\r\n\r\n### Troubleshooting\r\n\r\n#### Reproduction\r\n\r\nI don't know how to reproduce yet.\r\n\r\n#### Debugging Data\r\n\r\n<!--\r\nIf you got a core dump, use gdb to extract troubleshooting data - full backtrace,\r\nlocal variables and the list of the code at the issue location.\r\n\r\n  gdb /path/to/kamailio /path/to/corefile\r\n  bt full\r\n  info locals\r\n  list\r\n\r\nIf you are familiar with gdb, feel free to attach more of what you consider to\r\nbe relevant.\r\n-->\r\n\r\n[BT-FULL_core.kamailio.3329.1540415468.txt](https://github.com/kamailio/kamailio/files/2512570/BT-FULL_core.kamailio.3329.1540415468.txt)\r\n[BT-FULL_core.kamailio.3330.1540415471.txt](https://github.com/kamailio/kamailio/files/2512571/BT-FULL_core.kamailio.3330.1540415471.txt)\r\n[BT-FULL_core.kamailio.3331.1540415467.txt](https://github.com/kamailio/kamailio/files/2512572/BT-FULL_core.kamailio.3331.1540415467.txt)\r\n[BT-FULL_core.kamailio.3333.1540415469.txt](https://github.com/kamailio/kamailio/files/2512573/BT-FULL_core.kamailio.3333.1540415469.txt)\r\n[INFO-LOCALS_core.kamailio.3329.1540415468.txt](https://github.com/kamailio/kamailio/files/2512574/INFO-LOCALS_core.kamailio.3329.1540415468.txt)\r\n[INFO-LOCALS_core.kamailio.3330.1540415471.txt](https://github.com/kamailio/kamailio/files/2512575/INFO-LOCALS_core.kamailio.3330.1540415471.txt)\r\n[INFO-LOCALS_core.kamailio.3331.1540415467.txt](https://github.com/kamailio/kamailio/files/2512576/INFO-LOCALS_core.kamailio.3331.1540415467.txt)\r\n[INFO-LOCALS_core.kamailio.3333.1540415469.txt](https://github.com/kamailio/kamailio/files/2512577/INFO-LOCALS_core.kamailio.3333.1540415469.txt)\r\n[LIST_core.kamailio.3329.1540415468.txt](https://github.com/kamailio/kamailio/files/2512578/LIST_core.kamailio.3329.1540415468.txt)\r\n[LIST_core.kamailio.3330.1540415471.txt](https://github.com/kamailio/kamailio/files/2512579/LIST_core.kamailio.3330.1540415471.txt)\r\n[LIST_core.kamailio.3331.1540415467.txt](https://github.com/kamailio/kamailio/files/2512580/LIST_core.kamailio.3331.1540415467.txt)\r\n[LIST_core.kamailio.3333.1540415469.txt](https://github.com/kamailio/kamailio/files/2512581/LIST_core.kamailio.3333.1540415469.txt)\r\n\r\n#### Log Messages\r\n\r\n<!--\r\nCheck the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).\r\n-->\r\nThe relevant log lines are:\r\n\r\n```\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: [\"910609864\" <sip:;:929] .\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: \"910609864\" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: [\"910609864\" <sip:;:929] .\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: \"910609864\" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: [\"910609864\" <sip:;:929] .\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: \"910609864\" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: pv [pv_core.c:1892]: pv_get_hdr(): error parsing headers\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: [\"910609864\" <sip:;:929] .\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: \"910609864\" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]\r\nOct 24 16:11:11 sbc01 sbc[3330]: ERROR: pv [pv_core.c:704]: pv_get_callid(): cannot parse Call-Id header\r\n```\r\n\r\n#### SIP Traffic\r\n\r\n<!--\r\nIf the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).\r\n-->\r\n\r\nI have enabled a mirror server to capture all traffic, once the problem happens again I will be able to update this issue with SIP traffic.\r\n\r\n\r\n### Possible Solutions\r\n\r\n### Additional Information\r\n\r\n  * **Kamailio Version** - output of `kamailio -v`\r\n\r\n```\r\nroot@sbc01:/var/tmp# kamailio -v\r\nversion: kamailio 5.2.0-pre1 (x86_64/linux)\r\nflags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 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\r\nADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB\r\npoll method support: poll, epoll_lt, epoll_et, sigio_rt, select.\r\nid: unknown\r\ncompiled with gcc 6.3.0\r\nroot@sbc01:/var/tmp#\r\n```\r\n\r\n* **Operating System**:\r\n\r\n<!--\r\nDetails about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;\r\nKernel details (output of `uname -a`)\r\n-->\r\n\r\n```\r\nroot@sbc01:/var/tmp# uname -a\r\nLinux sbc01 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux\r\nroot@sbc01:/var/tmp#\r\n\r\nroot@sbc01:/var/tmp# lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID:\tDebian\r\nDescription:\tDebian GNU/Linux 9.5 (stretch)\r\nRelease:\t9.5\r\nCodename:\tstretch\r\nroot@sbc01:/var/tmp#\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/comments/432916960","html_url":"https://github.com/kamailio/kamailio/issues/1687#issuecomment-432916960","issue_url":"https://api.github.com/repos/kamailio/kamailio/issues/1687","id":432916960,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjkxNjk2MA==","user":{"login":"miconda","id":184809,"node_id":"MDQ6VXNlcjE4NDgwOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/184809?v=4","gravatar_id":"","url":"https://api.github.com/users/miconda","html_url":"https://github.com/miconda","followers_url":"https://api.github.com/users/miconda/followers","following_url":"https://api.github.com/users/miconda/following{/other_user}","gists_url":"https://api.github.com/users/miconda/gists{/gist_id}","starred_url":"https://api.github.com/users/miconda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miconda/subscriptions","organizations_url":"https://api.github.com/users/miconda/orgs","repos_url":"https://api.github.com/users/miconda/repos","events_url":"https://api.github.com/users/miconda/events{/privacy}","received_events_url":"https://api.github.com/users/miconda/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T05:12:44Z","updated_at":"2018-10-25T05:12:44Z","author_association":"MEMBER","body":"The first two backtraces led to a function related to a new feature added in 5.2, respectively statistics for replies per method. The issue was accessing CSeq header fields without any checks if the header was properly parsed. I pushed a commit for it, referenced above. You can try with latest master and see if now all ok."}}
{"actor":{"display_login":"miconda"}}