<div dir="ltr"><div style>Hi,</div><div style><br></div><div style>I&#39;m getting segfault while doing sql_query in mod-init, something I&#39;m making wrong?</div><div style><br></div><div style><div>event_route[htable:mod-init] {</div>
<div><span class="" style="white-space:pre">        </span>sql_query(&quot;ca&quot;,&quot;SELECT * FROM carrier_name&quot;, &quot;ra&quot;);</div><div><span class="" style="white-space:pre">        </span>if ($dbr(ra=&gt;rows)&gt;0) {</div>
<div><span class="" style="white-space:pre">                </span>xlog(&quot;L_INFO&quot;,&quot;TEST&quot;);</div><div><span class="" style="white-space:pre">        </span>}<br></div><div>}<br></div></div><div style><br></div><div style>cr kernel: [66373.805099] kamailio[8382]: segfault at 0 ip (null) sp bfec3c2c error 4 in kamailio[8048000+1eb000]<br>
</div><div>cr kamailio: ERROR: &lt;core&gt; [daemonize.c:307]: Main process exited before writing to pipe</div><div><br></div><div><div>(gdb) ba</div><div>#0  0x00000000 in ?? ()</div><div>#1  0xa711ae5d in sql_query (msg=0xa75e0bc0, dbl=0xa76009c8 &quot;@\t`\247\002&quot;, query=0xa7677948 &quot;&quot;, res=0xa7607128 &quot;?|&quot;) at sqlops.c:210</div>
<div>#2  0x0805bc13 in do_action (h=0xbfec4178, a=0xa766ddc0, msg=0xa75e0bc0) at action.c:1163</div><div>#3  0x08062c1d in run_actions (h=0xbfec4178, a=0xa766ddc0, msg=0xa75e0bc0) at action.c:1644</div><div>#4  0x08063284 in run_top_route (a=0xa766ddc0, msg=0xa75e0bc0, c=0xbfec4178) at action.c:1729</div>
<div>#5  0xa70bd06f in child_init (rank=-127) at htable.c:207</div><div>#6  0x0811ed87 in init_mod_child (m=0xa75ff248, rank=-127) at sr_module.c:893</div><div>#7  0x0811ed00 in init_mod_child (m=0xa75ff550, rank=-127) at sr_module.c:890</div>
<div>#8  0x0811ed00 in init_mod_child (m=0xa75ffa78, rank=-127) at sr_module.c:890</div><div>#9  0x0811ed00 in init_mod_child (m=0xa75ffc18, rank=-127) at sr_module.c:890</div><div>#10 0x0811ed00 in init_mod_child (m=0xa7600b08, rank=-127) at sr_module.c:890</div>
<div>#11 0x080a7081 in main_loop () at main.c:1587</div><div>#12 0x080a94ef in main (argc=5, argv=0xbfec45e4) at main.c:2546</div></div><div><br></div><div style>Mino</div></div>