Regressions from the fix for bug #1375383 on 32-bit platforms

Bug #1379905 reported by Alexey Kopytov on 2014-10-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Medium
Sergei Glushchenko
2.2
Fix Released
Medium
Sergei Glushchenko

Bug Description

The fix for bug #1375383 introduced regressions on some 32-bit platforms:

1. Builds now fail on centos5-32 as follows:

19:33:02 [ 67%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/os/os0proc.cc.o
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc: In function 'ssize_t os_file_pread(os_file_t, void*, ulint, os_offset_t)':
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2439: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_enter_func(ib_mutex_t*, const char*, ulint)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2443: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_exit_func(ib_mutex_t*)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2453: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_enter_func(ib_mutex_t*, const char*, ulint)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2457: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_exit_func(ib_mutex_t*)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc: In function 'ssize_t os_file_pwrite(os_file_t, const void*, ulint, os_offset_t)':
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2495: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_enter_func(ib_mutex_t*, const char*, ulint)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2499: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_exit_func(ib_mutex_t*)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2510: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_enter_func(ib_mutex_t*, const char*, ulint)'
19:33:02 /home/jenkins/workspace/percona-xtrabackup-2.2/BUILD_TYPE/release/Host/centos5-32/xtrabackuptarget/innodb51/storage/innobase/os/os0file.cc:2514: error: cannot convert 'os_mutex_t**' to 'ib_mutex_t*' for argument '1' to 'void mutex_exit_func(ib_mutex_t*)'
19:33:02 make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/os/os0file.cc.o] Error 1

http://jenkins.percona.com/view/PXB%202.2/job/percona-xtrabackup-2.2/103/BUILD_TYPE=release,Host=centos5-32,xtrabackuptarget=innodb51/console

2. Debug binaries now fail on Lucid 32 bit as follows:

2014-10-09 15:27:32 b73e5b30 InnoDB: Assertion failure in thread 3074317104 in file sync0sync.cc line 422
InnoDB: Failing assertion: mutex->magic_n == MUTEX_MAGIC_N
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
19:27:32 UTC - xtrabackup got signal 6 ;
This could be because you hit a bug or data is corrupted.
This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Thread pointer: 0x9916028
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 904e980 thread_stack 0x10000
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(my_print_stacktrace+0x32) [0x87bc36b]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(handle_fatal_signal+0x28e) [0x869f216]
[0xb7763500]
/lib/libc.so.6(abort+0x182) [0xb7414832]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(mutex_validate(ib_mutex_t const*)+0x7f) [0x83cc734]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(mutex_own(ib_mutex_t const*)+0x1d) [0x83cc75c]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup() [0x83f86c6]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(os_file_read_func(int, void*, unsigned long long, unsigned long)+0x60) [0x83f8ca8]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(os_aio_func(unsigned long, unsigned long, char const*, int, void*, unsigned long long, unsigned long, fil_node_t*, void*)+0x1de) [0x83fb277]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(fil_io(unsigned long, bool, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, void*, void*)+0x952) [0x82e2eb5]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(log_group_read_checkpoint_info(log_group_t*, unsigned long)+0x182) [0x833c701]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(recv_find_max_checkpoint(log_group_t**, unsigned long*)+0x87) [0x83db0ee]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup() [0x8217872]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup(main+0x8c1) [0x821e908]
/lib/libc.so.6(__libc_start_main+0xe6) [0xb73fdbf6]
/mnt/workspace/percona-xtrabackup-2.2/BUILD_TYPE/debug/Host/ubuntu-lucid-32bit/xtrabackuptarget/innodb51/storage/innobase/xtrabackup/test/../src/xtrabackup() [0x820d361]

http://jenkins.percona.com/view/PXB%202.2/job/percona-xtrabackup-2.2/103/BUILD_TYPE=debug,Host=ubuntu-lucid-32bit,xtrabackuptarget=innodb51/testReport/junit/%28root%29/t_bug1022562/sh/

Related branches

Alexey Kopytov (akopytov) wrote :

It looks like the fix is incomplete, problem #2 from the original report is still there.

Code

# if defined(HAVE_ATOMIC_BUILTINS)
 (void) os_atomic_increment_ulint(&os_n_pending_reads, 1);
 (void) os_atomic_increment_ulint(&os_file_n_pending_preads, 1);
 MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_READS);
# else
 os_mutex_enter(os_file_count_mutex);
 os_file_n_pending_preads++;
 os_n_pending_reads++;
 MONITOR_INC(MONITOR_OS_PENDING_READS);
 os_mutex_exit(os_file_count_mutex);
# endif /* HAVE_ATOMIC_BUILTINS */

is not correct for 5.6. Should be

 os_mutex_enter(os_file_count_mutex);
 os_file_n_pending_preads++;
 os_n_pending_reads++;
 MONITOR_INC(MONITOR_OS_PENDING_READS);
 os_mutex_exit(os_file_count_mutex);

disregarding HAVE_ATOMIC_BUILTINS

It is totally counter-intuitive

There are HAVE_ATOMIC_BUILTINS and HAVE_ATOMIC_BUILTINS_64 macros'.

MONITOR_ATOMIC_INC is defined as MONITOR_MUTEX_INC for case when HAVE_ATOMIC_BUILTINS_64 is not defined.

Other places do check like:

# if defined(HAVE_ATOMIC_BUILTINS) && UNIV_WORD_SIZE == 8

In Lucid 32-bit HAVE_ATOMIC_BUILTINS is defined, HAVE_ATOMIC_BUILTINS_64 is not defined and MONITOR_ATOMIC_INC is in fact trying to use mutex because it is shortcut for MONITOR_MUTEX_INC in this case.

Fix is to check HAVE_ATOMIC_BUILTINS_64 or HAVE_ATOMIC_BUILTINS and UNIV_WORD_SIZE.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-709

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers