[MDEV-26792] MariaBackup prepare crashes with invalid pointer with compression providers and extra options Created: 2021-10-08  Updated: 2021-10-08  Resolved: 2021-10-08

Status: Closed
Project: MariaDB Server
Component/s: mariabackup
Affects Version/s: N/A
Fix Version/s: 10.7.1

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-12933 sort out the compression library chaos Closed

 Description   

If MariaBackup prepare is run with some compression providers enabled and there are some extra options for the run, it fails with

preview-10.7-MDEV-12933-provider-plugins 8a800a12

free(): invalid pointer
211008 21:33:40 [ERROR] mysqld got signal 6 ;
 
 
#3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#4  0x00007f170cb7a859 in __GI_abort () at abort.c:79
#5  0x00007f170cbe53ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f170cd0f285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007f170cbed47c in malloc_printerr (str=str@entry=0x7f170cd0d4ae "free(): invalid pointer") at malloc.c:5347
#7  0x00007f170cbeecac in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:4173
#8  0x000055a7dff5cce5 in msg1(uint, const char *, const char *, typedef __va_list_tag __va_list_tag *) (thread_num=0, prefix=0x55a7e0e55e71 "", fmt=0x55a7e0e5c458 "This target seems to be not prepared yet.", args=0x7ffda92170e8) at /data/src/preview-10.7-MDEV-12933-provider-plugins-deb/extra/mariabackup/common.h:102
#9  0x000055a7dff5ce61 in msg (fmt=0x55a7e0e5c458 "This target seems to be not prepared yet.") at /data/src/preview-10.7-MDEV-12933-provider-plugins-deb/extra/mariabackup/common.h:122
#10 0x000055a7dff6c5ed in xtrabackup_prepare_func (argv=0x55a7e40fb508) at /data/src/preview-10.7-MDEV-12933-provider-plugins-deb/extra/mariabackup/xtrabackup.cc:5803
#11 0x000055a7dff6f2f8 in main_low (argv=0x55a7e40fb508) at /data/src/preview-10.7-MDEV-12933-provider-plugins-deb/extra/mariabackup/xtrabackup.cc:6793
#12 0x000055a7dff6eb29 in main (argc=4, argv=0x7ffda9217bf8) at /data/src/preview-10.7-MDEV-12933-provider-plugins-deb/extra/mariabackup/xtrabackup.cc:6591

It doesn't appear to happen with the encryption plugin.

In the test case below the extra option is use-memory, but the exact option seems unimportant.

--source include/have_innodb.inc
 
install soname 'provider_lzma';
 
set global innodb_compression_algorithm = lzma;
create table t1 (a int, b text) engine = innodb page_compressed=yes;
insert t1 (a, b) values (0, repeat("abc", 100));
 
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
--disable_abort_on_error
exec $XTRABACKUP --prepare --target-dir=$targetdir --use-memory=128M > $MYSQLTEST_VARDIR/tmp/prepare.log 2>&1;
cat_file $MYSQLTEST_VARDIR/tmp/prepare.log;



 Comments   
Comment by Sergei Golubchik [ 2021-10-08 ]

already fixed by the fix for the kvm-asan failure

Generated at Thu Feb 08 09:47:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.