[ODBC-123] Crashes reading MariaDB table with Libreoffice Created: 2017-11-24  Updated: 2018-01-28  Resolved: 2018-01-13

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 2.0.15, 3.0.2
Fix Version/s: 2.0.16, 3.0.3

Type: Bug Priority: Major
Reporter: Adam Majer Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 1
Labels: None

Attachments: File libmaodbc.trace     File libmyodbc5.trace    

 Description   

Libreoffice crashes with MariaDB/ODBC connector accessing any database. This does not happen with MySQL/ODBC connector.

For example, with the following ~/.odbc.ini

{{
[testing]
Description = Testing database
Driver = /usr/lib64/libmaodbc.so
Server = localhost
Username = adamm
Password = test
Database = test
Port = 3306
}}

And the database just being,
{{
select * from some_table;

a b
1 2
2 3

2 rows in set (0.00 sec)}}



 Comments   
Comment by Michael Vetter [ 2017-11-30 ]

Adding trace files.
libmaodbc.trace - mariadb-connector-odbc-3.0.2-2.2 (openSUSE Tumbleweed)
libmyodbc5.trace - MyODBC-unixODBC-5.1.8-19.10 (openSUSE Tumblweed)

Similar setup like above.
With MyODBC-unixODBC I use LL to open the database/table and change one value.
With mariadb-connector-odbc it crashes when it should open the database/table.

Using LibreOffice Base 5.4.2.2-2.1.

Comment by Lawrin Novitsky [ 2017-12-08 ]

What is UnixODBC version you use? May be important and give some hints
And I assume everything is 64bit nowadays

Comment by Michael Vetter [ 2017-12-08 ]

unixODBC 2.3.4-4.3 x86_64
Yes, 64 bit.

Comment by Lawrin Novitsky [ 2017-12-08 ]

Well, probably not that important. But wouldn't hurt to know on other hand

Comment by Lawrin Novitsky [ 2018-01-03 ]

The thing was that LibreOffice sets SQL_ATTR_USE_BOOKMARKS attribute, but does not actually use bookmarks. The connector was not ready for that, and would throw wrongly error, and then crash.
I must confess that I haven't yet tested on linux, and tested only on windows. But I don't think the problem is anyhow specific to a DM.
Commits(cherry-pick) have been pushed to both (main) branches - odbc-2.0 and odbc-3.0, b085030f766ece8847df03b71c3bf569236059a0 and a1e8995d0f8132663ed98a1b6333f2d53b3fe885 respectively.

Comment by Adam Majer [ 2018-01-11 ]

Thank you for the fix. Which version of LibreOffice are you testing this with? I'm just wondering since after patching the ODBC connector with the provided fix, I still see the crash in the same spot with Version: 5.3.5.2.

Comment by Lawrin Novitsky [ 2018-01-11 ]

My version is 5.4.3.2.
Re-opening issue, I will test your version.

Comment by Adam Majer [ 2018-01-11 ]

I've upgraded to our packages of 5.4.4.2 and it also crashes ... ODBC connector is 3.0.2 with the applied patch. It is possible that there is something wrong with our LibreOffice package.

I've tested both localhost connection to 64-bit instance of MariaDB and remote instance to a 32-bit instance of MariaDB. Both connections seem to function correctly with the isql client.

Comment by Lawrin Novitsky [ 2018-01-13 ]

Ok, there was another problem, that for strange reason did not show up on Windows. In request for SQL_CATALOG_LOCATIONinfo type(it's the last in the attacher trace file, and says it's succeeded) the connector incorrectly wrote to the buffer SQLUINTEGER, while it has to be SQLUSMALLINT. Apparently on Windows Base doesn't ask for that info type, or it would crash the connector there as well.

Commits are cfb8e530fdabcd17b84a4609a1423fb51ffcea5a(odbc-2.0) and 4f8bdb95fd67b4fcbb5a9039f33a816e2b694e4d(odbc-2.0)

Comment by Adam Majer [ 2018-01-15 ]

Thank you. Confirmed this is now fixed.

I can create more crashes but I will file new bugs for those later

Comment by Lawrin Novitsky [ 2018-01-15 ]

I could too , but mysql's behaved is same way. Maybe some bugs have to be filed against librebase. But all reports are welcome!

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