Re: Is it a lapsus calami in init_io_cache?
Shaukat Mahmood Ahmad <[email protected]> Thu, 1 Nov 2012 12:29:35 +0500
| Newsgroups | gmane.comp.db.mysql.devel |
|---|---|
| Message-ID | <CAG0LXhzabO64g+90t57r3KpxWya0=RJEykfNHd++-KbyWEHZxw@mail.gmail.com> |
Good identification Mr. Left, Just adding some addtional information Refernce: file:= \mysql-5.6.7-rc\mysys\mf_iocache.c Line:= 262 Mutex will be never be cleared as sizeof(info) will return 4 as info is pointer to IO_CACHE, so the first four bytes of info->append_buffer_lock will be set to 0; Regards, Shaukat Mahmood Ahmad On Wed, Oct 31, 2012 at 6:06 PM, Jon Olav Hauglid <[email protected]> wrote: > Hello, > > > On 10/27/2012 07:33 AM, Mr. Left wrote: >> >> Hi, all >> I am reading the source code of mysql 5.6.6-m9, and i found the code below >> in function:init_io_cache >> >> /* Clear mutex so that safe_mutex will notice that it's not initialized */ >> memset(&info->append_buffer_lock, 0, sizeof(info)); >> >> I want to know why use sizeof(info) instead of >> sizeof(info->append_buffer_lock) ? > > > Good question :-) > It certainly looks like a bug. > > Thanks for making us aware of this issue! > I've reported it as http://bugs.mysql.com/bug.php?id=67437 > > --- Jon Olav Hauglid, Principal Software Engineer MySQL, Oracle. > > > -- > MySQL Internals Mailing List > For list archives: http://lists.mysql.com/internals > To unsubscribe: http://lists.mysql.com/internals > -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals