Bug in myodbc with threads

"Pierre MARC" <[email protected]> Thu, 23 Feb 2012 10:41:44 +0100
Newsgroups gmane.comp.db.mysql.odbc
Message-ID <[email protected]>
------=_NextPart_000_0015_01CCF217.BCDF4460
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0016_01CCF217.BCDF4460"


------=_NextPart_001_0016_01CCF217.BCDF4460
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello

=20

I=92m not sure this is the correct place to report a bug. Please let me =
know
the correct way if not.

=20

I have a problem with thread management in the odbc driver v. 05.01.0010
(tested on linux only for now). When we open a connection from one =
thread
and close it from another thread we get the message:

=20

Error in my_thread_global_end(): 1 threads didn't exit

=20

We don=92t know what are the consequences of this situation but I=92m =
afraid
that it produces some kind of instability and/or memory leak.

=20

We use the odbc driver with a framework that creates pool of connections =
and
several threads can access the odbc connection (one at a time because =
its
synchronized). Sometimes because of time outs, the connection need to be
closed and reopened by the thread. So this bug is for us a blocking
situation.

=20

Attached is a simple program that reproduces the issue. Just compile it =
on
linux. The usage is:

=20

testodbc2 -s DataSource -u User [-p Password]

=20

Here is the report on my test machine:

=20

Open db source TEST from thread 1720362784

Source successfully connected

Database name: MySQL

Database version: 5.0.51a-community-nt-log

Driver name: libmyodbc5.so

Driver version: 05.01.0010

Driver ODBC version: 03.52

Close db source from thread 1685018368

Error in my_thread_global_end(): 1 threads didn't exit

Source successfully disconnected

=20

I tried with a 3.51 driver and the result is the same.

=20

Thank you to reply in order for me to know if this bug is well =
registered.

=20

Kind regards

=20

Pierre MARC
System Architect
Nirva Systems

=20

Tel & mobile: +33 6 71 43 42 86

=20

 <http://www.nirva-systems.com> http://www.nirva-systems.com (in =
English)
 <http://www.nirva-systems.com/fr/> http://www.nirva-systems.com/fr/ (en
Fran=E7ais)

=20

Nirva Systems - 51 rue Deleuvre - 69004 Lyon - France

=20

Discover Nirva's new features and functionalities for the fall 2011:
<http://www.nirva-systems.com/en/blog/NewsFall2011/NewsFall2011.html>
http://www.nirva-systems.com/en/blog/NewsFall2011/NewsFall2011.html

=20

=20


------=_NextPart_001_0016_01CCF217.BCDF4460
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"><meta name=3DGenerator content=3D"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:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DFR link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p =
class=3DMsoNormal>Hello<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
lang=3DEN-US>I&#8217;m not sure this is the correct place to report a =
bug. Please let me know the correct way if not.<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>I have a problem with thread =
management in the odbc driver v. 05.01.0010 (tested on linux only for =
now). When we open a connection from one thread and close it from =
another thread we get the message:<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Error in my_thread_global_end(): 1 =
threads didn't exit<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>We don&#8217;t know what are the consequences of this =
situation but I&#8217;m afraid that it produces some kind of instability =
and/or memory leak.<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>We use the odbc driver with a framework that creates pool =
of connections and several threads can access the odbc connection (one =
at a time because its synchronized). Sometimes because of time outs, the =
connection need to be closed and reopened by the thread. So this bug is =
for us a blocking situation.<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Attached is a simple program that =
reproduces the issue. Just compile it on linux. The usage =
is:<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>testodbc2 -s DataSource -u User [-p =
Password]<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Here is the report on my test =
machine:<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Open db source TEST from thread =
1720362784<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Source successfully connected<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Database name: =
MySQL<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Database version: =
5.0.51a-community-nt-log<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Driver name: libmyodbc5.so<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Driver version: =
05.01.0010<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Driver ODBC version: 03.52<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Close db source from thread =
1685018368<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Error in my_thread_global_end(): 1 threads didn't =
exit<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>Source =
successfully disconnected<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>I tried with a 3.51 driver and the =
result is the same.<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Thank you to reply in order for me to know if this bug is =
well registered.<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>Kind regards<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>Pierre MARC<br>System =
Architect<br>Nirva Systems<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US>&nbsp;<o:p></o:p></span></p><p =
class=3DMsoNormal>Tel &amp; mobile: +33 6 71 43 42 86<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMsoNormal><a =
href=3D"http://www.nirva-systems.com"><span =
style=3D'color:blue'>http://www.nirva-systems.com</span></a> (in =
English)<br><a href=3D"http://www.nirva-systems.com/fr/"><span =
style=3D'color:blue'>http://www.nirva-systems.com/fr/</span></a> (en =
Fran=E7ais)<o:p></o:p></p><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p =
class=3DMsoNormal>Nirva Systems - 51 rue Deleuvre - 69004 Lyon - =
France<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal><span lang=3DEN-US>Discover Nirva's new features and =
functionalities for the fall 2011:&nbsp;</span><a =
href=3D"http://www.nirva-systems.com/en/blog/NewsFall2011/NewsFall2011.ht=
ml"><span lang=3DEN-US =
style=3D'color:blue'>http://www.nirva-systems.com/en/blog/NewsFall2011/Ne=
wsFall2011.html</span></a><span lang=3DEN-US><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p></div></body></html>
------=_NextPart_001_0016_01CCF217.BCDF4460--

------=_NextPart_000_0015_01CCF217.BCDF4460
Content-Type: application/x-zip-compressed;
	name="testodbc2.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="testodbc2.zip"

UEsDBBQAAAAIANxYVkAmgLoJFAcAAOQXAAANAAAAdGVzdG9kYmMyLmNwcM1Y62/bNhD/rAD+H9gM
TWXHWZMO/VLXAzxHTQzYTmo57YYkMGSJtrXJkitSeSzI/747PvR22nT9UBdFxOPxdw/e8Y5s7Pzi
Lzy6IJ8H49/eNGAUukHiUfL+1g+96Jb9uvo9T93EkUuZotKA0cIkX8XU8dRk6PmL/Czjnh+V4BiP
/XBZIXqBPy8TvwRAIer3+jVxo5iWGOgd1zzAACMaMj8KWVUiQDd2EgZfJHTWlG0clxKQ20E6rJ0K
Q8g64fSuUXKR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
74q4vbIBE/DSSdtxi61Yx9gGif2VBCy35yVgYdXjf1BLAwQUAAAACADTXlZA+xhbNrYAAAAPAQAA
FQAAAHRlc3RvZGJjMi5tYWsubGludXgzMk3OTQuCQBAG4HML+x/msAdF1sBuUpCoiSAGftCeEtOl
BGs33f5/a6R4GXjnHR7GZwwOcLcsjHzGTokX5TrT7v0RigON7S3QoMrCMC0yLy2mEKVllZ/LzA91
SuK0ZEAvL0FbLgfe1Iq3QJ87B6MkWLxkcnqpHgOvdd23vR6ivTX/U4wUH9W0cMB1YQm2wGhDDP2a
CVQAOQK5AjH+sqnLUQ2d1MVkrBRbwJpppFxBzWzt4beaMYy+UEsDBBQAAAAIAN1YVkAvRnOWtwAA
AA8BAAAVAAAAdGVzdG9kYmMyLm1hay5saW51eDY0Tc5NC4JAEAbgcwv7H+bgQZE1iOgQBYmaCGLg
B+0pMXcpwdpNt//fGipeBt55h4fxKIUjPGwbI4/Sc+yGmc6k+XyF4kAiZw3EL9MgSPLUTfIhhElR
Zpci9QKd4igpKJDrWxDGZcfrSnEG5LXbYhT7sxcPTivVs+OVrlvW6iHYvR5PMVK8V8NiA/s9zMER
GK0MU79mARFgnMC4gWGOsqXLXnWN1MVgLBRHwJKppVxA9WQd4L+aMIx+UEsBAhQAFAAAAAgA3FhW
QCaAugkUBwAA5BcAAA0AAAAAAAAAAQAgALaBAAAAAHRlc3RvZGJjMi5jcHBQSwECFAAUAAAACADT
XlZA+xhbNrYAAAAPAQAAFQAAAAAAAAABACAAtoE/BwAAdGVzdG9kYmMyLm1hay5saW51eDMyUEsB
AhQAFAAAAAgA3VhWQC9Gc5a3AAAADwEAABUAAAAAAAAAAQAgALaBKAgAAHRlc3RvZGJjMi5tYWsu
bGludXg2NFBLBQYAAAAAAwADAMEAAAASCQAAAAA=


------=_NextPart_000_0015_01CCF217.BCDF4460
Content-Type: text/plain; charset=us-ascii


-- 
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc
------=_NextPart_000_0015_01CCF217.BCDF4460--