Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLUSTER handle_release will signal SIGSEGV, Segmentation fault. #1107

Open
JYang1986 opened this issue Mar 29, 2024 · 1 comment
Open

GLUSTER handle_release will signal SIGSEGV, Segmentation fault. #1107

JYang1986 opened this issue Mar 29, 2024 · 1 comment

Comments

@JYang1986
Copy link

JYang1986 commented Mar 29, 2024

in this commit
b0a492a

static void handle_release(struct fsal_obj_handle *obj_hdl)
{
......

	fsal_obj_handle_fini(&objhandle->handle, true);

	if (obj_hdl->type == REGULAR_FILE) {
		fsal_status_t st;

		st = close_fsal_fd(obj_hdl, &my_fd->fsal_fd,
				   false);

		if (FSAL_IS_ERROR(st)) {
			LogCrit(COMPONENT_FSAL,
				"Could not close hdl 0x%p, status %s error %s(%d)",
				obj_hdl, fsal_err_txt(st),
				strerror(st.minor), st.minor);
		}
	}
.....
	if (objhandle->handle.type == REGULAR_FILE)
		destroy_fsal_fd(&my_fd->fsal_fd);

	gsh_free(objhandle);

#ifdef GLTIMING
	now(&e_time);
	latency_update(&s_time, &e_time, lat_handle_release);
#endif
} 

fsal_obj_handle_fini will memset(&obj->obj_ops, 0, sizeof(obj->obj_ops)) obj->obj_ops=NULL
then close_fsal_fd will use obj->obj_ops then SIGSEGV

could move fsal_obj_handle_fini(&objhandle->handle, true); like this is ok?

	if (objhandle->handle.type == REGULAR_FILE)
		destroy_fsal_fd(&my_fd->fsal_fd);
       fsal_obj_handle_fini(&objhandle->handle, true);
	gsh_free(objhandle);
@ffilz
Copy link
Member

ffilz commented Apr 1, 2024

Please submit a patch via Gerrithub (see src/CONTRIBUTING_HOWTO.txt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants