[openssl-dev] [OpenSSL][1.0.2h] Memory leaks

Joey Yandle xoloki at gmail.com
Wed Jun 1 17:14:45 UTC 2016


I tried to reproduce this last night, on the following platforms:

linux x86_64 fips
windows win64a fips
windows mingw64 fips

make test succeeded with no errors on the first two platforms.  For 
windows/mingw64, though, I did get a different error:

test SSL protocol
test ssl3 is forbidden in FIPS mode
180668:error:2D07808C:FIPS routines:FIPS_module_mode_set:unsupported 
platform:fips.c:322:
ssl2 disabled: skipping test
test tls1
181056:error:2D07808C:FIPS routines:FIPS_module_mode_set:unsupported 
platform:fips.c:322:
make[1]: *** [test_ssl] Error 1
make[1]: Leaving directory `/c/src/openssl-1.0.2h/test'
make: *** [tests] Error 2

However, if I do make -k test, then I finish without the memory leaks 
you saw:

ALL OCSP TESTS SUCCESSFUL
Test X509v3_check_*
../util/shlib_wrap.sh ./v3nametest
../util/shlib_wrap.sh ./heartbeat_test
Test constant time utilites
../util/shlib_wrap.sh ./constant_time_test
Testing constant time operations...
ok (ran 1908 tests)
test_verify_extra
../util/shlib_wrap.sh ./verify_extra_test
PASS
test_clienthello
../util/shlib_wrap.sh ./clienthellotest
test_sslv2conftest
../util/shlib_wrap.sh ./sslv2conftest
SSLv2 CONF Test number 0
SSLv2 CONF Test number 1
SSLv2 CONF test: PASSED

How did you configure/build?  What versions of mingw/msys did you use?

cheers,

Joey

On 05/31/2016 08:37 PM, Sergio NNX wrote:
> Ciao.
>
> Just built OpenSSL 1.0.2h from source and when running the tests I can
> see some memory leaks.
> The same did not happen when building previous versions on the same
> environment and same command line options.
>
> Thanks in advance.
>
> Find below the last bit of a long long long test output:
>
> ...
> ...
> ...
> ALL OCSP TESTS SUCCESSFUL
> Test X509v3_check_*
> ../util/shlib_wrap.sh ./v3nametest
> ../util/shlib_wrap.sh ./heartbeat_test
> Test constant time utilites
> ../util/shlib_wrap.sh ./constant_time_test
> Testing constant time operations...
> ok (ran 1908 tests)
> test_verify_extra
> ../util/shlib_wrap.sh ./verify_extra_test
> PASS
> test_clienthello
> ../util/shlib_wrap.sh ./clienthellotest
> [04:21:51]   221 file=buf_str.c, line=92, thread=1772, number=16,
> address=00867FC8
> [04:21:51]   426 file=eng_lib.c, line=168, thread=1772, number=4,
> address=00869648
> [04:21:51]   455 file=stack.c, line=162, thread=1772, number=20,
> address=0086ADE8
> [04:21:51]   418 file=lhash.c, line=122, thread=1772, number=64,
> address=00869588
> [04:21:51]   222 file=buf_str.c, line=92, thread=1772, number=7,
> address=00BBFDC8
> [04:21:51]   419 file=eng_lib.c, line=168, thread=1772, number=4,
> address=008695D0
> [04:21:51]   411 file=lhash.c, line=122, thread=1772, number=64,
> address=008694C8
> [04:21:51]   428 file=stack.c, line=162, thread=1772, number=20,
> address=0086ACC8
> [04:21:51]   412 file=eng_lib.c, line=168, thread=1772, number=4,
> address=00869510
> [04:21:51]   266 file=stack.c, line=162, thread=1772, number=20,
> address=0086AC68
> [04:21:51]    72 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00BBFD50
> [04:21:51]   251 file=stack.c, line=162, thread=1772, number=20,
> address=0086AC08
> [04:21:51]   236 file=stack.c, line=162, thread=1772, number=20,
> address=0086ABA8
> [04:21:51]   233 file=lhash.c, line=122, thread=1772, number=64,
> address=0086AB48
> [04:21:51]   234 file=eng_lib.c, line=168, thread=1772, number=4,
> address=00BB27F0
> [04:21:51]   255 file=lhash.c, line=122, thread=1772, number=64,
> address=0086C0A8
> [04:21:51]   256 file=eng_lib.c, line=168, thread=1772, number=4,
> address=0086C0F0
> [04:21:51]   429 file=stack.c, line=164, thread=1772, number=32,
> address=00871E98
> [04:21:51]   456 file=stack.c, line=164, thread=1772, number=16,
> address=0086E860
> [04:21:51]   261 file=eng_table.c, line=150, thread=1772, number=16,
> address=00868520
> [04:21:51]   417 file=lhash.c, line=120, thread=1772, number=96,
> address=00869520
> [04:21:51]   421 file=stack.c, line=162, thread=1772, number=20,
> address=0086ACA8
> [04:21:51]   260 file=lhash.c, line=191, thread=1772, number=12,
> address=008684F0
> [04:21:51]   224 file=buf_str.c, line=92, thread=1772, number=18,
> address=0086A8C0
> [04:21:51]   223 file=ameth_lib.c, line=289, thread=1772, number=108,
> address=0086A848
> [04:21:51]   259 file=stack.c, line=164, thread=1772, number=16,
> address=008684C0
> [04:21:51]   262 file=stack.c, line=162, thread=1772, number=20,
> address=0086AC48
> [04:21:51]   431 file=lhash.c, line=120, thread=1772, number=96,
> address=00871D78
> [04:21:51]   253 file=lhash.c, line=191, thread=1772, number=12,
> address=00868418
> [04:21:51]   247 file=stack.c, line=162, thread=1772, number=20,
> address=0086ABE8
> [04:21:51]   133 file=eng_lib.c, line=69, thread=1772, number=112,
> address=008693E8
> [04:21:51]   252 file=stack.c, line=164, thread=1772, number=16,
> address=008683E8
> [04:21:51]   410 file=lhash.c, line=120, thread=1772, number=96,
> address=00869460
> [04:21:51]   220 file=ameth_lib.c, line=289, thread=1772, number=108,
> address=0086A7D0
> [04:21:51]   219 file=eng_lib.c, line=69, thread=1772, number=112,
> address=0086A758
> [04:21:51]   425 file=lhash.c, line=122, thread=1772, number=64,
> address=00871D30
> [04:21:51]   437 file=lhash.c, line=191, thread=1772, number=12,
> address=0086E608
> [04:21:51]   257 file=eng_table.c, line=150, thread=1772, number=16,
> address=008644A8
> [04:21:51]   250 file=eng_table.c, line=150, thread=1772, number=16,
> address=008683A0
> [04:21:51]   113 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00868B70
> [04:21:51]   246 file=eng_table.c, line=150, thread=1772, number=16,
> address=008682F8
> [04:21:51]   249 file=lhash.c, line=191, thread=1772, number=12,
> address=00868370
> [04:21:51]   248 file=stack.c, line=164, thread=1772, number=16,
> address=00868340
> [04:21:51]   361 file=eng_lib.c, line=69, thread=1772, number=112,
> address=0086FD48
> [04:21:51]   195 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00869E68
> [04:21:51]   218 file=eng_lib.c, line=69, thread=1772, number=112,
> address=0086A6E0
> [04:21:51]   434 file=eng_table.c, line=150, thread=1772, number=16,
> address=0086E590
> [04:21:51]   430 file=lhash.c, line=191, thread=1772, number=12,
> address=0086E518
> [04:21:51]   231 file=pmeth_lib.c, line=200, thread=1772, number=108,
> address=0086AA68
> [04:21:51]   232 file=lhash.c, line=120, thread=1772, number=96,
> address=0086AAE0
> [04:21:51]   242 file=lhash.c, line=191, thread=1772, number=12,
> address=00868280
> [04:21:51]   239 file=eng_table.c, line=150, thread=1772, number=16,
> address=00868208
> [04:21:51]   241 file=stack.c, line=164, thread=1772, number=16,
> address=00868250
> [04:21:51]   238 file=lhash.c, line=191, thread=1772, number=12,
> address=008681D8
> [04:21:51]    98 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00866AF8
> [04:21:51]   237 file=stack.c, line=164, thread=1772, number=16,
> address=008681A8
> [04:21:51]   427 file=eng_table.c, line=150, thread=1772, number=16,
> address=0086E4A0
> [04:21:51]   423 file=lhash.c, line=191, thread=1772, number=12,
> address=0086E428
> [04:21:51]   229 file=pmeth_lib.c, line=200, thread=1772, number=108,
> address=0086A978
> [04:21:51]   230 file=pmeth_lib.c, line=200, thread=1772, number=108,
> address=0086A9F0
> [04:21:51]   245 file=eng_lib.c, line=168, thread=1772, number=4,
> address=008662E0
> [04:21:51]   254 file=lhash.c, line=120, thread=1772, number=96,
> address=0086C040
> [04:21:51]   171 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00866268
> [04:21:51]   435 file=stack.c, line=162, thread=1772, number=20,
> address=0086ACE8
> [04:21:51]   235 file=eng_table.c, line=150, thread=1772, number=16,
> address=00868160
> [04:21:51]   422 file=stack.c, line=164, thread=1772, number=32,
> address=00871EC0
> [04:21:51]   414 file=stack.c, line=162, thread=1772, number=20,
> address=0086AC88
> [04:21:51]   420 file=eng_table.c, line=150, thread=1772, number=16,
> address=0086E3B0
> [04:21:51]   416 file=lhash.c, line=191, thread=1772, number=12,
> address=0086E338
> [04:21:51]   258 file=stack.c, line=162, thread=1772, number=20,
> address=0086AC28
> [04:21:51]   159 file=eng_lib.c, line=69, thread=1772, number=112,
> address=008661F0
> [04:21:51]    54 file=eng_lib.c, line=69, thread=1772, number=112,
> address=00865978
> [04:21:51]   228 file=buf_str.c, line=92, thread=1772, number=9,
> address=008680A0
> [04:21:51]   244 file=lhash.c, line=122, thread=1772, number=64,
> address=0086BFF8
> [04:21:51]   240 file=stack.c, line=162, thread=1772, number=20,
> address=0086ABC8
> [04:21:51]   225 file=buf_str.c, line=92, thread=1772, number=9,
> address=00868040
> [04:21:51]   413 file=eng_table.c, line=150, thread=1772, number=16,
> address=0086E2C0
> [04:21:51]    53 file=eng_lib.c, line=168, thread=1772, number=4,
> address=00BBFFD8
> [04:21:51]   415 file=stack.c, line=164, thread=1772, number=64,
> address=00871EE8
> [04:21:51]   227 file=buf_str.c, line=92, thread=1772, number=18,
> address=0086A958
> [04:21:51]    52 file=stack.c, line=164, thread=1772, number=64,
> address=00871E28
> [04:21:51]   436 file=stack.c, line=164, thread=1772, number=32,
> address=00871E70
> [04:21:51]   226 file=ameth_lib.c, line=289, thread=1772, number=108,
> address=0086A8E0
> [04:21:51]    51 file=stack.c, line=162, thread=1772, number=20,
> address=00865958
> [04:21:51]   432 file=lhash.c, line=122, thread=1772, number=64,
> address=00871DE0
> [04:21:51]   243 file=lhash.c, line=120, thread=1772, number=96,
> address=0086BF90
> [04:21:51]    46 file=eng_lib.c, line=69, thread=1772, number=112,
> address=008658E0
> [04:21:51]   433 file=eng_lib.c, line=168, thread=1772, number=4,
> address=00869658
> [04:21:51]   265 file=eng_table.c, line=150, thread=1772, number=16,
> address=008685C8
> [04:21:51]   268 file=lhash.c, line=191, thread=1772, number=12,
> address=00868640
> [04:21:51]   264 file=lhash.c, line=191, thread=1772, number=12,
> address=00868598
> [04:21:51]   267 file=stack.c, line=164, thread=1772, number=16,
> address=00868610
> [04:21:51]   263 file=stack.c, line=164, thread=1772, number=16,
> address=00868568
> [04:21:51]   424 file=lhash.c, line=120, thread=1772, number=96,
> address=008695E0
> 4141 bytes leaked in 94 chunks
> test_sslv2conftest
> ../util/shlib_wrap.sh ./sslv2conftest
> SSLv2 CONF Test number 0
> SSLv2 CONF Test number 1
> [04:21:51]   420 file=eng_lib.c, line=168, thread=1164, number=4,
> address=020095F8
> [04:21:51]   427 file=eng_lib.c, line=168, thread=1164, number=4,
> address=02009670
> [04:21:51]   424 file=lhash.c, line=191, thread=1164, number=12,
> address=0200E478
> [04:21:51]   428 file=eng_table.c, line=150, thread=1164, number=16,
> address=0200E4F0
> [04:21:51]   456 file=stack.c, line=162, thread=1164, number=20,
> address=0200AE10
> [04:21:51]   413 file=eng_lib.c, line=168, thread=1164, number=4,
> address=02009538
> [04:21:51]   419 file=lhash.c, line=122, thread=1164, number=64,
> address=020095B0
> [04:21:51]   417 file=lhash.c, line=191, thread=1164, number=12,
> address=0200E388
> [04:21:51]   421 file=eng_table.c, line=150, thread=1164, number=16,
> address=0200E400
> [04:21:51]   429 file=stack.c, line=162, thread=1164, number=20,
> address=0200ACF0
> [04:21:51]   412 file=lhash.c, line=122, thread=1164, number=64,
> address=020094F0
> [04:21:51]   267 file=stack.c, line=162, thread=1164, number=20,
> address=0200AC90
> [04:21:51]   414 file=eng_table.c, line=150, thread=1164, number=16,
> address=0200E310
> [04:21:51]   252 file=stack.c, line=162, thread=1164, number=20,
> address=0200AC30
> [04:21:51]   237 file=stack.c, line=162, thread=1164, number=20,
> address=0200ABD0
> [04:21:51]    54 file=eng_lib.c, line=168, thread=1164, number=4,
> address=00A2FFD0
> [04:21:51]   234 file=lhash.c, line=122, thread=1164, number=64,
> address=0200AB70
> [04:21:51]   258 file=eng_table.c, line=150, thread=1164, number=16,
> address=020044C0
> [04:21:51]   437 file=stack.c, line=164, thread=1164, number=32,
> address=02011EA8
> [04:21:51]   416 file=stack.c, line=164, thread=1164, number=64,
> address=02011F20
> [04:21:51]   225 file=buf_str.c, line=92, thread=1164, number=18,
> address=0200A8E8
> [04:21:51]   433 file=lhash.c, line=122, thread=1164, number=64,
> address=02011E18
> [04:21:51]   261 file=lhash.c, line=191, thread=1164, number=12,
> address=02008530
> [04:21:51]    53 file=stack.c, line=164, thread=1164, number=64,
> address=02011E60
> [04:21:51]   260 file=stack.c, line=164, thread=1164, number=16,
> address=02008500
> [04:21:51]   411 file=lhash.c, line=120, thread=1164, number=96,
> address=02009488
> [04:21:51]   254 file=lhash.c, line=191, thread=1164, number=12,
> address=02008458
> [04:21:51]   422 file=stack.c, line=162, thread=1164, number=20,
> address=0200ACD0
> [04:21:51]   253 file=stack.c, line=164, thread=1164, number=16,
> address=02008428
> [04:21:51]   224 file=ameth_lib.c, line=289, thread=1164, number=108,
> address=0200A870
> [04:21:51]   221 file=ameth_lib.c, line=289, thread=1164, number=108,
> address=0200A7F8
> [04:21:51]   263 file=stack.c, line=162, thread=1164, number=20,
> address=0200AC70
> [04:21:51]    47 file=eng_lib.c, line=69, thread=1164, number=112,
> address=020058E8
> [04:21:51]   248 file=stack.c, line=162, thread=1164, number=20,
> address=0200AC10
> [04:21:51]   134 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02009410
> [04:21:51]   114 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02008B98
> [04:21:51]   251 file=eng_table.c, line=150, thread=1164, number=16,
> address=020083E0
> [04:21:51]   247 file=eng_table.c, line=150, thread=1164, number=16,
> address=02008338
> [04:21:51]   250 file=lhash.c, line=191, thread=1164, number=12,
> address=020083B0
> [04:21:51]   220 file=eng_lib.c, line=69, thread=1164, number=112,
> address=0200A780
> [04:21:51]   219 file=eng_lib.c, line=69, thread=1164, number=112,
> address=0200A708
> [04:21:51]   233 file=lhash.c, line=120, thread=1164, number=96,
> address=0200AB08
> [04:21:51]   249 file=stack.c, line=164, thread=1164, number=16,
> address=02008380
> [04:21:51]   257 file=eng_lib.c, line=168, thread=1164, number=4,
> address=0200C128
> [04:21:51]   240 file=eng_table.c, line=150, thread=1164, number=16,
> address=02008248
> [04:21:51]   243 file=lhash.c, line=191, thread=1164, number=12,
> address=020082C0
> [04:21:51]   196 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02009E90
> [04:21:51]   232 file=pmeth_lib.c, line=200, thread=1164, number=108,
> address=0200AA90
> [04:21:51]   231 file=pmeth_lib.c, line=200, threSSLv2 CONF test: PASSED
> ad=1164, number=108, address=0200AA18
> [04:21:51]   239 file=lhash.c, line=191, thread=1164, number=12,
> address=02008218
> [04:21:51]   242 file=stack.c, line=164, thread=1164, number=16,
> address=02008290
> [04:21:51]   238 file=stack.c, line=164, thread=1164, number=16,
> address=020081E8
> [04:21:51]   235 file=eng_lib.c, line=168, thread=1164, number=4,
> address=02006308
> [04:21:51]   246 file=eng_lib.c, line=168, thread=1164, number=4,
> address=0200C068
> [04:21:51]   256 file=lhash.c, line=122, thread=1164, number=64,
> address=0200C0E0
> [04:21:51]   457 file=stack.c, line=164, thread=1164, number=16,
> address=0200E8B0
> [04:21:51]   223 file=buf_str.c, line=92, thread=1164, number=7,
> address=00A2FE00
> [04:21:51]    99 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02006B20
> [04:21:51]    73 file=eng_lib.c, line=69, thread=1164, number=112,
> address=00A2FD88
> [04:21:51]   230 file=pmeth_lib.c, line=200, thread=1164, number=108,
> address=0200A9A0
> [04:21:51]   236 file=eng_table.c, line=150, thread=1164, number=16,
> address=020081A0
> [04:21:51]   245 file=lhash.c, line=122, thread=1164, number=64,
> address=0200C020
> [04:21:51]   430 file=stack.c, line=164, thread=1164, number=32,
> address=02011ED0
> [04:21:51]   172 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02006290
> [04:21:51]   160 file=eng_lib.c, line=69, thread=1164, number=112,
> address=02006218
> [04:21:51]   436 file=stack.c, line=162, thread=1164, number=20,
> address=0200AD10
> [04:21:51]   229 file=buf_str.c, line=92, thread=1164, number=9,
> address=020080E0
> [04:21:51]   415 file=stack.c, line=162, thread=1164, number=20,
> address=0200ACB0
> [04:21:51]   222 file=buf_str.c, line=92, thread=1164, number=16,
> address=02008008
> [04:21:51]   226 file=buf_str.c, line=92, thread=1164, number=9,
> address=02008080
> [04:21:51]   426 file=lhash.c, line=122, thread=1164, number=64,
> address=02011D68
> [04:21:51]   259 file=stack.c, line=162, thread=1164, number=20,
> address=0200AC50
> [04:21:51]    55 file=eng_lib.c, line=69, thread=1164, number=112,
> address=020059A0
> [04:21:51]   432 file=lhash.c, line=120, thread=1164, number=96,
> address=02011DB0
> [04:21:51]   438 file=lhash.c, line=191, thread=1164, number=12,
> address=0200E658
> [04:21:51]   241 file=stack.c, line=162, thread=1164, number=20,
> address=0200ABF0
> [04:21:51]   431 file=lhash.c, line=191, thread=1164, number=12,
> address=0200E568
> [04:21:51]   435 file=eng_table.c, line=150, thread=1164, number=16,
> address=0200E5E0
> [04:21:51]   362 file=eng_lib.c, line=69, thread=1164, number=112,
> address=0200FD80
> [04:21:51]   255 file=lhash.c, line=120, thread=1164, number=96,
> address=0200C078
> [04:21:51]   423 file=stack.c, line=164, thread=1164, number=32,
> address=02011EF8
> [04:21:51]   227 file=ameth_lib.c, line=289, thread=1164, number=108,
> address=0200A908
> [04:21:51]   228 file=buf_str.c, line=92, thread=1164, number=18,
> address=0200A980
> [04:21:51]   244 file=lhash.c, line=120, thread=1164, number=96,
> address=0200BFB8
> [04:21:51]    52 file=stack.c, line=162, thread=1164, number=20,
> address=02005980
> [04:21:51]   266 file=eng_table.c, line=150, thread=1164, number=16,
> address=02008608
> [04:21:51]   425 file=lhash.c, line=120, thread=1164, number=96,
> address=02009608
> [04:21:51]   269 file=lhash.c, line=191, thread=1164, number=12,
> address=02008680
> [04:21:51]   434 file=eng_lib.c, line=168, thread=1164, number=4,
> address=02009680
> [04:21:51]   265 file=lhash.c, line=191, thread=1164, number=12,
> address=020085D8
> [04:21:51]   268 file=stack.c, line=164, thread=1164, number=16,
> address=02008650
> [04:21:51]   264 file=stack.c, line=164, thread=1164, number=16,
> address=020085A8
> [04:21:51]   418 file=lhash.c, line=120, thread=1164, number=96,
> address=02009548
> [04:21:51]   262 file=eng_table.c, line=150, thread=1164, number=16,
> address=02008560
> 4141 bytes leaked in 94 chunks
> make[1]: Leaving directory `/src/openssl-1.0.2h/test'
> OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
> OpenSSL 1.0.2h-fips  3 May 2016
> built on: reproducible build, date unspecified
> platform: mingw
> options:  bn(64,32) rc4(idx,int) des(ptr,risc1,16,long) idea(int)
> blowfish(idx)
> compiler: /mingw/bin/gcc.exe -I. -I.. -I../include  -DZLIB
> -DOPENSSL_THREADS -D_MT -DDSO_WIN32
> -DOPENSSL_SSL_CLIENT_ENGINE_AUTO=capi -DOPENSSL_CAPIENG_DIALOG
> -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
> -D_WIN32_IE=0x0501 -DPTW32_STATIC_LIB -O0 -pipe -mms-bitfields
> -fno-builtin -march=i686 -mtune=i686 -fomit-frame-pointer -Wall
> -I/mingw/include
> OPENSSLDIR: "C:/OpenSSL"
>
>
>
>


More information about the openssl-dev mailing list