Bug #43949 Initialization of slave produces a warning message in Valgrind
Submitted: 30 Mar 2009 5:40 Modified: 28 May 2009 14:40
Reporter: Alfranio Junior Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:6.0-rpl, 5.1 OS:Any
Assigned to: Alfranio Junior CPU Architecture:Any
Tags: replication, valgrind

[30 Mar 2009 5:40] Alfranio Junior
Description:
==16743== Source and destination overlap in strcpy(0xBEC7A185, 0xBEC7A192)
==16743==    at 0x402653D: strcpy (mc_replace_strmem.c:268)
==16743==    by 0x8705675: pack_dirname (mf_pack.c:87)
==16743==    by 0x8703D9E: fn_format (mf_format.c:53)
==16743==    by 0x8473FD2: init_relay_log_info(Relay_log_info*, char const*) (rpl_rli.cc:109)
==16743==    by 0x8476414: init_master_info(Master_info*, char const*, char const*, bool, int) (rpl_mi.cc:309)
==16743==    by 0x8469196: init_slave() (slave.cc:245)
==16743==    by 0x82C3256: main (mysqld.cc:4420)

How to repeat:
Run any master-slave scenario with valgrind enabled.
[19 Apr 2009 1:22] 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/72469

2860 Alfranio Correia	2009-04-19
      BUG#43949 Initialization of slave produces a warning message in Valgrind
      
      In order to define the --slave-load-tmpdir, the init_relay_log_file()
      was calling fn_format(MY_PACK_FILENAME) which internally was indirectly
      calling strmov_overlapp() (through pack_dirname) and the following
      warning message was being printed out while running in Valgrind:
      "source and destination overlap in strcpy".
      
      We fixed the issue by removing the flag MY_PACK_FILENAME as it was not
      necessary. In a nutshell, with this flag the function fn_format() tried
      to replace a directory by either "~", "." or "..". However, we wanted
      exactly to remove such strings.
      
      In this patch, we also refactored the functions init_relay_log_file()
      and check_temp_dir(). The former was refactored to call the fn_format()
      with the flag MY_SAFE_PATH along with the MY_RETURN_REAL_PATH,  in order
      to avoid issues with long directories and return an absolute path,
      respectively. The flag MY_SAFE_UNPACK_FILENAME was removed too as it was
      responsible for removing "~", "." or ".." only from the file parameter
      and we wanted to remove such strings from the directory parameter in
      the fn_format(). This result is stored in an rli variable, which is then
      processed by the other function in order to verify if the directory exists
      and if we are able to create files in it.
     @ mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
        Changed the output to make it consistent among different runs.
     @ mysys/mf_format.c
        Replaced a return for DBUG_RETURN.
[28 May 2009 8:20] Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090528073639-yohsb4q1jzg7ycws) (version source revid:alfranio.correia@sun.com-20090521083638-j28259o0ibw1vvto) (merge vers: 5.1.36) (pib:6)
[28 May 2009 14:40] Jon Stephens
No user-facing feature changes to document. Closed.
[17 Jun 2009 19:26] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:alfranio.correia@sun.com-20090521090052-6jm6o66rz6wfq6cp) (merge vers: 6.0.12-alpha) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:33] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)