<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">This sounds like a bug in the mysql driver then right? &nbsp;If those are not threadsafe then the driver should protect against use where it is not safe.<div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Apr 6, 2016, at 5:44 AM, Steven Ayre &lt;<a href="mailto:steveayre@gmail.com" class="">steveayre@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I've been doing some debugging on this this week as we're currently seeing regular crashes on our production servers. This happens with both Threading=0 and Threading=2.<div class=""><br class=""></div><div class="">It appears it's a bug in MyODBC triggered because FreeSWITCH uses a new ODBC environment handle every time it creates a connection.</div><div class=""><br class=""></div><div class="">When a environment handle is created myodbc_init is called and when it's freed it calls myodbc_end. Those functions are not thread-safe. They're protected by a reference counter but they aren't wrapped in a mutex so if the server is busy and they're both called at the same time you can result in some global variables being used after they're freed.</div><div class=""><br class=""></div><div class="">Rebuilding MyODBC with an empty myodbc_end appears to stop the crashes, but I'm not saying that's a good solution. Still looking at it.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 22 November 2013 at 20:31, Anthony Minessale <span dir="ltr" class="">&lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank" class="">anthony.minessale@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">I've always seen Threading=0 as the solution to stability probs.<div class="">Basically if the driver already uses mutexing, its better to disable the arbitrary ones in the core of odbc.</div><div class="">For postgres 0 is basically mandatory.</div>
<div class=""><br class=""></div></div><div class="gmail_extra"><div class=""><div class="h5"><br class=""><br class=""><div class="gmail_quote">On Fri, Nov 22, 2013 at 2:12 AM, Steven Ayre <span dir="ltr" class="">&lt;<a href="mailto:steveayre@gmail.com" target="_blank" class="">steveayre@gmail.com</a>&gt;</span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">No such thing in the latest versions, they're all threadsafe now (_r is a symlink to the other).<div class="">
<br class=""></div><div class="">I use it with success. I did find stability problems in libmyodbc when upgrading from 5.0 to 5.5. My solution was to add these to odbc.ini</div>

<div class=""><br class=""></div><div class=""><div class="">Option &nbsp; &nbsp; &nbsp;= 67108864</div></div><div class="">Threading &nbsp; = 2<br class=""></div><div class=""><br class=""></div><div class="">The Threading setting is what stopped the crashes. There's a Jira on the subject and someone else said manually upgrading to a newer version of unixodbc+myodbc also fixed it.</div>


<div class=""><br class=""></div><div class="">-Steve</div><div class=""><br class=""></div></div><div class=""><div class=""><div class="gmail_extra"><br class=""><br class=""><div class="gmail_quote">On 21 November 2013 18:23, Jeff Leung <span dir="ltr" class="">&lt;<a href="mailto:jleung@v10networks.ca" target="_blank" class="">jleung@v10networks.ca</a>&gt;</span> wrote:<br class="">


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class=""><div class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" class="">Try the non-thread safe MySQL library instead of the thread safe one. <u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" class=""><u class=""></u>&nbsp;<u class=""></u></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="">


<div class=""><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in" class=""><p class="MsoNormal"><b class=""><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" class="">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" class=""> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank" class="">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank" class="">freeswitch-users-bounces@lists.freeswitch.org</a>] <b class="">On Behalf Of </b>Vik Killa<br class="">


<b class="">Sent:</b> Thursday, November 21, 2013 10:22 AM<br class=""><b class="">To:</b> FreeSWITCH Users Help<br class=""><b class="">Subject:</b> Re: [Freeswitch-users] Is MySQL OK to use?<u class=""></u><u class=""></u></span></p></div></div><div class=""><div class=""><p class="MsoNormal">

<u class=""></u>&nbsp;<u class=""></u></p><div class=""><p class="MsoNormal">short answer no.<u class=""></u><u class=""></u></p><div class=""><p class="MsoNormal">use postgres<u class=""></u><u class=""></u></p></div></div><div class=""><p class="MsoNormal" style="margin-bottom:12.0pt"><u class=""></u>&nbsp;<u class=""></u></p>


<div class=""><p class="MsoNormal">On Thu, Nov 21, 2013 at 12:41 PM, Alex Lake &lt;<a href="mailto:alex@digitalmail.com" target="_blank" class="">alex@digitalmail.com</a>&gt; wrote:<u class=""></u><u class=""></u></p><p class="MsoNormal">I find these "Error in my_thread_global_end()" messages somewhat<br class="">


annoying in my fs1.2stable on Ubuntu12.04 box. Is there any advice<br class="">(other than "don't use MySQL") for how to install it better? Might it be<br class="">something to do with thread-safe libraries (I'm using libmyodbc_r.so at<br class="">


the moment)<br class=""><br class="">_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services:<br class=""><a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a><br class="">


<a href="http://www.freeswitchsolutions.com/" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class=""><br class="">FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br class=""><a href="http://www.cudatel.com/" target="_blank" class="">http://www.cudatel.com</a><br class="">


<br class="">Official FreeSWITCH Sites<br class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class=""><a href="http://wiki.freeswitch.org/" target="_blank" class="">http://wiki.freeswitch.org</a><br class=""><a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com</a><br class="">


<br class="">FreeSWITCH-users mailing list<br class=""><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class=""><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">


UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><u class=""></u><u class=""></u></p>


</div><p class="MsoNormal"><u class=""></u>&nbsp;<u class=""></u></p></div></div></div></div></div></div><br class="">_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br class="">
<a href="http://www.cudatel.com/" target="_blank" class="">http://www.cudatel.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://wiki.freeswitch.org/" target="_blank" class="">http://wiki.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></div><br class="">_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br class="">
<a href="http://www.cudatel.com/" target="_blank" class="">http://www.cudatel.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://wiki.freeswitch.org/" target="_blank" class="">http://wiki.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div></div></div>-- <br class="">Anthony Minessale II<br class=""><br class="">FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org/</a><br class="">ClueCon <a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com/</a><br class="">
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank" class="">http://twitter.com/FreeSWITCH_wire</a><br class=""><br class="">AIM: anthm<br class=""><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank" class="">MSN:anthony_minessale@hotmail.com</a><br class="">GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank" class="">PAYPAL:anthony.minessale@gmail.com</a><br class="">
IRC: <a href="http://irc.freenode.net/" target="_blank" class="">irc.freenode.net</a> #freeswitch<br class=""><br class="">FreeSWITCH Developer Conference<br class=""><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank" class="">sip:888@conference.freeswitch.org</a><br class=""><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank" class="">googletalk:conf+888@conference.freeswitch.org</a><br class="">
pstn:<a href="tel:%2B19193869900" value="+19193869900" target="_blank" class="">+19193869900</a>
</div>
<br class="">_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" rel="noreferrer" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br class="">
<a href="http://www.cudatel.com/" rel="noreferrer" target="_blank" class="">http://www.cudatel.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://wiki.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://wiki.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></blockquote></div><br class=""></div></div></body></html>