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

'unicode' test segmentation fault on s390x due to pointer casting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.1.13
    • Component/s: General
    • Labels:
      None
    • Environment:
      Arch: s390x (big endian)
      OS: SLES 12 SP3

      Description

      Test 'unicode' is failing with segmentaion fault on s390x.

      At ma_error.c:289 casting of (MARIADB_CHARSET_INFO **) into (Client_Charset *) is done which causes garbage values on s390x but not on x86.

      Creating a new Client_Charset object and passing its address to MADB_SetString is fixing the segmentation fault at this point,

        if (SQLState){
              Client_Charset utf8_={CP_UTF8,mariadb_get_charset_by_name("utf8")};
          MADB_SetString(isWChar ?  &utf8_ : 0, (void *)SQLState, SQL_SQLSTATE_SIZE + 1,
                         SqlStateVersion, SQL_SQLSTATE_SIZE, &InternalError);
      }
      

      but after execution goes ahead segmentation fault occurs at ma_error.c:289

      if (MessageText)
           Length=  (SQLSMALLINT)MADB_SetString(isWChar ?  &utf8 : 0, (void*)MessageText, BufferLength,
                         Err->SqlErrorMsg, strlen(Err->SqlErrorMsg), &InternalError);
      

      Could you please suggest a fix?

      Attached gdb logs for s390x and x86.

        Attachments

        1. odbc_s390x_unicode_gdb.txt
          2 kB
          Faiz Akhtar
        2. odbc_x86_unicode_gdb.txt
          2 kB
          Faiz Akhtar

          Issue Links

            Activity

              People

              Assignee:
              Lawrin Lawrin Novitsky
              Reporter:
              Faiz Faiz Akhtar
              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.