Bug #42685 valgrind errors setting backup_progress_log_file
Submitted: 9 Feb 2009 9:57 Modified: 26 Mar 2009 23:55
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.10 OS:Any
Assigned to: Chuck Bell CPU Architecture:Any
Tags: backup_progress_log_file, valgrind

[9 Feb 2009 9:57] Shane Bester
Description:
setting backup_progress_log_file to incorrect value causes valgrind errors

How to repeat:
set global backup_progress_log_file = repeat('a',1024000);
set global backup_progress_log_file = repeat('a',1024000000);
show warnings;
[9 Feb 2009 10:00] MySQL Verification Team
valgrind errors, and corrupted error message sent to client ...

Attachment: bug42685_valgrind_output.txt (text/plain), 19.49 KiB.

[9 Feb 2009 14:15] MySQL Verification Team
related to bug #42695
[11 Feb 2009 10:38] Sveta Smirnova
Thank you for the report.

Verified as described.
[25 Feb 2009 18:12] Chuck Bell
Bug stolen from Jorgen because it is very similar to BUG#42695.
[25 Feb 2009 18:16] Chuck Bell
Since the problem is in the sys_check_log_path() method and the backup log path variables use this method, and since it is the same as the query and slow log, this problem applies to all four log file path variables.

The solution is to restrict the size of the path allowed and throw an error if the user attempts to assign a path longer than FN_REFLEN.
[25 Feb 2009 19:59] 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/67606

2780 Chuck Bell	2009-02-25
      BUG#42695 : memory leak when setting backupdir
      BUG#42685 : valgrind errors setting backup_progress_log_file
      
      The patch for these bugs both use the new error message and in many
      ways similar so thus the combined patch.
      
      This patch adds code to detect when users attempt to set a path 
      longer than FN_REFLEN. 
      
      For BUG#42695, the patch also frees memory used when a successful 
      update to the backupdir variable is completed.
      modified:
        mysql-test/suite/backup/r/backup_backupdir.result
        mysql-test/suite/backup/r/backup_logs.result
        mysql-test/suite/backup/t/backup_backupdir.test
        mysql-test/suite/backup/t/backup_logs.test
        sql/set_var.cc
        sql/share/errmsg.txt
[26 Feb 2009 10:40] Ingo Strüwing
Approved. Please see email.
[26 Feb 2009 15:23] Jørgen Løland
Good to push.
[26 Feb 2009 22:19] 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/67749

2788 Chuck Bell	2009-02-26
      BUG#42695 : memory leak when setting backupdir
      BUG#42685 : valgrind errors setting backup_progress_log_file
      
      This patch adds code to detect when users attempt to set a path 
      longer than FN_REFLEN. 
      
      For BUG#42695, the patch also frees memory used when a successful 
      update to the backupdir variable is completed.
      modified:
        mysql-test/suite/backup/r/backup_backupdir.result
        mysql-test/suite/backup/r/backup_logs.result
        mysql-test/suite/backup/t/backup_backupdir.test
        mysql-test/suite/backup/t/backup_logs.test
        sql/set_var.cc
        sql/share/errmsg.txt
[26 Mar 2009 12:33] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090326121822-pt84kzxxayzho4mn) (version source revid:rafal.somla@sun.com-20090302164601-znhm4tadplfi2iqu) (merge vers: 6.0.11-alpha) (pib:6)
[26 Mar 2009 23:55] Paul DuBois
Noted in 6.0.11 changelog.

Assigning an incorrect value to the backup_progress_log_file system
variable resulted in Valgrind errors.
[11 Jan 2010 17:02] 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/96533

3051 Ingo Struewing	2010-01-11
      WL#5101 - MySQL Backup back port
      Merged revid:charles.bell@sun.com-20090226221909-3j941x1qlvsd51w2
        BUG#42695 : memory leak when setting backupdir
        BUG#42685 : valgrind errors setting backup_progress_log_file
        
        This patch adds code to detect when users attempt to set a path 
        longer than FN_REFLEN. 
        
        For BUG#42695, the patch also frees memory used when a successful 
        update to the backupdir variable is completed.
      
      original changeset: 2599.123.12
     @ mysql-test/suite/backup/r/backup_logs.result
        WL#5101 - MySQL Backup back port
        Updated test result for change in version string length.
     @ sql/set_var.cc
        WL#5101 - MySQL Backup back port
            Added code to ensure users do not attempt to assign a path longer
            than FN_REFLEN.