Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34859

Failed to initialise non-blocking API

Details

    Description

      Running the tests on amd64 and arm64 we are only seeing this on arm64.

      Happens with both 10.9 and 11.4.

      worker[1]  - saving '/home/brad/ports/pobj/mariadb-10.9.8/build-aarch64/mysql-test/var/mysqld.1'
      worker[1] main.connect                             worker[1] [ fail ]
              Test ended at 2024-09-03 03:14:47
      worker[1] 
      CURRENT_TEST: main.connect
      safe_process[98524]: parent_pid: 51941
      safe_process[98524]: Started child 12834, terminated: 0
      mysqltest: At line 19: Failed to initialise non-blocking API
       
      The result from queries just before the failure was:
      SET global secure_auth=0;
      safe_process[98524]: Got signal 20, child_pid: 12834
      safe_process[98524]: Killing child: 12834
      safe_process[98524]: Child exit: 1
       
      main.connect                             [ fail ]
              Test ended at 2024-09-03 03:14:47
       
      CURRENT_TEST: main.connect
      safe_process[98524]: parent_pid: 51941
      safe_process[98524]: Started child 12834, terminated: 0
      mysqltest: At line 19: Failed to initialise non-blocking API
      

      Attachments

        1. async_api_boost_context_v2.patch
          10 kB
          Kristian Nielsen
        2. async_api_boost_context.patch
          8 kB
          Kristian Nielsen
        3. mdev34859_aarch64_nonblock_library.diff
          12 kB
          Kristian Nielsen

        Activity

          Looks good Brad, thanks!

          Georg Richter has merged my patches to connector-c, so they will be part of the next release, both the Aarch64 native one and the generic boost::context fallback.

          Thanks for the help with testing, much appreciated.

          - Kristian.

          knielsen Kristian Nielsen added a comment - Looks good Brad, thanks! Georg Richter has merged my patches to connector-c, so they will be part of the next release, both the Aarch64 native one and the generic boost::context fallback. Thanks for the help with testing, much appreciated. - Kristian.

          Unfortunately, now it fails in buildbot in the server 10.6 branch on many (may be all?) aarch64 builders. Like

          main.non_blocking_api                    w3 [ fail ]
                  Test ended at 2024-10-17 21:44:45
           
          CURRENT_TEST: main.non_blocking_api
          mysqltest got signal 11
          read_command_buf (0xaaab00952210): CREATE TABLE t1 (a INT PABLE t1 EY)
           
          conn->name (0xaaab00969dd8): con_nonblock
           
          Attempting backtrace...
          stack_bottom = 0x0 thread_stack 0x3c000
          /usr/bin/mariadb-test(my_print_stacktrace+0x30)[0xaaaac42bd1b8]
          /usr/bin/mariadb-test(+0x63920)[0xaaaac4274920]
          addr2line: 'linux-vdso.so.1': No such file
          linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffffa8f9f5b0]
          multiarch/memcpy_advsimd.S:101(__memcpy_simd)[0xffffa88cb068]
          /usr/bin/mariadb-test(+0x97d70)[0xaaaac42a8d70]
          /usr/bin/mariadb-test(ma_net_write_command+0x208)[0xaaaac42a91c0]
          /usr/bin/mariadb-test(mthd_my_send_cmd+0x118)[0xaaaac428ea10]
          /usr/bin/mariadb-test(_Z21wrap_mysql_send_queryP8st_mysqlPKcm+0x18)[0xaaaac4274bf0]
          /usr/bin/mariadb-test(_Z16run_query_normalP13st_connectionP10st_commandiPKcmP17st_dynamic_stringS6_+0x32c)[0xaaaac42852f4]
          /usr/bin/mariadb-test(_Z9run_queryP13st_connectionP10st_commandi+0x1e0)[0xaaaac4285538]
          /usr/bin/mariadb-test(main+0xc5c)[0xaaaac4273664]
          csu/libc-start.c:342(__libc_start_main)[0xffffa8866e10]
          /usr/bin/mariadb-test(+0x63620)[0xaaaac4274620]
          Writing a core file...
           
           - saving '/dev/shm/var/3/log/main.non_blocking_api/' to '/dev/shm/var/log/main.non_blocking_api/'

          See https://buildbot.mariadb.net/buildbot/grid?category=main&branch=10.6

          serg Sergei Golubchik added a comment - Unfortunately, now it fails in buildbot in the server 10.6 branch on many (may be all?) aarch64 builders. Like main.non_blocking_api w3 [ fail ] Test ended at 2024-10-17 21:44:45   CURRENT_TEST: main.non_blocking_api mysqltest got signal 11 read_command_buf (0xaaab00952210): CREATE TABLE t1 (a INT PABLE t1 EY)   conn->name (0xaaab00969dd8): con_nonblock   Attempting backtrace... stack_bottom = 0x0 thread_stack 0x3c000 /usr/bin/mariadb-test(my_print_stacktrace+0x30)[0xaaaac42bd1b8] /usr/bin/mariadb-test(+0x63920)[0xaaaac4274920] addr2line: 'linux-vdso.so.1': No such file linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffffa8f9f5b0] multiarch/memcpy_advsimd.S:101(__memcpy_simd)[0xffffa88cb068] /usr/bin/mariadb-test(+0x97d70)[0xaaaac42a8d70] /usr/bin/mariadb-test(ma_net_write_command+0x208)[0xaaaac42a91c0] /usr/bin/mariadb-test(mthd_my_send_cmd+0x118)[0xaaaac428ea10] /usr/bin/mariadb-test(_Z21wrap_mysql_send_queryP8st_mysqlPKcm+0x18)[0xaaaac4274bf0] /usr/bin/mariadb-test(_Z16run_query_normalP13st_connectionP10st_commandiPKcmP17st_dynamic_stringS6_+0x32c)[0xaaaac42852f4] /usr/bin/mariadb-test(_Z9run_queryP13st_connectionP10st_commandi+0x1e0)[0xaaaac4285538] /usr/bin/mariadb-test(main+0xc5c)[0xaaaac4273664] csu/libc-start.c:342(__libc_start_main)[0xffffa8866e10] /usr/bin/mariadb-test(+0x63620)[0xaaaac4274620] Writing a core file...   - saving '/dev/shm/var/3/log/main.non_blocking_api/' to '/dev/shm/var/log/main.non_blocking_api/' See https://buildbot.mariadb.net/buildbot/grid?category=main&branch=10.6

          serg The fix for the failure is here: https://github.com/knielsen/mariadb-connector-c/commit/fe1517d15fc804e22a0321ecaf603746e2216c0f

          brad0 You will need to update your aarch64 diff in your -current MariaDB port with this patch, sorry for the trouble. There is a typo in the code that will restore registers incorrectly and lead to crashes in some cases depending on what code the compiler generates; we must have been unlucky to never trigger that in our testing.

          knielsen Kristian Nielsen added a comment - serg The fix for the failure is here: https://github.com/knielsen/mariadb-connector-c/commit/fe1517d15fc804e22a0321ecaf603746e2216c0f brad0 You will need to update your aarch64 diff in your -current MariaDB port with this patch, sorry for the trouble. There is a typo in the code that will restore registers incorrectly and lead to crashes in some cases depending on what code the compiler generates; we must have been unlucky to never trigger that in our testing.

          I wrote an update for the documentation (https://github.com/mariadb-corporation/mariadb-connector-c/wiki/configuration_options) for the new build option. But I am not sure how to get that included?

          diff --git a/configuration_options.md b/configuration_options.md
          index 6e8da57..726b4f8 100644
          --- a/configuration_options.md
          +++ b/configuration_options.md
          @@ -27,6 +27,11 @@ If you want to use a different generator, e.g. for nmake on Windows, you need to
           |WITH_OPENSSL|ON| Possible values are ON or OFF. Not supported anymore since Connector/C 3.0|
           |WITH_SSL|SCHANNEL (windows), otherwise OPENSSL|Specifies type of TLS/SSL library. E.g. GNUTLS, OPENSSL or SCHANNEL (Windows only). OFF disables TLS/SSL functionality|
           
          +### Non-blocking client library options
          +| Option | Default | Description |
          +|-|-|-
          +|WITH_BOOST_CONTEXT|OFF| Use `boost::context` instead of `ucontext` for the non-blocking client API. Can be used to build the non-blocking API on platforms that do not have `ucontext`. Note that on x86_64 (aka amd64), i386, and aarch64 (aka arm64), a native implementation is always used over `ucontext` or `boost::context`. (Added in 3.3.12)|
          +
           ### Client plugins
           Client plugins can be configured as dynamic plugins (DYNAMIC) or built-in plugins (STATIC) by specifying the plugin name followed by suffix `_PLUGIN_TYPE` as key, and `DYNAMIC` or `STATIC` as value.
           
          

          knielsen Kristian Nielsen added a comment - I wrote an update for the documentation ( https://github.com/mariadb-corporation/mariadb-connector-c/wiki/configuration_options ) for the new build option. But I am not sure how to get that included? diff --git a/configuration_options.md b/configuration_options.md index 6e8da57..726b4f8 100644 --- a/configuration_options.md +++ b/configuration_options.md @@ -27,6 +27,11 @@ If you want to use a different generator, e.g. for nmake on Windows, you need to |WITH_OPENSSL|ON| Possible values are ON or OFF. Not supported anymore since Connector/C 3.0| |WITH_SSL|SCHANNEL (windows), otherwise OPENSSL|Specifies type of TLS/SSL library. E.g. GNUTLS, OPENSSL or SCHANNEL (Windows only). OFF disables TLS/SSL functionality| +### Non-blocking client library options +| Option | Default | Description | +|-|-|- +|WITH_BOOST_CONTEXT|OFF| Use `boost::context` instead of `ucontext` for the non-blocking client API. Can be used to build the non-blocking API on platforms that do not have `ucontext`. Note that on x86_64 (aka amd64), i386, and aarch64 (aka arm64), a native implementation is always used over `ucontext` or `boost::context`. (Added in 3.3.12)| + ### Client plugins Client plugins can be configured as dynamic plugins (DYNAMIC) or built-in plugins (STATIC) by specifying the plugin name followed by suffix `_PLUGIN_TYPE` as key, and `DYNAMIC` or `STATIC` as value.
          brad0 Brad Smith added a comment - - edited

          Thanks. I'll push the bug fix.

          brad0 Brad Smith added a comment - - edited Thanks. I'll push the bug fix.

          People

            knielsen Kristian Nielsen
            brad0 Brad Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.