Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-518

mthd_my_real_connect() crashes on connection error

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.1.9
    • 3.2.0, 3.1.12
    • None
    • Microsoft Windows Server 2019 Standard

    Description

      Unhandled exception thrown: read access violation.

      The crash happens here:
      https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

      error:
        /* Free alloced memory */
        end_server(mysql);
        /* only free the allocated memory, user needs to call mysql_close */
        mysql_close_memory(mysql);
        if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
            !mysql->options.extension->async_context)    <--- mysql->options.extension was nullptr
          mysql_close_options(mysql);
        return(0);
      

      Call stack:

      libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703] 
      libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330] 
      

      Attachments

        Activity

          skvoboo Anton Serbulov created issue -
          skvoboo Anton Serbulov made changes -
          Field Original Value New Value
          Description Unhandled exception thrown: read access violation.
          mysql->options.extension was nullptr

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {noformat}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {noformat}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          Unhandled exception thrown: read access violation.

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {noformat}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {noformat}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          skvoboo Anton Serbulov made changes -
          Summary mthd_my_real_connect crashes on connection error mthd_my_real_connect() crashes on connection error
          skvoboo Anton Serbulov made changes -
          Description Unhandled exception thrown: read access violation.

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {noformat}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {noformat}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          Unhandled exception thrown: read access violation.

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {noformat}
          {code:c}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {code}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          skvoboo Anton Serbulov made changes -
          Description Unhandled exception thrown: read access violation.

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {noformat}
          {code:c}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {code}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          Unhandled exception thrown: read access violation.

          The crash happens here:
          https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

          {code:c}
          error:
            /* Free alloced memory */
            end_server(mysql);
            /* only free the allocated memory, user needs to call mysql_close */
            mysql_close_memory(mysql);
            if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
                !mysql->options.extension->async_context) <--- mysql->options.extension was nullptr
              mysql_close_options(mysql);
            return(0);
          {code}

          Call stack:
          {noformat}
          libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703]
          libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330]
          {noformat}
          georg Georg Richter made changes -
          Fix Version/s 3.1.12 [ 25200 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Fix Version/s 3.2.0 [ 25122 ]
          julien.fritsch Julien Fritsch made changes -
          Workflow MariaDB connectors [ 116201 ] MariaDB v4 [ 161234 ]

          People

            georg Georg Richter
            skvoboo Anton Serbulov
            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.