[Bugs] [Bug 1521213] New: crash when gifs_set_logging is called concurrently
bugzilla at redhat.com
bugzilla at redhat.com
Wed Dec 6 02:13:01 UTC 2017
https://bugzilla.redhat.com/show_bug.cgi?id=1521213
Bug ID: 1521213
Summary: crash when gifs_set_logging is called concurrently
Product: GlusterFS
Version: mainline
Component: libgfapi
Assignee: bugs at gluster.org
Reporter: zhhuan at gmail.com
QA Contact: bugs at gluster.org
CC: bugs at gluster.org
Description of problem:
run fio to perform test in thread mode will cause gfapi to crash.
Digging into this issue, and found that glfs_set_logging changes THIS->ctx
without lock, during initialization "THIS" is actually global_xlator.
Concurrently changing it could result in global_xlator.ctx be changed to some
fs->ctx. Consider the following sequence.
thread1 thread2
old_ctx = THIS->ctx // current old_ctx is
global_xlator.ctx
THIS->ctx = fs1->ctx
old_ctx = THIS->ctx // it is fs1->ctx actually
THIS->ctx = fs2->ctx
THIS->ctx = old_ctx // revert back to
global_xlator.ctx
THIS->ctx = old_ctx // THIS->ctx becomes fs1->ctx
global_xlator.ctx might refers to an invalid pointer and that causes subsequent
new fs init crash as they might use global_xlator.
Version-Release number of selected component (if applicable):
How reproducible:
run fio
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Additional info:
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list