Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with MariaDB 10.3.9 #275

Closed
loqs opened this issue Oct 2, 2018 · 15 comments
Closed

Test failures with MariaDB 10.3.9 #275

loqs opened this issue Oct 2, 2018 · 15 comments
Assignees
Labels
mariadb MariaDB specific issue
Milestone

Comments

@loqs
Copy link

loqs commented Oct 2, 2018

"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- mysql.bs blib/arch/auto/DBD/mysql/mysql.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# Driver version is 4.048
t/00base.t .............................. ok
# DBI connect('','builduser',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) at t/05dbcreate.t line 16.
t/05dbcreate.t .......................... skipped: no database connection
# mysql_clientinfo is: 10.3.9
# mysql_clientversion is: 100309
# mysql_serverversion is: 100309
# mysql_hostinfo is: Localhost via UNIX socket
# mysql_serverinfo is: 10.3.9-MariaDB-log
# mysql_stat is: Uptime: 10  Threads: 8  Questions: 2  Slow queries: 0  Opens: 17  Flush tables: 1  Open tables: 11  Queries per second avg: 0.200
# mysql_protoinfo is: 10
# SQL_DBMS_VER is 10.3.9-MariaDB-log
# Default storage engine is: InnoDB
2018-10-02 16:08:18 10 [Warning] Access denied for user '4yZ73s9qeECdWi'@'localhost' (using password: YES)
t/10connect.t ........................... ok
t/15reconnect.t ......................... 
Failed 2/16 subtests 
t/16dbi-get_info.t ...................... ok
t/20createdrop.t ........................ ok
t/25lockunlock.t ........................ ok
t/29warnings.t .......................... ok
t/30insertfetch.t ....................... ok
t/31insertid.t .......................... ok
t/32insert_error.t ...................... ok
t/35limit.t ............................. ok
t/35prepare.t ........................... ok
t/40bindparam.t ......................... ok
t/40bindparam2.t ........................ ok
t/40bit.t ............................... ok
t/40blobs.t ............................. ok
t/40catalog.t ........................... ok
t/40keyinfo.t ........................... ok
t/40listfields.t ........................ ok
t/40nulls.t ............................. ok
t/40nulls_prepare.t ..................... ok
t/40numrows.t ........................... ok
t/40server_prepare.t .................... ok
t/40server_prepare_crash.t .............. ok
t/40server_prepare_error.t .............. ok
t/40types.t ............................. ok
t/41bindparam.t ......................... ok
t/41blobs_prepare.t ..................... ok
t/41int_min_max.t ....................... ok
t/42bindparam.t ......................... ok
t/43count_params.t ...................... ok
t/50chopblanks.t ........................ ok
t/50commit.t ............................ ok
t/51bind_type_guessing.t ................ ok
t/52comment.t ........................... ok
t/53comment.t ........................... ok
t/55utf8.t .............................. ok
t/55utf8mb4.t ........................... ok
t/56connattr.t .......................... skipped: performance schema not enabled
t/60leaks.t ............................. skipped: Skip $ENV{EXTENDED_TESTING} is not set
t/65segfault.t .......................... ok
t/65types.t ............................. ok
2018-10-02 12:08:22 63 [Warning] Aborted connection 63 to db: 'test' user: 'builduser' host: 'localhost' (Got an error reading communication packets)
t/70takeimp.t ........................... ok
t/71impdata.t ........................... ok
t/75supported_sql.t ..................... ok
t/76multi_statement.t ................... ok
t/80procs.t ............................. skipped: Your test user does not have ALTER_ROUTINE privileges.
t/81procs.t ............................. skipped: Your test user does not have ALTER_ROUTINE privileges.
t/85init_command.t ...................... ok
t/86_bug_36972.t ........................ ok
t/87async.t ............................. ok
t/88async-multi-stmts.t ................. ok
t/89async-method-check.t ................ ok
t/91errcheck.t .......................... ok
t/92ssl_backronym_vulnerability.t ....... ok
t/92ssl_optional.t ...................... ok
t/92ssl_riddle_vulnerability.t .......... ok
t/99_bug_server_prepare_blob_null.t ..... ok
t/manifest.t ............................ skipped: these tests are for release testing
t/pod.t ................................. skipped: Test::Pod 1.00 required for testing POD
t/rt110983-valid-mysqlfd.t .............. ok

#   Failed test at t/rt118977-zerofill.t line 22.
#          got: '1'
#     expected: '00001'
# Looks like you failed 1 test of 8.
t/rt118977-zerofill.t ................... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/8 subtests 
t/rt25389-bin-case.t .................... ok
t/rt50304-column_info_parentheses.t ..... ok
t/rt61849-bind-param-buffer-overflow.t .. ok
t/rt75353-innodb-lock-timeout.t ......... ok
t/rt83494-quotes-comments.t ............. ok
2018-10-02 12:08:46 94 [Warning] Aborted connection 94 to db: 'test' user: 'builduser' host: 'localhost' (Got timeout reading communication packets)
t/rt85919-fetch-lost-connection.t ....... ok
t/rt86153-reconnect-fail-memory.t ....... skipped: $ENV{EXTENDED_TESTING} is not set
t/rt88006-bit-prepare.t ................. ok
t/rt91715.t ............................. ok
t/version.t ............................. ok

Test Summary Report
-------------------
t/15reconnect.t                       (Wstat: 139 Tests: 14 Failed: 0)
  Non-zero wait status: 139
  Parse errors: Bad plan.  You planned 16 tests but ran 14.
t/rt118977-zerofill.t                 (Wstat: 256 Tests: 8 Failed: 1)
  Failed test:  8
  Non-zero exit status: 1
Files=73, Tests=2223, 31 wallclock secs ( 0.31 usr  0.06 sys +  4.25 cusr  0.45 csys =  5.07 CPU)
Result: FAIL
Failed 2/73 test programs. 1/2223 subtests failed.

Are these failures expected?

@pali
Copy link
Member

pali commented Oct 2, 2018

This is one of bugs which cannot be (easily) fixed for MariaDB in DBD::mysql.
It is already fixed in DBD::MariaDB: https://metacpan.org/pod/DBD::MariaDB

@loqs
Copy link
Author

loqs commented Oct 2, 2018

The issue with switching to DBD:MariaDB is that Arch Linux packages applications that hard code the user of DBD::mysql such as xtrabackup and perconna-toolkit [1]. Currently Arch is packaging MariaDB 10.1.36 but ideally it would package the latest stable release. Could DBD::MariaDB provide compatibility support for DBD::mysql?
[1] https://www.archlinux.org/packages/extra/x86_64/perl-dbd-mysql/

@pali
Copy link
Member

pali commented Oct 2, 2018

DBD::MariaDB is DBI driver, so applications which uses DBI API and do not depend on internals, driver specific or undocumented features should work. DBD::MariaDB fixed lot of DBD::mysql bugs (Unicode, SSL, security, MariaDB related), but some applications depend on those bugs -- so these parts are for obvious reason not backward compatible.

@gregoa
Copy link

gregoa commented Jan 3, 2019

We're seeing this in Debian as well: https://bugs.debian.org/917303
Any ideas for fixing this issues would be appreciated, otherwise either MariaDB or DBD::mysql will get into troubles in Debian …

@pali
Copy link
Member

pali commented Jan 4, 2019

Testing with MariaDB 10.3 was disabled:
c27bfd5

Maybe MariaDB 10.3 is not supported by DBD::mysql at all?

@dveeden dveeden added this to the 4.051 milestone Jan 4, 2019
@dveeden dveeden self-assigned this Jan 4, 2019
@dveeden
Copy link
Collaborator

dveeden commented Jan 4, 2019

I'll try to fix both this issue and see if we can work-around the issue that prevented testing from working.

@dveeden
Copy link
Collaborator

dveeden commented Jan 5, 2019

Update:

  • I've found a workaround to get testing working for MariaDB 10.3
  • t/57trackgtid.t didn't properly exclude MariaDB (GTID tracking is MySQL specific). Fixed.
  • t/rt118977-zerofill.t breaks because zerofil handling. This is due to this bug: https://jira.mariadb.org/browse/MDEV-18143
  • t/15reconnect.t had failures. Not diagnosed yet.

Commits are in https://github.com/dveeden/DBD-mysql/commits/issue_275

@dveeden
Copy link
Collaborator

dveeden commented Jan 6, 2019

  • I've added a workaround for t/rt118977-zerofill.t.
  • t/15reconnect.t hits a segfault in mariadb_reconnect(). This only seems to be the case when running against libmariadb.so from the server, not the latest MariaDB Connector/C. Looks like mysql_stmt_init() changes mysql->extension->conn_hdlr (from 0x0 to something). To be continued.

@dveeden
Copy link
Collaborator

dveeden commented Jan 6, 2019

Looks like the segfault happens when libmariadb was build against GnuTLS (either dynamic or static) and not if it was build against OpenSSL.

@gregoa
Copy link

gregoa commented Jan 6, 2019 via email

@loqs
Copy link
Author

loqs commented Jan 7, 2019

Just checked https://github.com/dveeden/DBD-mysql/commits/issue_275 all tests are now passing.
I echo gregoa's sentiments many thanks for your work in resolving this.
Perhaps I am not seeing a failure with t/15reconnect.t because the connection is using a Unix domain socket?

dveeden added a commit to dveeden/mariadb-connector-c that referenced this issue Jan 7, 2019
On reconnect mysql->extension gets uses while it isn't safe.
To ensure this doesn't happen let's set it to NULL.

From a valgrind run:
==21888== Invalid read of size 8
==21888==    at 0xC6941DF: mariadb_reconnect (mariadb_lib.c:1595)
==21888==    by 0xC69118C: mthd_my_send_cmd (mariadb_lib.c:365)
==21888==    by 0xC6A494B: mysql_stmt_prepare (mariadb_stmt.c:1616)
==21888==    by 0xC661432: XS_DBD__mysql__db_do (mysql.xs:334)
==21888==    by 0xBE40028: XS_DBI_dispatch (in /usr/lib64/perl5/vendor_perl/auto/DBI/DBI.so)
==21888==    by 0x496EB08: Perl_pp_entersub (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x4964CF4: Perl_runops_standard (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x48E193E: perl_run (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x109349: ??? (in /usr/bin/perl)
==21888==    by 0x4DC3412: (below main) (in /usr/lib64/libc-2.28.so)
==21888==  Address 0xc47e560 is 0 bytes inside a block of size 120 free'd
==21888==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==21888==    by 0xC69557A: mysql_close (mariadb_lib.c:1947)
==21888==    by 0xC657FDA: mysql_db_disconnect (dbdimp.c:2409)
==21888==    by 0xC66438A: XS_DBD__mysql__db_disconnect (mysql.xsi:342)
==21888==    by 0xBE40028: XS_DBI_dispatch (in /usr/lib64/perl5/vendor_perl/auto/DBI/DBI.so)
==21888==    by 0x496EB08: Perl_pp_entersub (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x4964CF4: Perl_runops_standard (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x48E193E: perl_run (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x109349: ??? (in /usr/bin/perl)
==21888==    by 0x4DC3412: (below main) (in /usr/lib64/libc-2.28.so)
==21888==  Block was alloc'd at
==21888==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==21888==    by 0xC692692: mysql_init (mariadb_lib.c:996)
==21888==    by 0xC655175: mysql_dr_connect (dbdimp.c:1688)
==21888==    by 0xC657B62: my_login (dbdimp.c:2235)
==21888==    by 0xC657C9F: mysql_db_login (dbdimp.c:2285)
==21888==    by 0xC664C0A: XS_DBD__mysql__db__login (mysql.xsi:126)
==21888==    by 0x496EB08: Perl_pp_entersub (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x4964CF4: Perl_runops_standard (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x48D95EC: Perl_call_sv (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0xBE41188: XS_DBI_dispatch (in /usr/lib64/perl5/vendor_perl/auto/DBI/DBI.so)
==21888==    by 0x496EB08: Perl_pp_entersub (in /usr/lib64/libperl.so.5.28.1)
==21888==    by 0x4964CF4: Perl_runops_standard (in /usr/lib64/libperl.so.5.28.1)
==21888==

Related:
- perl5-dbi/DBD-mysql#275
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917303

Thanks to @ericherman for helping with this.
@dveeden
Copy link
Collaborator

dveeden commented Jan 7, 2019

I think t/15reconnect.t fails because of a libmariadb bug.
This fixes that: mariadb-corporation/mariadb-connector-c#95

@dveeden
Copy link
Collaborator

dveeden commented Jan 7, 2019

Looks like t/15reconnect.t was already discussed in #247
That discussion and https://jira.mariadb.org/browse/CONC-289 suggests that forcing a reconnect/init is a better solution.

@dveeden
Copy link
Collaborator

dveeden commented Jan 8, 2019

A new fix: 667d63c

If this passes w/o issues on Travis and when there are no objections then I will merge this and release a new version.

@dveeden dveeden added the mariadb MariaDB specific issue label Jan 8, 2019
@dveeden dveeden modified the milestones: 4.051, 4.050 Jan 8, 2019
ottok added a commit to ottok/mariadb-10.3 that referenced this issue Apr 23, 2019
Previous versions of the mentioned failed to build when using the client
library derived from this mariadb-10.3 source package, but have started
working since. The purpose of this Breaks is to smoothen upgrades and
transitions in Debian unstable -> testing.

For pam-mysql see details in Debian#918367 and for libdbd-mysql-perl see
perl5-dbi/DBD-mysql#275 and Debian#917303.
@snowman
Copy link

snowman commented Mar 28, 2021

If you encounter this extract from above:

t/rt110983-valid-mysqlfd.t .............. ok

#   Failed test at t/rt118977-zerofill.t line 22.
#          got: '1'
#     expected: '00001'
# Looks like you failed 1 test of 8.

Try cpanm --notest DBD::mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mariadb MariaDB specific issue
Projects
None yet
Development

No branches or pull requests

5 participants