<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://wiki.integrics.com/index.php?action=history&amp;feed=atom&amp;title=Kamailio_patch_to_stop_crashes_with_TCP_traffic</id>
	<title>Kamailio patch to stop crashes with TCP traffic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.integrics.com/index.php?action=history&amp;feed=atom&amp;title=Kamailio_patch_to_stop_crashes_with_TCP_traffic"/>
	<link rel="alternate" type="text/html" href="http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;action=history"/>
	<updated>2026-09-08T14:10:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=245&amp;oldid=prev</id>
		<title>Dcunningham at 00:54, 26 May 2020</title>
		<link rel="alternate" type="text/html" href="http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=245&amp;oldid=prev"/>
		<updated>2020-05-26T00:54:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:54, 26 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;On some systems running Enswitch 3.14 or higher we&#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix it. Apparently the fix went into the 5.1 and 5.2 branches in October 2019. &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;On some systems running Enswitch 3.14 or higher we&#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix it. Apparently the fix went into the 5.1 and 5.2 branches in October 2019. &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Replace the exiting functions unload_perl() and perl_reload() from modules/app_perl/app_perl_mod.c file with the next content:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Replace the exiting functions unload_perl() and perl_reload() from &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;modules/app_perl/app_perl_mod.c or src/&lt;/ins&gt;modules/app_perl/app_perl_mod.c file with the next content:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcunningham</name></author>
	</entry>
	<entry>
		<id>http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=244&amp;oldid=prev</id>
		<title>Dcunningham at 07:01, 25 May 2020</title>
		<link rel="alternate" type="text/html" href="http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=244&amp;oldid=prev"/>
		<updated>2020-05-25T07:01:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:01, 25 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;On some systems running Enswitch 3.14 or higher we&#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix it. Apparently the fix went into the 5.1 and 5.2 branches in October 2019. &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;On some systems running Enswitch 3.14 or higher we&#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix it. Apparently the fix went into the 5.1 and 5.2 branches in October 2019. &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Replace the exiting functions unload_perl() and perl_reload() from app_perl_mod.c file with the next content:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Replace the exiting functions unload_perl() and perl_reload() from &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;modules/app_perl/&lt;/ins&gt;app_perl_mod.c file with the next content:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcunningham</name></author>
	</entry>
	<entry>
		<id>http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=241&amp;oldid=prev</id>
		<title>Dcunningham: Created page with &quot;On some systems running Enswitch 3.14 or higher we&#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix i...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.integrics.com/index.php?title=Kamailio_patch_to_stop_crashes_with_TCP_traffic&amp;diff=241&amp;oldid=prev"/>
		<updated>2020-03-18T00:30:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;On some systems running Enswitch 3.14 or higher we&amp;#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;On some systems running Enswitch 3.14 or higher we&amp;#039;ve noticed Kamailio can crash if there is TCP traffic. The following patch was provided by Daniel-Constantin Mierla to fix it. Apparently the fix went into the 5.1 and 5.2 branches in October 2019. &lt;br /&gt;
&lt;br /&gt;
Replace the exiting functions unload_perl() and perl_reload() from app_perl_mod.c file with the next content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
int unload_perl(PerlInterpreter *p) {&lt;br /&gt;
    /* clean and reset everything */&lt;br /&gt;
    PL_perl_destruct_level = 1;&lt;br /&gt;
    perl_destruct(p);&lt;br /&gt;
    perl_free(p);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * reload function.&lt;br /&gt;
 * Reinitializes the interpreter. Works, but execution for _all_&lt;br /&gt;
 * children is difficult.&lt;br /&gt;
 */&lt;br /&gt;
int perl_reload(void)&lt;br /&gt;
{&lt;br /&gt;
    if(my_perl) {&lt;br /&gt;
        unload_perl(my_perl);&lt;br /&gt;
    }&lt;br /&gt;
    my_perl = parser_init();&lt;br /&gt;
&lt;br /&gt;
#ifdef PERL_EXIT_DESTRUCT_END&lt;br /&gt;
    PL_exit_flags |= PERL_EXIT_DESTRUCT_END;&lt;br /&gt;
#else&lt;br /&gt;
#warning Perl 5.8.x should be used. Please upgrade.&lt;br /&gt;
#warning This binary will be unsupported.&lt;br /&gt;
    PL_exit_flags |= PERL_EXIT_EXPECTED;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    if(my_perl) {&lt;br /&gt;
        LM_DBG(&amp;quot;new perl interpreter initialized\n&amp;quot;);&lt;br /&gt;
        return 0;&lt;br /&gt;
    } else {&lt;br /&gt;
        LM_CRIT(&amp;quot;failed to initialize a new perl interpreter - exiting\n&amp;quot;);&lt;br /&gt;
        exit(-1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dcunningham</name></author>
	</entry>
</feed>