Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, December 2007
[Linux] Possible Qt/MySQL threading bug


Message 1 in thread

I'm seeing the following message emitted from somewhere
in the Qt MySQL driver when a thread terminates. The
thread has, during its lifetime, opened a MySQL db
connection:

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

This is generated consistently, on every execution of
the program.

I'm using MySQL 5.0.45 and qt-x11-opensource-src-4.3.2
(that's the latest MySQL, AFAIK).

Google suggests that this problem is not confined to
Qt, but it's not clear to me whether or not it's due
to Qt failing to close down correctly on thread termination,
or if it's a bug that's arisen in MySQL itself.

Anyone know anything about this ?

-- 
 [ signature omitted ] 

Message 2 in thread

Stephen Collyer wrote:
> I'm seeing the following message emitted from somewhere
> in the Qt MySQL driver when a thread terminates. The
> thread has, during its lifetime, opened a MySQL db
> connection:
> 
> "Error in my_thread_global_end(): 1 threads didn't exit"
> 
> This is generated consistently, on every execution of
> the program.
> 
> I'm using MySQL 5.0.45 and qt-x11-opensource-src-4.3.2
> (that's the latest MySQL, AFAIK).
> 
> Google suggests that this problem is not confined to
> Qt, but it's not clear to me whether or not it's due
> to Qt failing to close down correctly on thread termination,
> or if it's a bug that's arisen in MySQL itself.
> 
> Anyone know anything about this ?

And to follow this up, in addition to the message,
there seems to be a pause of several seconds until
the thread terminates completely. This is painful.

-- 
 [ signature omitted ] 

Message 3 in thread

Stephen Collyer wrote:

> Anyone know anything about this ?
> 

Yes, scheduled to be fixed for Qt 4.4:
http://trolltech.com/developer/task-tracker/index_html?method=entry&id=168743


--
 [ signature omitted ] 

Message 4 in thread

Anders Larsen wrote:
> Stephen Collyer wrote:
> 
>> Anyone know anything about this ?
>>
> 
> Yes, scheduled to be fixed for Qt 4.4:
> http://trolltech.com/developer/task-tracker/index_html?method=entry&id=168743

Thanks for the rapid response. I have two questions though.

1. When is 4.4 scheduled for release ?

2. Is there a temporary workaround I can apply to force
a call to mysql_thread_end() from application code ?
Can it be added to my thread's dtor somehow ?

-- 
 [ signature omitted ] 

Message 5 in thread

On torsdag den 13. December 2007, Stephen Collyer wrote:
> 1. When is 4.4 scheduled for release ?

AFAIK, in about 4 to 5 months. I'm using a 4.4 snapshot for one of my 
projects, and it works well enough for you to use for daily work.

It might be that you can take the mysql driver code in 4.4 and port the 
changes to your 4.3 driver. Unless there are other things done in the sql 
drivers, this shouldn't be too hard.

Bo.

-- 
 [ signature omitted ] 

Message 6 in thread

Anders Larsen wrote:
> Stephen Collyer wrote:
> 
>> Anyone know anything about this ?
>>
> 
> Yes, scheduled to be fixed for Qt 4.4:
> http://trolltech.com/developer/task-tracker/index_html?method=entry&id=168743

Anders

I've restructured my code somewhat, and this problem seems
to have disappeared, rather mysteriously. I can now open
a connection to mysql in a thread, run queries against it,
and close it, without any sign of the problem. I've no idea
what difference my changes should make, but they seem to
fix the problem. Are you interested in seeing the code ?

-- 
 [ signature omitted ]