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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.2
    • 3.1.13
    • General
    • None
    • 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

        Issue Links

          Activity

            People

              Lawrin Lawrin Novitsky
              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.