Bug 1559337 - server-less glusterfsd segmentation faults without volfile-id
Summary: server-less glusterfsd segmentation faults without volfile-id
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-22 10:42 UTC by fredrik.widlund
Modified: 2018-10-08 11:02 UTC (History)
6 users (show)

Fixed In Version: glusterfs-4.1.4
Clone Of:
Environment:
Last Closed: 2018-10-08 11:02:23 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description fredrik.widlund 2018-03-22 10:42:26 UTC
Description of problem:

# glusterfsd -f server.vol --debug # crash

Version-Release number of selected component (if applicable):

git master 22/3 2018

How reproducible:

Always

Steps to Reproduce:

# cat server.vol 
volume posix
  type storage/posix
  option directory /data
end-volume

volume server
  type protocol/server
  option transport-type tcp
  subvolumes posix
end-volume
# glusterfsd -f server.vol --debug

Actual results:

[...]
/usr/local/lib/libglusterfs.so.0(+0x23c3c)[0x7fb7a7b20c3c]
/usr/local/lib/libglusterfs.so.0(gf_print_trace+0x2d2)[0x7fb7a7b2aa32]
/usr/lib/libc.so.6(+0x348e0)[0x7fb7a5f008e0]
/usr/lib/libc.so.6(+0x156f11)[0x7fb7a6022f11]
/usr/local/lib/glusterfs/4.1dev/xlator/protocol/server.so(+0xa30e)[0x7fb7a116930e]
/usr/local/lib/glusterfs/4.1dev/xlator/protocol/server.so(+0xc1c3)[0x7fb7a116b1c3]
/usr/local/lib/libglusterfs.so.0(xlator_init+0x9f)[0x7fb7a7b1e21f]
/usr/local/lib/libglusterfs.so.0(+0x5af39)[0x7fb7a7b57f39]
/usr/local/lib/libglusterfs.so.0(glusterfs_graph_activate+0x34)[0x7fb7a7b58794]
glusterfsd(glusterfs_process_volfp+0x13b)[0x5642c4634f0b]
glusterfsd(glusterfs_volumes_init+0xf7)[0x5642c4635097]
glusterfsd(main+0x7ee)[0x5642c463128e]
/usr/lib/libc.so.6(__libc_start_main+0xea)[0x7fb7a5eecf4a]
glusterfsd(_start+0x2a)[0x5642c463141a]
---------
Segmentation fault (core dumped)


Additional info:

# glusterfsd -f server.vol --debug --volfile-id=foo # works even though no server is used

server.c:1145        FIRST_CHILD(this)->volfile_id
	                    = gf_strdup (this->ctx->cmd_args.volfile_id);

Comment 2 Jeff Darcy 2018-03-22 14:56:31 UTC
While I agree that this shouldn't crash, I'm not sure it should actually work either. Volfile-id could be considered essential information, as it's used for things other than finding a volfile - e.g. in notifications, for attaching/detaching bricks when multiplexing is enabled. IMO we should check for its presence and exit if it's not given. Any external automation not using glusterd (which is not generally supported anyway) should be trivially able to deal with that.

Comment 3 Amar Tumballi 2018-10-08 11:02:23 UTC
This is fixed with https://review.gluster.org/#/c/glusterfs/+/19893/


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