Bug 1285616 - Brick crashes because of race in bit-rot init
Brick crashes because of race in bit-rot init
Product: GlusterFS
Classification: Community
Component: bitrot (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Pranith Kumar K
Depends On:
Blocks: 1285758 1286058
  Show dependency treegraph
Reported: 2015-11-25 23:34 EST by Pranith Kumar K
Modified: 2016-06-16 09:46 EDT (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1285758 1286058 (view as bug list)
Last Closed: 2016-06-16 09:46:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pranith Kumar K 2015-11-25 23:34:32 EST
Description of problem:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fce642eb420 in pthread_mutex_lock () from ./lib64/libpthread.so.0
(gdb) bt
#0  0x00007fce642eb420 in pthread_mutex_lock () from ./lib64/libpthread.so.0
#1  0x00007fce52ee2e13 in br_stub_worker (data=0x7fce54010f90)
    at /home/jenkins/root/workspace/rackspace-regression-2GB-triggered/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c:337
#2  0x00007fce642e9a51 in start_thread () from ./lib64/libpthread.so.0
#3  0x00007fce63c5393d in clone () from ./lib64/libc.so.6
(gdb) fr 1
#1  0x00007fce52ee2e13 in br_stub_worker (data=0x7fce54010f90)
    at /home/jenkins/root/workspace/rackspace-regression-2GB-triggered/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c:337
337	/home/jenkins/root/workspace/rackspace-regression-2GB-triggered/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c: No such file or directory.
(gdb) info locals
priv = 0x0
this = 0x7fce54010f90
stub = 0x0
ret = 0

init may not have initialized this->private by the time br_stub_worker starts running, leading to NULL dereference.
Version-Release number of selected component (if applicable):

How reproducible:
This is observed at https://build.gluster.org/job/rackspace-regression-2GB-triggered/16180/consoleFull

Steps to Reproduce:

Actual results:

Expected results:

Additional info:
Comment 1 Vijay Bellur 2015-11-25 23:36:24 EST
REVIEW: http://review.gluster.org/12754 (features/bit-rot: Fix NULL dereference) posted (#1) for review on master by Pranith Kumar Karampuri (pkarampu@redhat.com)
Comment 2 Vijay Bellur 2015-11-26 04:03:33 EST
REVIEW: http://review.gluster.org/12754 (features/bit-rot: Fix NULL dereference) posted (#2) for review on master by Pranith Kumar Karampuri (pkarampu@redhat.com)
Comment 3 Vijay Bellur 2015-11-26 23:04:23 EST
COMMIT: http://review.gluster.org/12754 committed in master by Venky Shankar (vshankar@redhat.com) 
commit a1919e91279a6c691fbd3dd6c0d97e74e78ccf22
Author: Pranith Kumar K <pkarampu@redhat.com>
Date:   Thu Nov 26 09:58:39 2015 +0530

    features/bit-rot: Fix NULL dereference
    By the time br_stub_worker is accessing this->private in it's
    thread, 'init' may not have set 'this->private = priv'. This
    leads to NULL dereference leading to brick crash.
    Set this->private before launching these threads.
    Change-Id: Ic797eb195fdd0c70d19f28d0b97bc0181fd3dd2f
    BUG: 1285616
    Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
    Reviewed-on: http://review.gluster.org/12754
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
    Reviewed-by: Venky Shankar <vshankar@redhat.com>
Comment 4 Niels de Vos 2016-06-16 09:46:40 EDT
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.

glusterfs-3.8.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

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