[MDEV-22862] compilation failure on centos74-aarch64 Created: 2020-06-10  Updated: 2020-06-13  Resolved: 2020-06-13

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.5
Fix Version/s: 10.5.4

Type: Bug Priority: Blocker
Reporter: Sergei Golubchik Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-22877 Avoid unnecessary buf_pool.page_hash ... Closed
Relates
relates to MDEV-15053 Reduce buf_pool_t::mutex contention Closed

 Description   

/home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.5.4/storage/innobase/include/buf0buf.h: In member function ‘rw_lock_t* buf_pool_t::page_hash_lock(ulint) [with bool exclusive = true; ulint = long unsigned int]’:
/home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.5.4/storage/innobase/include/buf0buf.h:1708:3:error: could not split insn
   }
   ^
(insn 148 867 534 (parallel [
            (set (mem/v:SI (reg/v/f:DI 19 x19 [orig:73 latch ] [73]) [-1  S4 A32])
                (unspec_volatile:SI [
                        (plus:SI (mem/v:SI (reg/v/f:DI 19 x19 [orig:73 latch ] [73]) [-1  S4 A32])
                            (const_int 536870912 [0x20000000]))
                        (const_int 4 [0x4])
                    ] UNSPECV_ATOMIC_OP))
            (clobber (reg:CC 66 cc))
            (clobber (reg:SI 1 x1))
            (clobber (reg:SI 0 x0))
        ]) /usr/include/c++/4.8.2/bits/atomic_base.h:614 1802 {atomic_addsi}
     (expr_list:REG_UNUSED (reg:CC 66 cc)
        (expr_list:REG_UNUSED (reg:SI 1 x1)
            (expr_list:REG_UNUSED (reg:SI 0 x0)
                (nil)))))



 Comments   
Comment by Marko Mäkelä [ 2020-06-11 ]

I think that we should primarily address this by trying to update the compiler, like we recently did on POWER.

If that is really impossible, we could add some preprocessor magic to lower the optimization level or to simplify some code.

The build failure is most likely related to the increased the use of inline functions that access std::atomic data, in MDEV-15053.

Comment by Daniel Bartholomew [ 2020-06-11 ]

marko and serg Which gcc version should I go with? We don't want to introduce new incompatibilities, but this might be a chance to have at least one builder with a much more modern toolchain.

For reference, on the centos74-aarch64-build VM we currently have: gcc 4.8.5-16, binutils 2.27-11, and cmake 3.14.0

Comment by Daniel Bartholomew [ 2020-06-11 ]

Tried a test build with cmake . -DBUILD_CONFIG=mysql_release -DCMAKE_COMMAND_DEP=cmake -DRPM=centos74 -O2, but that didn't work.

Same error as in the description.

I'll try some builds editing out a workaround to see if that helps, and I'll also try with a newer gcc.

Comment by Daniel Bartholomew [ 2020-06-11 ]

When using gcc 4.9.4, the main part of the build completes, but the cpack packaging step fails with the following:

*** ERROR: No build ID note found in /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/build/_CPack_Packages/Linux/RPM/mariadb-10.5.4-linux-aarch64/backup/usr/bin/mariadb-backup
error: Bad exit status from /var/tmp/rpm-tmp.e9nNab (%install)
    Bad exit status from /var/tmp/rpm-tmp.e9nNab (%install)
 ***
CPackRPM:Debug:    - /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/build/_CPack_Packages/Linux/RPM/rpmbuildMariaDB-backup.out
CPackRPM:Debug: *** Building target platforms: aarch64
Building for target aarch64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.XJe7pa
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.e9nNab
extracting debug info from /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/build/_CPack_Packages/Linux/RPM/mariadb-10.5.4-linux-aarch64/backup/usr/bin/mariadb-backup
 
 
RPM build errors:
 ***
CMake Error at /usr/local/share/cmake-3.14/Modules/Internal/CPack/CPackRPM.cmake:1799 (message):
  RPM package was not generated!
  /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/build/_CPack_Packages/Linux/RPM
Call Stack (most recent call first):
  /usr/local/share/cmake-3.14/Modules/Internal/CPack/CPackRPM.cmake:1870 (cpack_rpm_generate_package)
  /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/build/cmake/Internal/CPack/CPackRPM.cmake:54 (include)

Comment by Daniel Bartholomew [ 2020-06-12 ]

Looks like the errors are fixed in the latest pushes into 10.5: https://buildbot.askmonty.org/buildbot/builders/kvm-rpm-centos74-aarch64/builds/8265

Comment by Daniel Bartholomew [ 2020-06-12 ]

I'm guessing this commit from marko is what fixed it.

Comment by Marko Mäkelä [ 2020-06-13 ]

Yes, it seems that MDEV-15053 caused this build failure by making more code inline and by expanding the use of std:atomic. Apparently, that resulted in some expanded functions being too large for the old compiler to handle on the ARMv8 target.

MDEV-22877 probably fixed this by replacing the inline function buf_page_hash_get_locked() and by eliminating some redundant invocations of buf_pool_t::page_hash_lock<false>(). Those calls were never needed when the caller is already holding buf_pool.mutex.

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