Bug 1409760

Summary: Spurious failures in ./tests/basic/gfapi/bug1291259.t
Product: [Community] GlusterFS Reporter: Shyamsundar <srangana>
Component: libgfapiAssignee: Shyamsundar <srangana>
Status: CLOSED DUPLICATE QA Contact: Sudhir D <sdharane>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-03 09:45:07 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:

Description Shyamsundar 2017-01-03 09:39:24 UTC
Description of problem:
./tests/basic/gfapi/bug1291259.t fails in regression tests often and is currently marked bad.

The failure log always indicates a segfault as follows,

22:13:13 ================================================================================
22:13:13 [06:13:13] Running tests in file ./tests/basic/gfapi/bug1291259.t
22:13:19 Starting libgfapi_fini
22:13:19 glfs_set_volfile_server : returned 0
22:13:19 glfs_set_logging : returned 0
22:13:19 glfs_init : returned 0
22:13:19 glfs_h_poll_upcall : returned 0
22:13:19 glfs_set_volfile_server : returned 0
22:13:19 glfs_set_logging : returned 0
22:13:19 glfs_init : returned 0
22:13:21 glfs_h_lookupat leaf : returned -1
22:13:21 glfs_h_create leaf - 0x2205ed0
22:13:21 glfs_h_poll_upcall : returned 0
22:13:21 ./tests/basic/gfapi/../../include.rc: line 286: 25897 Segmentation fault      ././tests/basic/gfapi/bug1291259 slave20.cloud.gluster.org patchy /var/log/glusterfs/bug1291259.log
22:13:22 ./tests/basic/gfapi/bug1291259.t .. 
22:13:22 1..10
22:13:22 ok 1, LINENUM:8
22:13:22 ok 2, LINENUM:10
22:13:22 ok 3, LINENUM:11
22:13:22 ok 4, LINENUM:13
22:13:22 ok 5, LINENUM:14
22:13:22 ok 6, LINENUM:19
22:13:22 ok 7, LINENUM:21
22:13:22 not ok 8 , LINENUM:23
22:13:22 FAILED COMMAND: ././tests/basic/gfapi/bug1291259 slave20.cloud.gluster.org patchy /var/log/glusterfs/bug1291259.log
22:13:22 ok 9, LINENUM:27
22:13:22 ok 10, LINENUM:28
22:13:22 Failed 1/10 subtests

Comment 1 Shyamsundar 2017-01-03 09:42:40 UTC
The cause of failure or crash is as follows,

bug1291259.c calls glfs_h_poll_upcall (line 128), and checks if ret is non-zero before calling glfs_upcall_get_reason. The latter dereferences the inarg (cbk) and causes a crash as that is NULL.

The reason for cbk to be NULL, is due to the fact that poll_upcall has not returned any data and still returns a ret of 0.

The consumer (the test program in this case) is meant to either check errno or if cbk is non-NULL before processing the event. As the check is missing this crashes at times and hence causes the regression failure.

Comment 2 Shyamsundar 2017-01-03 09:45:07 UTC

*** This bug has been marked as a duplicate of bug 1405301 ***