Bug #42685 valgrind errors setting backup_progress_log_file
Submitted: 9 Feb 10:57 Modified: 27 Mar 0:55
Reporter: Shane Bester
Status: Closed
Category:Server: Backup Severity:S3 (Non-critical)
Version:6.0.10 OS:Any
Assigned to: Chuck Bell Target Version:6.0-beta
Tags: valgrind, backup_progress_log_file
Triage: Triaged: D2 (Serious)

[9 Feb 10: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 11:00] Shane Bester
valgrind errors, and corrupted error message sent to client ...

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

[9 Feb 15:15] Shane Bester
related to bug #42695
[11 Feb 11:38] Sveta Smirnova
Thank you for the report.

Verified as described.
[25 Feb 19:12] Chuck Bell
Bug stolen from Jorgen because it is very similar to BUG#42695.
[25 Feb 19: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 20: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 11:40] Ingo Strüwing
Approved. Please see email.
[26 Feb 16:23] Jorgen Loland
Good to push.
[26 Feb 23: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 13: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)
[27 Mar 0: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.