Bug 764175 (GLUSTER-2443)

Summary: starting glusterfs/d -f with relative path crashes
Product: [Community] GlusterFS Reporter: shishir gowda <sgowda>
Component: coreAssignee: shishir gowda <sgowda>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, nsathyan, saurabh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description shishir gowda 2011-02-18 05:22:55 UTC
If glusterfs/glusterfsd is given a relative path for the vol file, it crashes in parse_opts on solaris.

This is due to getcwd() being parsed a size 0. On solaris, the size has to be non-zero, whereas in linux, if it is zero, it allocates buffer of required size.

The fix is to pass the size as PATH_MAX, which will be handled fine on both solaris and linux

Comment 1 Anand Avati 2011-02-22 07:11:34 UTC
PATCH: http://patches.gluster.com/patch/6209 in master (Fix getcwd size arg to make it work in solaris.)

Comment 2 Saurabh 2011-03-11 04:03:17 UTC
bash-3.00# ls
bricks                          info                            new.192.168.1.73.data-dir1.vol  run
cksum                           new-fuse.vol                    new.192.168.1.73.data-dir2.vol
bash-3.00# glusterfsd -f new.192.168.1.73.data-dir1.vol



bash-3.00# less /usr/local/var/log/glusterfs/
.cmd_log_history                                          nfs.log
bricks/                                                   usr-local-etc-glusterfs-glusterd.vol.log
etc-glusterd-vols-new-new.192.168.1.73.data-dir1.vol.log  
bash-3.00# less /usr/local/var/log/glusterfs/etc-glusterd-vols-new-new.192.168.1.73.data-dir1.vol.log 
[2011-03-11 06:54:52.411192] E [socket.c:338:__socket_server_bind] tcp.new-server: binding to  failed: Address already in use
[2011-03-11 06:54:52.411268] E [socket.c:341:__socket_server_bind] tcp.new-server: Port is already in use
[2011-03-11 06:54:52.411306] E [xlator.c:784:xlator_init] new-server: Initialization of volume 'new-server' failed, review your volfile
 again
[2011-03-11 06:54:52.411318] E [graph.c:331:glusterfs_graph_init] new-server: initializing translator failed
[2011-03-11 06:54:52.411411] I [glusterfsd.c:710:cleanup_and_exit] glusterfsd: shutting down