Bug #25381 gcov build fails to test with openssl
Submitted: 3 Jan 2007 10:25 Modified: 16 Mar 2009 11:29
Reporter: Ingo Strüwing Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.1.23 OS:Linux (Debian Linux/x86)
Assigned to: Daniel Fischer CPU Architecture:Any

[3 Jan 2007 10:25] Ingo Strüwing
Description:
Compiling with BUILD/compile-pentium-gcov produces a couple of test failures, which do not happen after compiling with BUILD/compile-pentium-debug-max.

...
openssl_1                      [ fail ]

Errors are (from /home/mydev/mysql-5.1-wl3561-one/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 18: query 'connect  con1,localhost,ssl_user1,,,,,SSL' failed: 2026: SSL connection error
(the last lines may be the most important ones)

...
ps                             [ fail ]

Errors are (from /home/mydev/mysql-5.1-wl3561-one/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 2126: query 'call proc_1()' failed with wrong errno 1289: 'The 'plugin' feature is disabled; you need MySQL built with 'HAVE_DLOPEN' to have it working', instead of 1126...
(the last lines may be the most important ones)

...
ps_not_windows                 [ fail ]

Errors are (from /home/mydev/mysql-5.1-wl3561-one/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 11: query 'call proc_1()' failed with wrong errno 1289: 'The 'plugin' feature is disabled; you need MySQL built with 'HAVE_DLOPEN' to have it working', instead of 1124...
(the last lines may be the most important ones)

...
rpl_openssl                    [ fail ]  timeout

Stopping All Servers
Shutting-down Instance Manager
Restoring snapshot of databases
Saving core.18753
Resuming Tests

...
ssl                            [ fail ]

Errors are (from /home/mydev/mysql-5.1-wl3561-one/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 6: query 'connect  ssl_con,localhost,root,,,,,SSL' failed: 2026: SSL connection error
(the last lines may be the most important ones)

...
ssl_compress                   [ fail ]

Errors are (from /home/mydev/mysql-5.1-wl3561-one/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 7: query 'connect  ssl_compress_con,localhost,root,,,,,SSL COMPRESS' failed: 2026: SSL connection error
(the last lines may be the most important ones)

=======
If coverage builds fail, the risk is very high, that developers would abstain from using it. So it should be fixed urgently IMHO.
=======

Example from rpl_openssl:

2324         carry += LowLevel::Add(R0, R0, T1, N2);
2325         carry += LowLevel::Add(R0, R0, T3, N2);
2326         assert (carry >= 0 && carry <= 2);
2327 
2328         CopyWords(R1, T3, N2);
2329         Increment(R1, N2, carry);

#11 0x08aef6a2 in TaoCrypt::RecursiveMultiplyTop (R=0x916e7c0, T=0x916e808, L=0x916e7e8, A=0x916e7a0, B=0x916e700, N=8) at integer.cpp:2326
/home/mydev/mysql-5.1-wl3561-one/extra/yassl/taocrypt/src/integer.cpp:2326:59502:beg:0x8aef6a2

#10 0x08b20d46 in __assert_fail ()
#11 0x08aef6a2 in TaoCrypt::RecursiveMultiplyTop (R=0x916e7c0, T=0x916e808, L=0x916e7e8, A=0x916e7a0, B=0x916e700, N=8) at integer.cpp:2326
#12 0x08afd804 in TaoCrypt::MultiplyTop (R=0x916e7c0, T=0x916e808, L=0x916e7e8, A=0x916e7a0, B=0x916e700, N=8) at integer.cpp:3799
#13 0x08aef996 in TaoCrypt::RecursiveInverseModPower2 (R=0x916e7a0, T=0x916e7e8, A=0x916e700, N=16) at integer.cpp:3842
#14 0x08af310b in MontgomeryRepresentation (this=0xb7d94588, m=@0xb7d94670) at integer.cpp:3875
#15 0x08af67f2 in TaoCrypt::ModularArithmetic::SimultaneousExponentiate (this=0xb7d94664, results=0xb7d946d0, base=@0x916e4c0, exponents=0xb7d946e0, exponentsCount=1) at integer.cpp:3760
#16 0x08b14f2e in TaoCrypt::AbstractRing::Exponentiate (this=0xb7d94664, base=@0x916e4c0, exponent=@0xb7d946e0) at algebra.cpp:313
#17 0x08af3559 in TaoCrypt::a_exp_b_mod_c (x=@0x916e4c0, e=@0xb7d946e0, m=@0x916e4b0) at integer.cpp:3563
#18 0x08ad2382 in TaoCrypt::DH::GeneratePublic (this=0x916e4b0, priv=0x916e578 "", pub=0x916e530 "\fô\002\t\fô\002\t") at dh.cpp:75
#19 0x08ad28c8 in TaoCrypt::DH::GenerateKeyPair (this=0x916e4b0, rng=@0x9130e40, priv=0x916e578 "", pub=0x916e530 "\fô\002\t\fô\002\t") at dh.cpp:57
#20 0x08aa5035 in DiffieHellman (this=0x90bb200, p=@0x90add00, g=@0x90add04, random=@0x916d6fc) at crypto_wrapper.cpp:838
#21 0x08a94823 in yaSSL::Crypto::SetDH (this=0x916d6f0, dh=@0x90add00) at yassl_int.cpp:2084
#22 0x08a9503d in SSL (this=0x916d6f0, ctx=0x90adca0) at yassl_int.cpp:332
#23 0x08a61126 in yaSSL_new (ctx=0x90adca0) at ssl.cpp:229
#24 0x089a0fa5 in sslaccept (ptr=0x90adc90, vio=0x9130cb0, timeout=28800) at viossl.c:162
#25 0x082476c9 in check_connection (thd=0x91656a8) at sql_parse.cc:1011
#26 0x0825ea6a in handle_one_connection (arg=0x91656a8) at sql_parse.cc:1187
#27 0x08abbd14 in pthread_start_thread (arg=0x913d060) at manager.c:310
#28 0x08b456ba in clone ()

I saw this before. It might not be directly related to the coverage build. But it is repeatable and doesn't happen with a normal build.

How to repeat:
BUILD/compile-pentium-gcov --with-debug=full --prefix="/home/mydev/install-5.1-wl3561-one"

make test-force
[24 Sep 2007 12:52] Ingo Strüwing
I am sorry that I missed the internal note before.

I retried on a current pull of mysql-5.1.
In this version, BUILD/compile-pentium-gcov does not contain $static_link. I checked that my objects are compiled without the option -all-static, which is usually supplied by $static_link.

The failures on all SSL related tests still fail:

main.openssl_1                 [ fail ]

mysqltest: At line 19: query 'connect  con1,localhost,ssl_user1,,,,,SSL' failed: 2026: SSL connection error

The result from queries just before the failure was:
drop table if exists t1;
create table t1(f1 int);
insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;

More results from queries before failure can be found in /home/mydev/mysql-5.1-amain/mysql-test/var/log/openssl_1.log

Stopping All Servers
Restoring snapshot of databases
Saving core.20180
Resuming Tests

main.ssl                       [ fail ]

mysqltest: At line 6: query 'connect  ssl_con,localhost,root,,,,,SSL' failed: 2026: SSL connection error

Stopping All Servers
Restoring snapshot of databases
Saving core.20188
Resuming Tests

main.ssl_8k_key                [ fail ]

mysqltest: At line 5: command "$MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1" failed

The result from queries just before the failure was:
ERROR 2026 (HY000): SSL connection error
exec of '/home/mydev/mysql-5.1-amain/client/mysql --no-defaults --debug-check --host=localhost  --user=root --password= --port=10680 --socket=/home/mydev/mysql-5.1-amain/mysql-test/var/tmp/master.sock --character-sets-dir=/home/mydev/mysql-5.1-amain/sql/share/charsets --ssl --ssl-key=/home/mydev/mysql-5.1-amain/mysql-test/std_data/client-key.pem --ssl-cert=/home/mydev/mysql-5.1-amain/mysql-test/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1' failed, error: 256, status: 1, errno: 0

More results from queries before failure can be found in /home/mydev/mysql-5.1-amain/mysql-test/var/log/ssl_8k_key.log

Stopping All Servers
Restoring snapshot of databases
Saving core.20196
Resuming Tests

main.ssl_compress              [ fail ]

mysqltest: At line 7: query 'connect  ssl_compress_con,localhost,root,,,,,SSL COMPRESS' failed: 2026: SSL connection error

Stopping All Servers
Restoring snapshot of databases
Saving core.20205
Resuming Tests

main.ssl_connect               [ fail ]

mysqltest: At line 9: query 'connect  test_con1,localhost,root,,,,,SSL' failed: 2026: SSL connection error

Stopping All Servers
Restoring snapshot of databases
Saving core.20213
Resuming Tests

rpl.rpl_ssl                    [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

rpl.rpl_ssl1                   [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

The stack backtrace from one of the tests is almost the same as reported.
[16 Dec 2007 13:45] Ingo Strüwing
I can add here that it still happens on a 32-bit Debian x86.
It does not happen on a 64-bit Debian x86_64.
It has lower urgency for me now.
[16 Mar 2009 11:29] Daniel Fischer
This bug was never verified, and I can't repeat it at this time. In any case, gcov is likely not the culprit.