[openssl-dev] [openssl.org #4667] Issue with OpenSSL v1.1.0 on AIX with XLC and GCC and -O

REIX, Tony via RT rt at openssl.org
Thu Sep 1 13:09:27 UTC 2016


About the possible "linker quirk", the same linker is used also for version 1.0.2h which runs perferctly.
Also, that does not explain why simply compiling ppccap.c only with -O0 makes the issue to dispappear.


I also tried to repeat the failing test several times: failure is consistent.


Here below are the details you asked.
Please note that the (wrong) result of the 12th failing test is different when compiled with xlc vs gcc.


I've done several experiments (see below for details).
And it appears that, on machine2 where the issue appears with GCC 6.2.0 (both 32/64), the issue does not appear with GCC 4.8.4 (both 32/64).
The issue with XLC (only 64) appears both on machine1 and machine2.

So, my main hypothesis is now:
   I think that the root cause of the issue is that ppccap.c contains some code that was correctly -O optimized by GCC 4.84 (and maybe other versions) and that it is no more correctly optimized by GCC 6.2.0  and that it is badly optimized by XLC v12 and v13 only for 64bits.
Some kind of more aggressive optimization.

Since I had another -O2 issue with Python due to ANSI aliasing, I've tried: "-fPIC -fno-strict-aliasing -fwrapv "  but it does not fix the issue.


I have built/run openssl 1.1.0 on Ubuntu/x86_64 with GCC 4.8.4 and tests are perfect.


Which version of GCC are you using for compiling openssl ?
I would recommend you to try building/testing with GCC 6.2.0 , if you have not moved to this version of GCC yet, and see tests results.


Regards,

Tony



1) Results are the same (on machine2) when compiling with xlc v13 compared to xlc v12: evp test fails for 64bit, not 32bit.

# cd openssl-1.1.0-XLCv13-O/64bit

# make test TESTS=test_evp VERBOSE=1 2>&1 | grep error
Test line 3089(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3095(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3101(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3107(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3113(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3119(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3125(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3131(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3137(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3143(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3149(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
499 tests completed with 12 errors, 0 skipped


Example of last error (I've cut the line in several lines) :

Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
Expected: 64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
332F830E710B97CE98C8A84ABD0B948114AD176E008D33BD60F982B1FF37C8559797A06EF4F0EF61C186324E2B3506383606907B6A7C02B0F9F6157B53C867E4B9166C767B
804D46A59B5216CDE7A4E99040C5A40433225EE282A1B0A06C523EAF4534D7F83FA1155B0047718CBC546A0D072B04B3564EEA1B422273F548271A0BB2316053FA76991955
EBD63159434ECEBB4E466DAE5A1073A6727627097A1049E617D91D361094FA68F0FF77987130305BEABA2EDA04DF997B714D6C6F2C29A6AD5CB4022B02709B
Got:      64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
5CC4390C72D4C96E3F8E5AD8889518DE44EA6CBC81D3529169E78F6A03A6BF57FF8AB174F4B07680658E50DE7A64545D3B181FA6BC19D9844F1CB6F86374A973DF67F27764
4FA0AA095EC097F78D9E9F1B9FAEE68A0FCF88B786861391AB0750A70EC7DD5F0617BD07FA6DCA4C8068F403D4E9DDDDFCFFD5F12814C3D0BCD88A11F3128EDCE8B52376AB
4B417FD34183FC2555B24DA1E2B0B44587127F0F61BFE107137F4290CFFE476C85DA50CEAE07B00C8A23EA96FB60DF6F504FED2DE79FA6AD5CB4022B02709B
499 tests completed with 12 errors, 0 skipped
../util/shlib_wrap.sh ./evp_test ../test/evptests.txt => 1

#   Failed test 'running evp_test evptests.txt'
#   at ../test/recipes/30-test_evp.t line 18.
# Looks like you failed 1 test of 1.
Failed 1/1 test programs. 1/1 subtests failed.



2) Here are the results (on machine2) when compiling with GCC 6.2.0 : evp test fails for both 64bit and 32bit.

# gmake test TESTS=test_evp VERBOSE=1 2>&1 | grep error
Test line 3089(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3095(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3101(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3107(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3113(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3119(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3125(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3131(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3137(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3143(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3149(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
499 tests completed with 12 errors, 0 skipped


Example of last error (I've cut the line in several) :

Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
Expected: 64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
332F830E710B97CE98C8A84ABD0B948114AD176E008D33BD60F982B1FF37C8559797A06EF4F0EF61C186324E2B3506383606907B6A7C02B0F9F6157B53C867E4B9166C767B
804D46A59B5216CDE7A4E99040C5A40433225EE282A1B0A06C523EAF4534D7F83FA1155B0047718CBC546A0D072B04B3564EEA1B422273F548271A0BB2316053FA76991955
EBD63159434ECEBB4E466DAE5A1073A6727627097A1049E617D91D361094FA68F0FF77987130305BEABA2EDA04DF997B714D6C6F2C29A6AD5CB4022B02709B
Got:      64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
0F992F281153EA39F7C9ABFE79F6C798B92C144DCB2725EEB09726399BC279D604F98608C03BAC80E7BD967AB51DB2311360CB3EE2BC70BCC5E97CA6EC2E0A1C6B02435677
97A344344318B428CE15C6A44087082CCE4847AE57BDFA07F859208D4E72CA5DD2F560B1E003E6350C451FCB839B30E91318A01DDAA58E0FB4D97DB449A603DC61F257CD64
94A96EADB6A31F970A57D93D37E40F36A6803C78CDA313F84B7290174D9B112E7D74EC016EE8A2753BCB32BEF25603F092995EF97AA7A6AD5CB4022B02709B



3) Here are the results (on machine1) when compiling with GCC 4.8.4 : evp test succeeds for both 64bit and 32bit.

64bit:
../test/recipes/30-test_evp.t .............. ok
32bit:
../test/recipes/30-test_evp.t .............. ok



4) Here are the results (on machine1) when compiling with XLC v13.1.0.6 : evp test fails for both 64bit and not for 32bit.

64bits:
#   Failed test 'running evp_test evptests.txt'
#   at ../test/recipes/30-test_evp.t line 18.
# Looks like you failed 1 test of 1.
../test/recipes/30-test_evp.t ..............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

# gmake test TESTS=test_evp VERBOSE=1 2>&1 | grep error
Test line 3089(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3095(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3101(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3107(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3113(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3119(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3125(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3131(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3137(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3143(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3149(aligned in-place): unexpected error VALUE_MISMATCH
Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
499 tests completed with 12 errors, 0 skipped

Test line 3164(aligned in-place): unexpected error VALUE_MISMATCH
Expected: 64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
332F830E710B97CE98C8A84ABD0B948114AD176E008D33BD60F982B1FF37C8559797A06EF4F0EF61C186324E2B3506383606907B6A7C02B0F9F6157B53C867E4B9166C767B
804D46A59B5216CDE7A4E99040C5A40433225EE282A1B0A06C523EAF4534D7F83FA1155B0047718CBC546A0D072B04B3564EEA1B422273F548271A0BB2316053FA76991955
EBD63159434ECEBB4E466DAE5A1073A6727627097A1049E617D91D361094FA68F0FF77987130305BEABA2EDA04DF997B714D6C6F2C29A6AD5CB4022B02709B
Got:      64A0861575861AF460F062C79BE643BD5E805CFD345CF389F108670AC76C8CB24C6CFC18755D43EEA09EE94E382D26B0BDB7B73C321B0100D4F03B7F355894CF
5CC4390C72D4C96E3F8E5AD8889518DE44EA6CBC81D3529169E78F6A03A6BF57FF8AB174F4B07680658E50DE7A64545D3B181FA6BC19D9844F1CB6F86374A973DF67F27764
4FA0AA095EC097F78D9E9F1B9FAEE68A0FCF88B786861391AB0750A70EC7DD5F0617BD07FA6DCA4C8068F403D4E9DDDDFCFFD5F12814C3D0BCD88A11F3128EDCE8B52376AB
4B417FD34183FC2555B24DA1E2B0B44587127F0F61BFE107137F4290CFFE476C85DA50CEAE07B00C8A23EA96FB60DF6F504FED2DE79FA6AD5CB4022B02709B

32bit:
../test/recipes/30-test_evp.t .............. ok



5) Here are the results (on machine2) when compiling with GCC 4.8.4 : evp test fails for both 64bit and not for 32bit.

64bits:
../test/recipes/30-test_evp.t .............. ok

32bits:
../test/recipes/30-test_evp.t .............. ok







Le 01/09/2016 12:53, Andy Polyakov via RT a écrit :

Results:


In short:
 - no issue with v1.0.2h on both machines
 - issue appears with:
      - XLC -O but only for 64bits
      - GCC -O for both 64bits and 32bits
 - issue disappears when building ppccap.c with -O0 .

So, I think that the probability that both XLC and GCC have an issue when optimizing ppccap.c is very low.



What they have in common is that they both use same linker, so they both
can trigger some linker quirk...



So, I guess that ppccap.c has something special.



Could you tell which test does it fail? In order to do that run 'make
test TESTS=test_evp VERBOSE=1' and note which line[s] it fails.





-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4667
Please log in as guest with password guest if prompted



More information about the openssl-dev mailing list