List:MySQL++« Previous MessageNext Message »
From:KiberGus Date:March 30 2011 1:03pm
Subject:thread_start() should ALWAYS be called after mysql_init()
View as plain text  
Today I've stucked in quite a veird bug. My application was written according to
http://tangentsoft.net/mysql++/doc/html/userman/threads.html
And
mysqlpp::Connection::thread_start();
was called before grabbing connection from connection pool.
thread_start was called before mysql_init on a first call. As a result
pthread_getspecific() was called with an unallocated pthread key as an
argument. This bug is especially hard to find because thread key has 0
value by default and would recieve 0 value on first call to
pthread_key_create. So you would never notice this if you don't use
thread specific pointers anywhere else beside mysql.
But i have used libmysql which uses it too.

Similar bug is described here:
http://bugs.php.net/bug.php?id=28547

Please fix documentation.

By the way, previous version of mysql++ required to pass mysql
connection to thread_start() so t was not possible to call it without
initializing connection and calling mysql_init(). Please bet this
argument back.

Thanks.
Thread
thread_start() should ALWAYS be called after mysql_init()KiberGus30 Mar
  • Re: thread_start() should ALWAYS be called after mysql_init()Jonathan Wakely30 Mar
    • Re: thread_start() should ALWAYS be called after mysql_init()KiberGus30 Mar
      • Re: thread_start() should ALWAYS be called after mysql_init()Warren Young31 Mar
Re: thread_start() should ALWAYS be called after mysql_init()KiberGus4 Apr
  • Re: thread_start() should ALWAYS be called after mysql_init()KiberGus4 Apr
  • Re: thread_start() should ALWAYS be called after mysql_init()Warren Young4 Apr
    • Re: thread_start() should ALWAYS be called after mysql_init()Warren Young4 Apr
Re: thread_start() should ALWAYS be called after mysql_init()Raymond Boettcher5 Apr