Bug #38374 Service interface throwing assertions in mysql-6.0-rpl tree after patch
Submitted: 25 Jul 2008 12:30 Modified: 27 Aug 2008 2:13
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.7 OS:Any
Assigned to: Chuck Bell CPU Architecture:Any
Tags: crash, pushbuild, single, test failure

[25 Jul 2008 12:30] Chuck Bell
Description:
When the patch for BUG#36929 was applied to the 6.0-rpl tree, it caused the code called from inside si_objects.cc to trigger an assertion added by the bug patch.

The assertion (see below) was added to the store_globals() method to ensure mysys_var is null when called.

+  /*
+    mysys_var is concurrently readable by a killer thread.
+    LOCK_delete is not needed to lock while the pointer is
+    changing from NULL not non-NULL.
+  */
+  DBUG_ASSERT(mysys_var == NULL);

However, then the code in si_objects.cc in method ViewBaseObjectsIterator::create() called store_globals() the second time (@ line #1403), it triggers the assertion.

How to repeat:
Build with latest mysql-6.0-rpl and run backup suite of tests.

Suggested fix:
@@ -1400,6 +1400,13 @@ ViewBaseObjectsIterator::create(THD *thd
   close_thread_tables(my_thd);
   delete my_thd;

+  /*
+    The mysys_var context is no longer valid and must be reset.
+  */
+  pthread_mutex_lock(&thd->LOCK_delete);
+  thd->mysys_var= NULL;
+  pthread_mutex_unlock(&thd->LOCK_delete);
+
   thd->store_globals();

   return new ViewBaseObjectsIterator(table_names);
[25 Jul 2008 12:31] Chuck Bell
Triage set to default.
[25 Jul 2008 12:40] 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/50499

2686 Chuck Bell	2008-07-25
      BUG#38374 Service interface throwing assertions in mysql-6.0-rpl tree after patch 
      
      Code throws assertion because the mysys_var settings were changed in the 
      ViewBaseObjectsIterator::create() method. The mysys_var must be set to
      NULL so that store_globals() can correctly reset it.
[25 Jul 2008 12:44] Rafal Somla
Good to push.
[25 Jul 2008 13:24] Øystein Grøvlen
Patch looks good.  Approved.
[28 Jul 2008 20:48] 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/50607

2691 Chuck Bell	2008-07-28
      BUG#38374 Service interface throwing assertions in mysql-6.0-rpl tree after patch 
            
      Code throws assertion because the mysys_var settings were changed in the 
      ViewBaseObjectsIterator::create() method. The mysys_var must be set to
      NULL so that store_globals() can correctly reset it.
[28 Jul 2008 20:51] 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/50608

2691 Chuck Bell	2008-07-28
      BUG#38374 Service interface throwing assertions in mysql-6.0-rpl tree after patch 
            
      Code throws assertion because the mysys_var settings were changed in the 
      ViewBaseObjectsIterator::create() method. The mysys_var must be set to
      NULL so that store_globals() can correctly reset it.
[5 Aug 2008 2:54] 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/50905

2692 He Zhenxing	2008-08-04 [merge]
      Merge from mysql-5.1-rpl
[25 Aug 2008 21:00] Chuck Bell
Released in 6.0.5
[27 Aug 2008 1:52] Paul DuBois
Bug did not appear in any released version. No changelog entry needed.
[30 Jan 2009 13:28] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463) (version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers: 6.0.10-alpha) (pib:6)