Skip to content
Gluster Filesystem - (this is only a public mirror, see the README for contributing)
C Shell Python Perl Makefile M4 Other
Branch: master
Clone or download

Latest commit

dmantipov and amarts libglusterfs: fix use-after-destroy mutex error
Found with GCC ThreadSanitizer:

WARNING: ThreadSanitizer: use of an invalid mutex (e.g. uninitialized or destroyed) (pid=188590)
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x528ac)
    #1 client_ctx_del /path/to/glusterfs/libglusterfs/src/client_t.c:535 (libglusterfs.so.0+0xc681a)
    #2 client_destroy_cbk /path/to/glusterfs/xlators/protocol/server/src/server.c:944 (server.so+0xaf6e)
    #3 gf_client_destroy_recursive /path/to/glusterfs/libglusterfs/src/client_t.c:295 (libglusterfs.so.0+0xc5058)
    #4 client_destroy /path/to/glusterfs/libglusterfs/src/client_t.c:330 (libglusterfs.so.0+0xc60e4)
    ...

  Location is heap block of size 272 at 0x7b440001a180 allocated by thread T7:
    #0 calloc <null> (libtsan.so.0+0x3075a)
    #1 __gf_calloc /path/to/glusterfs/libglusterfs/src/mem-pool.c:151 (libglusterfs.so.0+0x6e42b)
    #2 gf_client_get /path/to/glusterfs/libglusterfs/src/client_t.c:155 (libglusterfs.so.0+0xc571a)
    ...

The problem is that client_destroy() may call client_ctx_del() (which attempts to lock
'sratch_ctx.lock') via recursive deletion from gf_client_destroy_recursive(), so
destroying mutex before entering recursive deletion is an error. It should be destroyed
later - just before the client context is freed.

Change-Id: I730a628714d2b404e3f019ae552403da16b51b68
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Fixes: #1285
Latest commit fda036e Jun 5, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github github/stale-bot: close issues automatically Apr 29, 2020
api cluster/afr: Delay post-op for fsync Jun 8, 2020
build-aux pkg-version: fix warning due to wrong check. Jan 20, 2020
cli cli: fix several signed integer overflows and format specifiers Jun 10, 2020
contrib fuse: Add error-logs to debug bug-1433815-auth-allow.t failures Apr 6, 2020
doc storage/posix: fix thread name to comply with common convention May 18, 2020
events events: fix python3 compatibility As there is no "unicode" in py3 so … Jun 2, 2020
extras common-ha: ganesha-ha.sh bad test for {rhel,centos} for pcs options May 28, 2020
geo-replication [geo-rep] Merging multiple import into single import Apr 8, 2020
glusterfsd rpc, gf_attach: add minimal proper synchronization Jun 3, 2020
heal tests: Fix spurious self-heald.t failure Feb 11, 2020
libglusterd libglusterfs: remove dependency of rpc Aug 16, 2019
libglusterfs libglusterfs: fix use-after-destroy mutex error Jun 11, 2020
rpc rpc, gf_attach: add minimal proper synchronization Jun 3, 2020
tests test: Test case brick-mux-validation-in-cluster.t is failing on RHEL-8 Jun 9, 2020
tools tools/glusterfind: Remove an extra argument Jan 14, 2020
xlators glusterd: destroy all volume info locks and mutexes Jun 10, 2020
.clang-format clang-format: add the config file Sep 12, 2018
.gitignore git-ignore .dirstamp Dec 10, 2019
.mailmap mailmap: add mailmap entry for potatogim Nov 16, 2017
.testignore github/stale-bot: close issues automatically Apr 29, 2020
AUTHORS cleaned up some outdated files Mar 12, 2010
COMMITMENT add COMMITMENT file as part of GPL cure May 25, 2018
CONTRIBUTING github templates: Change to reflect the future workflow Feb 28, 2020
COPYING-GPLV2 license: dual license under GPLV2 and LGPLV3+ May 11, 2012
COPYING-LGPLV3 license: dual license under GPLV2 and LGPLV3+ May 11, 2012
ChangeLog Fixed build problems for init script installation. Mar 9, 2009
INSTALL Use the new URL for the docs Sep 7, 2017
MAINTAINERS MAINTAINERS: Add Raghavendra Gowdappa to Past contributors May 16, 2020
Makefile.am libglusterfs: remove dependency of rpc Aug 16, 2019
NEWS news: note the move to gerrit Jul 18, 2011
README.md README: add a section for giving hints on testing Oct 11, 2018
THANKS Typo fix THANKS message Sep 16, 2014
autogen.sh configure.ac: fix option to stop automake aborting on pointless error Dec 4, 2018
configure.ac Make glusterfs compile on all recent and supported FreeBSD releases. Jun 9, 2020
glusterfs-api.pc.in copy_file_range support in GlusterFS Dec 12, 2018
glusterfs.spec.in packaging: refactor to align with common practices Jun 9, 2020
libgfchangelog.pc.in copy_file_range support in GlusterFS Dec 12, 2018
rfc.sh rfc.sh: remove reference to bugzilla Apr 29, 2020
run-tests-in-vagrant.sh tests/vagrant: install additional dependencies Jun 19, 2018
run-tests.sh Posix: Use simple approach to close fd Mar 20, 2020
site.h.in core: add some examples of site.h usage Jan 30, 2018
submit-for-review.sh rfc.sh: provide a unified way to update bugs or github issues ID Mar 22, 2018

README.md

Gluster

Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.

Development

Contributions to gluster in the form of patches and new feature additions can be made by following steps outlined at Developers Guide.

Documentation

The Gluster documentation can be found at Gluster Docs.

Deployment

Quick instructions to build and install can be found in INSTALL file.

Testing

GlusterFS source contains some functional tests under tests/ directory. All these tests are run against every patch submitted for review. If you want your patch to be tested, please add a .t test file as part of your patch submission. You can also submit a patch to only add a .t file for the test case you are aware of.

To run these tests, on your test-machine, just run ./run-tests.sh. Don't run this on a machine where you have 'production' glusterfs is running, as it would blindly kill all gluster processes in each runs.

If you are sending a patch, and want to validate one or few specific tests, then run a single test by running the below command.

  bash# /bin/bash ${path_to_gluster}/tests/basic/rpc-coverage.t

You can also use prove tool if available in your machine, as follows.

  bash# prove -vmfe '/bin/bash' ${path_to_gluster}/tests/basic/rpc-coverage.t

Maintainers

The list of Gluster maintainers is available in MAINTAINERS file.

License

Gluster is dual licensed under GPLV2 and LGPLV3+.

Please visit the Gluster Home Page to find out more about Gluster.

You can’t perform that action at this time.