<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hello list,<o:p></o:p></p>
<p class="MsoNormal">I`ve found a negative phenomenon during startup of kamailio 3.1.x (orgininally found in version 3.1.5) that results in a core dump, triggered by the snmpstats module.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">During startup of the SIP proxy server machine the linux service &quot;heartbeat&quot; is responsible for starting required ressources like mysql, kamailio and snmpd. These services are monitored by the tool &quot;monit&quot;.<o:p></o:p></p>
<p class="MsoNormal">Monit is supervising the state of the named services and if kamailio is not up and running, monit is trying to restart the service. During startup the mysql database takes some time until it is ready to use<o:p></o:p></p>
<p class="MsoNormal">and therefore kamailio can`t connect to the database. Monit is detecting this and restarting kamailio. This is done so often until kamailio is up and running.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Finally all services are up and running and the machine is working fine. However, I do not like the core dump that was created during this &quot;restart phase&quot;. As soon as the module &quot;snmpstats&quot; is not used, no<o:p></o:p></p>
<p class="MsoNormal">core dump is created any more.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Information about the core dump looks as follows:<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">(1) output of kamailio log files:<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; kamailio: INFO: &lt;core&gt; [tcp_main.c:4726]: init_tcp: using epoll_lt as the io watch method (auto detected)<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: ERROR: db_mysql [km_my_con.c:109]: driver error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: ERROR: &lt;core&gt; [db.c:289]: could not add connection to the pool<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: ERROR: lcr [lcr_mod.c:359]: unable to connect to the database<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: ERROR: lcr [lcr_mod.c:571]: unable to open database connection<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: ERROR: &lt;core&gt; [sr_module.c:875]: init_mod(): Error while initializing module lcr (/usr/lib/kamailio/modules/lcr.so)<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3027]: INFO: snmpstats [snmpstats.c:387]: The SNMPStats module got the kill signal<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; kamailio: ERROR: &lt;core&gt; [daemonize.c:307]: Main process exited before writing to pipe<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; kamailio: INFO: &lt;core&gt; [tcp_main.c:4726]: init_tcp: using epoll_lt as the io watch method (auto detected)<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; kamailio: WARNING: &lt;core&gt; [daemonize.c:352]: pid file contains old pid, replacing pid<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: usrloc [hslot.c:53]: locks array size 512<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: auth [auth_mod.c:312]: auth: qop set, but nonce-count (nc_enabled) support disabled<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: pua [pua.c:360]: the query returned no result<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: pike [ip_tree.c:88]: probing 256 set size<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: &lt;core&gt; [udp_server.c:178]: INFO: udp_init: SO_RCVBUF is initially 111616<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3322]: INFO: &lt;core&gt; [udp_server.c:229]: INFO: udp_init: SO_RCVBUF is finally 262142<o:p></o:p></p>
<p class="MsoNormal">&lt;prefix&gt; /usr/sbin/kamailio[3329]: INFO: mi_datagram [mi_datagram.c:326]: a new child 0/3329<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">(2) output of GDB / core file:<o:p></o:p></p>
<p class="MsoNormal">Core was generated by `/usr/sbin/kamailio -P /var/run/kamailio/kamailio.pid -m 1024 -u kamailio -g kama'.<o:p></o:p></p>
<p class="MsoNormal">Program terminated with signal 11, Segmentation fault.<o:p></o:p></p>
<p class="MsoNormal">[New process 3027]<o:p></o:p></p>
<p class="MsoNormal">#0&nbsp; 0xb775539c in freeInterprocessBuffer () at interprocess_buffer.c:354<o:p></o:p></p>
<p class="MsoNormal">354&nbsp;&nbsp;&nbsp;&nbsp; interprocess_buffer.c: No such file or directory.<o:p></o:p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in interprocess_buffer.c<o:p></o:p></p>
<p class="MsoNormal">(gdb)<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I know that it is not a fine method in killing kamailio during initialisation. But I have not found a better way yet. The other modules like LCR have no problem with the kill signal during initialisation.<o:p></o:p></p>
<p class="MsoNormal">My main question is now: how could these core dumps being avoided? Did anybody have the same experience as me?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks in advance,<o:p></o:p></p>
<p class="MsoNormal"><span lang="DE-AT">Klaus<o:p></o:p></span></p>
</div>
</body>
</html>