[ODBC-130] 'unicode' test segmentation fault on s390x due to pointer casting Created: 2018-01-18  Updated: 2021-06-10  Resolved: 2021-06-10

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.2
Fix Version/s: 3.1.13

Type: Bug Priority: Major
Reporter: Faiz Akhtar Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Arch: s390x (big endian)
OS: SLES 12 SP3


Attachments: Text File odbc_s390x_unicode_gdb.txt     Text File odbc_x86_unicode_gdb.txt    
Issue Links:
PartOf
is part of ODBC-128 Maria ODBC test failures on s390x arc... Closed

 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.



 Comments   
Comment by Lawrin Novitsky [ 2021-06-07 ]

And same request regarding this ticket, please

Comment by Nayana [ 2021-06-09 ]

Yes. This ticket can be closed as we do not see this failure now.

Comment by Lawrin Novitsky [ 2021-06-10 ]

This has been fixed by merged 3rd party PR

Generated at Thu Feb 08 03:26:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.