Bug #30768 query cache patch for bug #21074 crashes on windows
Submitted: 3 Sep 2007 11:55 Modified: 5 Nov 2007 2:20
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S3 (Non-critical)
Version:5.0.50 OS:Microsoft Windows (xp)
Assigned to: Kristofer Pettersson CPU Architecture:Any

[3 Sep 2007 11:55] Shane Bester
Description:
When testing bug #21074 patch on 5.0.50 on windows, the server crashes when the query cache is invalidated.

Typical stack trace:
--------------------

movelink  Line 271
hash_delete Line 505
Query_cache::free_query Line 2037
Query_cache::invalidate_table Line 2366
Query_cache::invalidate_table Line 2356
Query_cache::invalidate_table Line 2348
Query_cache::invalidate_table Line 2330
Query_cache::invalidate Line 1362
mysql_insert Line 879
mysql_execute_command Line 3520
mysql_parse Line 6105
dispatch_command Line 1812
do_command Line 1586
handle_one_connection Line 1197
pthread_start Line 62
_callthreadstart Line 293
_threadstart Line 277
FlsSetValue

How to repeat:
point the attached program to a windows box containing the patch for bug #21074 and run.

Suggested fix:
.
[3 Sep 2007 11:56] Shane Bester
testcase. point to windows box and run

Attachment: qc01.c (text/plain), 10.38 KiB.

[3 Sep 2007 11:58] Shane Bester
full stack trace, and variable values at crash

Attachment: bug30768_debugger_output.txt (text/plain), 6.11 KiB.

[11 Sep 2007 21:17] Konstantin Osipov
Hi Kristofer,
Is this released?
[14 Sep 2007 12:07] Kristofer Pettersson
The problem is that pthread_mutex_trylock isn't implemented on windows. Waiting for patch for Bug #30992.
[1 Oct 2007 10:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/34705

ChangeSet@1.2532, 2007-10-01 12:40:45+02:00, thek@adventure.(none) +1 -0
  Bug #30768 query cache patch for bug #21074 crashes on windows
  
  "pthread_mutex_trylock" isn't implemented correctly for the Windows platform.
  
  This temporary patch reverts the patch for bug#21074 for Windows until
  pthread_mutex_trylock is properly implemented.
[1 Oct 2007 10:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/34706

ChangeSet@1.2532, 2007-10-01 12:44:29+02:00, thek@adventure.(none) +1 -0
  Bug #30768 query cache patch for bug #21074 crashes on windows
  
  "pthread_mutex_trylock" isn't implemented correctly for the Windows platform.
  
  This temporary patch reverts the patch for bug#21074 for Windows until
  pthread_mutex_trylock is properly implemented.
[19 Oct 2007 19:31] Marc Alff
Fixed with Bug#30992

Pushed into 5.0.52
[22 Oct 2007 22:10] Paul Dubois
Noted in 5.0.52 changelog.

On Windows, invalidating the query cache could cause a server crash
due to the pthread_mutex_trylock() implementation.
[1 Nov 2007 10:15] Bugs System
Pushed into 6.0.4-alpha
[1 Nov 2007 10:16] Bugs System
Pushed into 5.1.23-rc
[1 Nov 2007 10:17] Bugs System
Pushed into 5.0.52
[5 Nov 2007 2:20] Paul Dubois
Noted in 5.1.23, 6.0.4 changelogs as well.