Bug 1196028
Summary: | libgfapi: glfs_init() hangs on pthread_cond_wait() when user is non-root | ||||||
---|---|---|---|---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Prashanth Pai <ppai> | ||||
Component: | libgfapi | Assignee: | Vijay Bellur <vbellur> | ||||
Status: | CLOSED WORKSFORME | QA Contact: | Sudhir D <sdharane> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | high | ||||||
Version: | mainline | CC: | atumball, bugs, lmohanty, ndevos, srangana, vbellur | ||||
Target Milestone: | --- | Keywords: | Triaged | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | glusterfs-6.x | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-05-07 14:48:50 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
The issue does not occur when the server.allow-insecure and rpc-allow-insecure options are set. Without these options, the gfapi application will not be allowed to connect from ports > 1024. Only root can bind() to ports < 1024, running a gfapi application as non-root uses ports > 1024. Possibly http://review.gluster.org/7405 contains a way to catch the error and report the problem back to the application. Yes Niels, that's true. I wouldn't expect a hang though. Ideally, glfs_init() should return -1 with errno set to EPERM (or something) (In reply to Prashanth Pai from comment #2) > Yes Niels, that's true. I wouldn't expect a hang though. Ideally, > glfs_init() should return -1 with errno set to EPERM (or something) Yes, most definitely! Tried glfsxmp.c as a non-user, and things are working fine with glusterfs-6.x |
Created attachment 994997 [details] Sample code to be run as non-root glfs_init() hangs on pthread_cond_wait() when user is non-root Steps to Reproduce: $ gcc try.c -I /usr/local/include/glusterfs/ -lgfapi -O0 -ggdb $ ./a.out Trace: Program received signal SIGINT, Interrupt. 0x00007ffff68d7ca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 Missing separate debuginfos, use: debuginfo-install glibc-2.18-16.fc20.x86_64 keyutils-libs-1.5.9-1.fc20.x86_64 krb5-libs-1.11.5-11.fc20.x86_64 libcom_err-1.42.8-3.fc20.x86_64 libselinux-2.2.1-6.fc20.x86_64 openssl-libs-1.0.1e-41.fc20.x86_64 pcre-8.33-8.fc20.x86_64 sssd-client-1.11.7-2.fc20.x86_64 xz-libs-5.1.2-12alpha.fc20.x86_64 zlib-1.2.8-3.fc20.x86_64 (gdb) bt #0 0x00007ffff68d7ca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007ffff7bc6cc2 in glfs_lock (fs=0x630b80) at glfs-internal.h:214 #2 0x00007ffff7bc7fb6 in glfs_init_wait (fs=0x630b80) at glfs.c:703 #3 0x00007ffff7bc82a7 in pub_glfs_init (fs=0x630b80) at glfs.c:809 #4 0x00000000004009d3 in main (argc=1, argv=0x7fffffffdee8) at try.c:20 (gdb) Expected results: Should error out gracefully