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

mysql_real_connect_start segfaults on arm

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.21, 10.1.8
    • 5.5.48, 10.0.24, 10.1.12
    • Scripts & Clients
    • None
    • Raspbian wheezy, gcc/g++ version 4.8.2 (Raspbian 4.8.2-21~rpi3rpi1), Raspberry Pi 2 (armhf)

    Description

      I wasn't quite sure where to post this since this is about the client API, but I am using the mariadb server code base directly and not the separate Connector/C library (yet).

      Anyway, I maintain an async mariadb client binding for node.js (mariasql) and for me it works fine on x86/x86-64 (I specifically used Ubuntu). However someone recently brought to my attention that they are getting a segfault on an RPi2 within mysql_real_connect_start. I verified this on an RPi2 of my own and am not able to track down the exact problem (mostly because of the coroutines not playing nicely with gdb?). I used the exact same code and connection settings between my main desktop and the RPi2 and no network traffic appears on the RPi2, so the problem must be occurring early on.

      There is only one frame in the backtrace that is inside the mariadb client library (and that is the one that shows mysql_real_connect_start), all of the other frames are within my binding and/or node.js itself. I could not get gdb to show the function arguments for some reason, but the individual that alerted me to this particular issue was able to get all of that extra information. Here is the frame they got from the backtrace (mariadb 10.0.21):

      #0 0x747a182c in mysql_real_connect_start (ret=0xbd6d20, mysql=0xbd6958, host=0xbc0790 "10.0.0.71", user=0xbb7f30 "root", passwd=0xbb82e8 "root", db=0x0, port=3306, unix_socket=0x0, client_flags=2147614720) at ../deps/libmariadbclient/sql-common/mysql_async.c:447

      If there is anything we can do to help narrow down the problem, let me know.

      Attachments

        Activity

          georg Georg Richter added a comment -

          Hi,

          it looks like you don't check return code of mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0)

          Currently context switch for ARM architecture doesn't work. I added a patch to this bug report which enables context switching on ARM (will be pushed after review).

          georg Georg Richter added a comment - Hi, it looks like you don't check return code of mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0) Currently context switch for ARM architecture doesn't work. I added a patch to this bug report which enables context switching on ARM (will be pushed after review).
          mscdex Brian White added a comment -

          Ah, thanks for pointer about mysql_options(). I tested the patch on my RPi2 and it does indeed seem to fix things.

          Thanks for the quick response and fix!

          mscdex Brian White added a comment - Ah, thanks for pointer about mysql_options() . I tested the patch on my RPi2 and it does indeed seem to fix things. Thanks for the quick response and fix!

          Pushed to 5.5, 10.0, and 10.1, thanks, Georg, for the patch!

          knielsen Kristian Nielsen added a comment - Pushed to 5.5, 10.0, and 10.1, thanks, Georg, for the patch!

          People

            georg Georg Richter
            mscdex Brian White
            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.