Bug 1126463

Summary: test fails when openssl is compiled with gcc-4.9.1-2.fc21.1
Product: [Fedora] Fedora Reporter: Michal Toman <mtoman>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: jakub, law, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: s390   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-4.9.1-7.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-29 16:05:53 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
sha512.i none

Description Michal Toman 2014-08-04 13:30:44 UTC
Created attachment 923877 [details]
sha512.i

The sha512t test fails when openssl is compiled with gcc-4.9.1-2.fc21.1.s390 with -O2, while -O1 and -O0 work correctly.

I have tracked the problem down to function sha512_block_data_order from file crypto/sha/sha512.c. Prefixing the function with __attribute__((optimize (0))) fixes the problem. __attribute__((noinline,noclone)) does not help - the test is still failing. The program does not crash, it just calculates a wrong result.

Attaching the preprocessed source.

Comment 1 Jakub Jelinek 2014-08-04 13:38:56 UTC
Can you turn this into a self-contained testcase?  I.e. create a short main
that will populate the SHA512_CTX with some values that show the miscompilation, point it to unsigned long long array filled, call sha512_block_data_order with those arguments and after calling it e.g. compare SHA512_CTX content if it is the expected one?  Thanks.

Comment 3 Jakub Jelinek 2014-08-05 15:00:12 UTC
Now tracked upstream as PR62025.