Bug 1468863 - Assert in mem_pools_fini during libgfapi-fini-hang.t on NetBSD
Assert in mem_pools_fini during libgfapi-fini-hang.t on NetBSD
Status: MODIFIED
Product: GlusterFS
Classification: Community
Component: core (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeff Darcy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-08 23:29 EDT by Jeff Darcy
Modified: 2017-07-12 05:01 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Darcy 2017-07-08 23:29:14 EDT
The test deliberately does glfs_fini (which calls mem_pools_fini) without doing glfs_init (which calls mem_pools_init) first.  This trips an assert which is there to prevent a counter underflow.
Comment 1 Worker Ant 2017-07-08 23:30:22 EDT
REVIEW: https://review.gluster.org/17728 (gfapi+libglusterfs: fix mem_pools_fini without mem_pools_init case) posted (#2) for review on master by Jeff Darcy (jeff@pl.atyp.us)
Comment 2 Worker Ant 2017-07-08 23:57:30 EDT
COMMIT: https://review.gluster.org/17728 committed in master by Jeff Darcy (jeff@pl.atyp.us) 
------
commit 028d82b8a2434cb6d5ad707500f6dea2125ea2fa
Author: Jeff Darcy <jdarcy@fb.com>
Date:   Fri Jul 7 07:49:45 2017 -0700

    gfapi+libglusterfs: fix mem_pools_fini without mem_pools_init case
    
    The change consists of two parts: make sure it doesn't happen (in
    glfs.c), and make it harmless if it does (in mem-pool.c).
    
    Change-Id: Icb7dda7a45dd3d1ade2ee3991bb6a22c8ec88424
    BUG: 1468863
    Signed-off-by: Jeff Darcy <jdarcy@fb.com>
    Reviewed-on: https://review.gluster.org/17728
    Tested-by: Jeff Darcy <jeff@pl.atyp.us>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
    Smoke: Gluster Build System <jenkins@build.gluster.org>
    Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Comment 3 Worker Ant 2017-07-10 06:17:06 EDT
REVIEW: https://review.gluster.org/17734 (gfapi: prevent mem-pool leak in case glfs_new_fs() fails) posted (#1) for review on master by Niels de Vos (ndevos@redhat.com)
Comment 4 Worker Ant 2017-07-10 06:23:44 EDT
REVIEW: https://review.gluster.org/17734 (gfapi: prevent mem-pool leak in case glfs_new_fs() fails) posted (#2) for review on master by Niels de Vos (ndevos@redhat.com)
Comment 5 Worker Ant 2017-07-10 06:24:17 EDT
REVIEW: https://review.gluster.org/17734 (gfapi: prevent mem-pool leak in case glfs_new_fs() fails) posted (#3) for review on master by Niels de Vos (ndevos@redhat.com)
Comment 6 Worker Ant 2017-07-11 09:21:42 EDT
REVIEW: https://review.gluster.org/17734 (gfapi: prevent mem-pool leak in case glfs_new_fs() fails) posted (#4) for review on master by Niels de Vos (ndevos@redhat.com)
Comment 7 Worker Ant 2017-07-12 05:01:16 EDT
COMMIT: https://review.gluster.org/17734 committed in master by Niels de Vos (ndevos@redhat.com) 
------
commit a4a417e29c5b2d63e6bf5efae4f0ccf30a39647f
Author: Niels de Vos <ndevos@redhat.com>
Date:   Mon Jul 10 11:45:31 2017 +0200

    gfapi: prevent mem-pool leak in case glfs_new_fs() fails
    
    Commit 7039243e187 adds a call to mem_pools_init() so that the memory
    pool cleanup thread ("sweeper") is started. However, now it is possible
    that users of gfapi can not cleanup this thread because glfs_new() can
    return NULL, but the sweeper is still running.
    
    In case glfs_fs_new() fails, mem_pools_fini() needs to be called as
    well. This seems more correct than calling mem_pools_init() after
    glfs_fs_new(), and this makes using memory pools possible *really* early
    in the gfapi initialization.
    
    Change-Id: I1f2fb25cc33e227b3c33ce9d1b03f67bc27e981a
    Fixes: 7039243e187 ("gfapi: add mem_pools_init and mem_pools_fini calls")
    BUG: 1468863
    Signed-off-by: Niels de Vos <ndevos@redhat.com>
    Reviewed-on: https://review.gluster.org/17734
    Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
    Smoke: Gluster Build System <jenkins@build.gluster.org>
    Reviewed-by: soumya k <skoduri@redhat.com>
    Reviewed-by: Amar Tumballi <amarts@redhat.com>

Note You need to log in before you can comment on or make changes to this bug.