MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:November 17 2009 2:04pm
Subject:Re: bzr commit into mysql-5.1-bugteam branch (svoj:3167) Bug#47598
View as plain text  
Hi, Sergey!

On Nov 12, Sergey Vojtovich wrote:
> #At file:///home/svoj/devel/bzr-mysql/mysql-5.1-bugteam-bug47598/ based on
> revid:joro@stripped
> 
>  3167 Sergey Vojtovich	2009-11-12
>       BUG#47598 - MyISAM may write uninitialized data to disk
>       
> === modified file 'storage/myisam/mi_open.c'
> --- a/storage/myisam/mi_open.c	2009-10-27 13:20:34 +0000
> +++ b/storage/myisam/mi_open.c	2009-11-12 08:34:42 +0000
> @@ -592,6 +592,8 @@ MI_INFO *mi_open(const char *name, int m
>    strmov(info.filename,name);
>    memcpy(info.blobs,share->blobs,sizeof(MI_BLOB)*share->base.blobs);
>    info.lastkey2=info.lastkey+share->base.max_key_length;
> +  bzero(info.buff, share->base.max_key_block_length * 2 +
> +                   share->base.max_key_length);

Okay, looks like, indeed, info.buff is always used when a new page is
needed.

Nice catch.
  
>    info.s=share;
>    info.lastpos= HA_OFFSET_ERROR;
> 
> === modified file 'storage/myisam/mi_page.c'
> --- a/storage/myisam/mi_page.c	2008-03-29 08:02:54 +0000
> +++ b/storage/myisam/mi_page.c	2009-11-12 08:34:42 +0000
> @@ -86,7 +86,11 @@ int _mi_write_keypage(register MI_INFO *
>    if ((length=keyinfo->block_length) > IO_SIZE*2 &&
>        info->state->key_file_length != page+length)
>      length= ((mi_getint(buff)+IO_SIZE-1) & (uint) ~(IO_SIZE-1));
> -#ifdef HAVE_purify
> +#ifdef LEGACY_CODE_HAVE_purify
> +  /*
> +    This is legacy code to shut up valgrind. Must not be needed after
> +    BUG#47598 - "MyISAM may write uninitialized data to disk" is fixed.
> +  */
>    {
>      length=mi_getint(buff);
>      bzero((uchar*) buff+length,keyinfo->block_length-length);

Two questions.
1. Did you run the test suite with valgrind after your fix ?
   Preferrably without your bzero() line and with - to see that it,
   indeed, helps.

2. Why did you keep #ifdef instead of removing it completely ?

Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
bzr commit into mysql-5.1-bugteam branch (svoj:3167) Bug#47598Sergey Vojtovich12 Nov
  • Re: bzr commit into mysql-5.1-bugteam branch (svoj:3167) Bug#47598Sergei Golubchik17 Nov
    • Re: bzr commit into mysql-5.1-bugteam branch (svoj:3167) Bug#47598Sergey Vojtovich17 Nov