Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-478

nullptr exception after db server service restart

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.1.22
    • 3.3.0
    • None
    • None
    • Win x86, ODBC, ADO, MariaDB ODBC Connector 3.1.22 x86, MariaDB 10.11.6 x64

    Description

      to reproduce null pointer exception:
      1) open connection
      2) restart database server service
      3) my ADO execute command with earlier opened connection as follows (but maybe happens on other ODBC or libmariadb context also). See below.
      4) nullptr exception is SEH exception and is not catched as com_error. Therefore fatal in my case.

      try
      {
      	_CommandPtr     pCmdChange = NULL;
          pCmdChange.CreateInstance(__uuidof(Command));        // Create command object.
      	pCmdChange->ActiveConnection = GetConnection();
          pCmdChange->CommandText = command;
          pCmdChange->Execute(NULL, NULL, adCmdText | adExecuteNoRecords);
      }
      catch (_com_error &e)
      {
      	Log(e.Error(), e.Description());
      	return FALSE;
      }
      

      on libmariadb -> mariadb_stmt.c
      see function:

      int mthd_stmt_read_execute_response(MYSQL_STMT *stmt)
      

      This assert hits as stmt->fields being null:

      assert(stmt->fields);
      

      ,but there's no other error handling on this, which causes it crash on nullptr exception on fields duplicating after this.

      As workaround:
      replaced assert row with

       if(!stmt->fields)
          return (1);
      

      Attachments

        Issue Links

          Activity

            People

              Lawrin Lawrin Novitsky
              Seppänen Mikko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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