Bug 1315079

Summary: cfitsio test app miscompiled due LRA
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: davejohansen, jakub, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-05 13:34:06 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:
Bug Depends On:    
Bug Blocks: 467765    
Attachments:
Description Flags
preprocessed source file none

Description Dan Horák 2016-03-06 13:15:11 UTC
Created attachment 1133484 [details]
preprocessed source file

cfitsio test case segfaults when built with -O2, but runs correctly with -O1 or -mno-lra (Jakub, thanks for the hint :-))


gcc -o testprog -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 testprog.i -L. -lcfitsio -lz -lm -lpthread


from GDB

...
Program received signal SIGSEGV, Segmentation fault.
main () at testprog.c:2209
2209	        printf(" %2.0f", doutarray[jj]);
Missing separate debuginfos, use: dnf debuginfo-install zlib-1.2.8-10.fc24.s390x
(gdb) where
#0  main () at testprog.c:2209
(gdb) l
2204	        printf(" %2.0f", eoutarray[jj]);
2205	      printf(" %d\nD", status);
2206	
2207	      ffgcvd(fptr, 8, ii, 1, ii, 99., doutarray, &anynull, &status);
2208	      for (jj = 0; jj < ii; jj++)
2209	        printf(" %2.0f", doutarray[jj]);
2210	      printf(" %d\n", status);
2211	
2212	      ffgdes(fptr, 8, ii, &repeat, &offset, &status);
2213	      printf("Column 8 repeat and offset = %ld %ld\n", repeat, offset);
(gdb) 


koji build is http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2139659
more info will follow

Version-Release number of selected component (if applicable):
gcc-6.0.0-0.14.fc24.s390x
but I got the segfault also from -15

Comment 1 Jakub Jelinek 2016-03-07 11:45:17 UTC
Started with http://gcc.gnu.org/r222144
Unfortunately the problem is in a huge function, and while I've managed to remove a few statements from it already while still reproducing the problem, it still calls 184 different functions from the library.

Comment 2 Dan Horák 2016-03-07 12:32:58 UTC
yes, that's what I've figured out too, 80k of text in main() :-(

Comment 3 Dan Horák 2016-03-29 11:41:06 UTC
build/test suite passes with gcc-6.0.0-0.18.fc24