[CONC-27] crash in mysql_thread_end Created: 2013-05-21  Updated: 2013-06-17  Resolved: 2013-06-17

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Janani SriGuha Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows, Visual Studio 10


Attachments: Text File mariadb_test.cpp    

 Description   

When multiple MySQL objects are created in the same thread, and mysql_thread_end is called when destroying each object, it crashes.

This does not happen with the MySQL client library.

Have attached sample code.



 Comments   
Comment by Vladislav Vaintroub [ 2013-05-21 ]

Just a remark - it is not the correct way to use mysq_thread_end(). It should not be called once per "object" (whatever it is), but once per OS thread, if you do not plan to to make mysql calls anymore in this thread.

Comment by Janani SriGuha [ 2013-05-21 ]

Yes we are aware of that. However in MySQL, this case does not cause a crash, but in MariaDB it does.

Comment by Vladislav Vaintroub [ 2013-05-21 ]

That it does not crash in MySQL just means you're lucky. This does not mean that one can rely on undocumented behavior in APIs

Comment by Janani SriGuha [ 2013-05-21 ]

True
though the MySQL API has a check which prevents the crash.

Comment by Janani SriGuha [ 2013-05-29 ]

Just found out this (crashing) happens only in a Windows environment. It works fine in linux.

Comment by Georg Richter [ 2013-06-17 ]

Fixed in rev. 67

Generated at Thu Feb 08 03:02:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.