Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11707

Fix incorrect memset() for structures containing dynamic class GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable

Details

    Attachments

      Activity

        storage/innobase/buf/buf0mtflu.cc:489:9: warning:
        destination for this 'memset' call is a pointer to class containing a
        dynamic class 'GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable
        pointer will be overwritten [-Wdynamic-class-memaccess]
        memset(mtflush_ctx, 0, sizeof(thread_sync_t));

        jplindst Jan Lindström (Inactive) added a comment - storage/innobase/buf/buf0mtflu.cc:489:9: warning: destination for this 'memset' call is a pointer to class containing a dynamic class 'GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable pointer will be overwritten [-Wdynamic-class-memaccess] memset(mtflush_ctx, 0, sizeof(thread_sync_t));
        jplindst Jan Lindström (Inactive) added a comment - http://lists.askmonty.org/pipermail/commits/2017-January/010483.html

        I think that a much better fix is to backport this one from 10.2:

        commit a8ac6dc5065a82b11b3f1a699be87aabc95d7a10
        Author: Marko Mäkelä <marko.makela@mariadb.com>
        Date:   Thu Jan 5 11:49:00 2017 +0200
         
            Fix InnoDB compilation warnings.
        

        marko Marko Mäkelä added a comment - I think that a much better fix is to backport this one from 10.2: commit a8ac6dc5065a82b11b3f1a699be87aabc95d7a10 Author: Marko Mäkelä <marko.makela@mariadb.com> Date: Thu Jan 5 11:49:00 2017 +0200   Fix InnoDB compilation warnings.

        Your suggested fix looks good but for GA-release I rather apply minimal changes.

        commit e53dfb24be73a204b4ee8efee6c07e1b13200052
        Author: Jan Lindström <jan.lindstrom@mariadb.com>
        Date: Mon Feb 6 10:55:23 2017 +0200

        MDEV-11707: Fix incorrect memset() for structures containing

        dynamic class GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable

        Instead using mem_heap_alloc and memset, use mem_heap_zalloc
        directly.

        jplindst Jan Lindström (Inactive) added a comment - Your suggested fix looks good but for GA-release I rather apply minimal changes. commit e53dfb24be73a204b4ee8efee6c07e1b13200052 Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Mon Feb 6 10:55:23 2017 +0200 MDEV-11707 : Fix incorrect memset() for structures containing dynamic class GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable Instead using mem_heap_alloc and memset, use mem_heap_zalloc directly.

        People

          jplindst Jan Lindström (Inactive)
          jplindst Jan Lindström (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

            Created:
            Updated:
            Resolved:

            Git Integration

              Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.