+++ This bug was initially created as a clone of Bug #1221008 +++ Description of problem: When glfs_* methods operating on glfd are invoked after calling glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD trying to deference glfd->fd->inode which is invalid. Version-Release number of selected component (if applicable): Master branch of glusterfs Steps to Reproduce (Example using python binding) #!/usr/bin/env python from glusterfs import gfapi import os v = gfapi.Volume("pp", "real") v.mount() f = v.open("file", os.O_RDONLY) # assuming file exists f.close() f.read() # This will segfault Actual results: Segfault with code dump Expected results: Gracefully exit with errno set to EBADF --- Additional comment from Anand Avati on 2015-05-13 02:25:55 EDT --- REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is invalid) posted (#3) for review on master by Prashanth Pai (ppai) --- Additional comment from Anand Avati on 2015-05-13 02:46:40 EDT --- REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is invalid) posted (#4) for review on master by Prashanth Pai (ppai) --- Additional comment from Anand Avati on 2015-05-14 00:32:43 EDT --- REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is invalid) posted (#5) for review on master by Prashanth Pai (ppai) --- Additional comment from Anand Avati on 2015-07-07 11:06:46 EDT --- COMMIT: http://review.gluster.org/10759 committed in master by Shyamsundar Ranganathan (srangana) ------ commit afa793ff16b349989ca7c958466eae15d2d003f9 Author: Prashanth Pai <ppai> Date: Tue May 12 16:36:55 2015 +0530 libgfapi: Gracefully exit when glfd is invalid When glfs_* methods operating on glfd are invoked after calling glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD trying to deference glfd->fd->inode which is invalid. Also, returning EBADF seemed more specific than EINVAL. BUG: 1221008 Change-Id: I13a92dca52da9a300252b69e026581b3a9e931fd Signed-off-by: Prashanth Pai <ppai> Reviewed-on: http://review.gluster.org/10759 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Shyamsundar Ranganathan <srangana> --- Additional comment from Anand Avati on 2015-07-08 02:39:13 EDT --- REVIEW: http://review.gluster.org/11571 (libgfapi: Gracefully exit when glfd is invalid) posted (#1) for review on release-3.7 by Prashanth Pai (ppai)
REVIEW: http://review.gluster.org/11571 (libgfapi: Gracefully exit when glfd is invalid) posted (#2) for review on release-3.7 by Prashanth Pai (ppai)
REVIEW: http://review.gluster.org/11571 (libgfapi: Gracefully exit when glfd is invalid) posted (#3) for review on release-3.7 by Prashanth Pai (ppai)
This bug could not be fixed in time for glusterfs-3.7.3. This is now being tracked for being fixed in glusterfs-3.7.4.
*** Bug 1218535 has been marked as a duplicate of this bug. ***
REVIEW: http://review.gluster.org/11571 (libgfapi: Gracefully exit when glfd is invalid) posted (#4) for review on release-3.7 by Niels de Vos (ndevos)
COMMIT: http://review.gluster.org/11571 committed in release-3.7 by Niels de Vos (ndevos) ------ commit 6c4096f5e6a6d0f2b21cb4b2bea098b6f4eebbed Author: Prashanth Pai <ppai> Date: Tue May 12 16:36:55 2015 +0530 libgfapi: Gracefully exit when glfd is invalid This is a backport of: http://review.gluster.org/10759 When glfs_* methods operating on glfd are invoked after calling glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD trying to deference glfd->fd->inode which is invalid. Also, returning EBADF seemed more specific than EINVAL. BUG: 1240920 Change-Id: I13a92dca52da9a300252b69e026581b3a9e931fd Signed-off-by: Prashanth Pai <ppai> Reviewed-on-master: http://review.gluster.org/10759 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Shyamsundar Ranganathan <srangana> Reviewed-on: http://review.gluster.org/11571 Reviewed-by: Niels de Vos <ndevos> Reviewed-by: Humble Devassy Chirammal <humble.devassy> Reviewed-by: bipin kunal <bkunal> Tested-by: NetBSD Build System <jenkins.org>
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.7.4, please open a new bug report. glusterfs-3.7.4 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/12496 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user