Bug #43105 Valgrind stack in backup_compression* tests.
Submitted: 23 Feb 2009 10:59 Modified: 23 Feb 2009 14:05
Reporter: Rafal Somla Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0-backup OS:Any
Assigned to: CPU Architecture:Any
Tags: pushbuild, teamtree, valgrind

[23 Feb 2009 10:59] Rafal Somla
Description:
This is not a memory leak. It is a warning about conditional jump depending on uninitialized values. The jump is within zlib compression library which is called from within backup code. Here is the report from valgrind:

==4865== Conditional jump or move depends on uninitialised value(s)
==4865==    at 0xC5ECD7: longest_match (deflate.c:1121)
==4865==    by 0xC5F9A3: deflate_slow (deflate.c:1595)
==4865==    by 0xC60184: deflate (deflate.c:790)
==4865==    by 0xCE6C8C: backup::Output_stream::close() (stream.cc:456)
==4865==    by 0xCDA559: Backup_restore_ctx::close() (kernel.cc:1048)
==4865==    by 0xCDB34C: Backup_restore_ctx::do_backup() (kernel.cc:1155)
==4865==    by 0xCDC5E7: execute_backup_command(THD*, LEX*, String*, bool, bool) (kernel.cc:206)
==4865==    by 0x6C20C9: mysql_execute_command(THD*) (sql_parse.cc:2442)
==4865==    by 0x6C58E2: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5802)
==4865==    by 0x6C6415: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1057)
==4865==    by 0x6C6FD2: do_command(THD*) (sql_parse.cc:739)
==4865==    by 0x6B8003: handle_one_connection (sql_connect.cc:1146)
==4865==    by 0x4C32142: start_thread (in /lib64/libpthread-2.4.so)
==4865==    by 0x5268B8C: clone (in /lib64/libc-2.4.so)

I was unable to determine if it is a problem within zlib library or with the way this library is used from within backup code. For all I know, when deflate() is called from backup::Output_stream::close() it is passed a valid z_stream_s object which was previously opened and manipulated using zlib functions only.

How to repeat:
Using current backup tree, run backup_compression test with --valgrind option, then see server's error log which should contain above valgrind stack.
[23 Feb 2009 11:05] MySQL Verification Team
you sure this isn't bug #36989 ?
[23 Feb 2009 11:20] Rafal Somla
This is a duplicate of Bug#36989 - the issue is internal to the zlib library.
We should wait for resolution of the bug (e.g. valgrind suppression rule) and then close this one.
[23 Feb 2009 14:05] Chuck Bell
This is a duplicate of BUG#42409 albeit with more data.