Bug 1315079 - cfitsio test app miscompiled due LRA
Summary: cfitsio test app miscompiled due LRA
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 24
Hardware: s390x
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ZedoraTracker
TreeView+ depends on / blocked
 
Reported: 2016-03-06 13:15 UTC by Dan Horák
Modified: 2016-04-05 13:34 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-05 13:34:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
preprocessed source file (248.87 KB, text/plain)
2016-03-06 13:15 UTC, Dan Horák
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 70123 0 None None None 2016-03-07 18:02:26 UTC

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


Note You need to log in before you can comment on or make changes to this bug.