[CONC-60] segfault when executing 'SELECT * FROM table' through connector/c++ on a specific table Created: 2013-10-19 Updated: 2013-11-20 Resolved: 2013-11-20 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Lionel Elie Mamane | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Reproduced on Microsoft Windows and Debian GNU/Linux amd64. Reproduced with bzr revision 40 and bzr revision 101 (current tip of trunk) of libmariadb. |
||
| Attachments: |
|
| Description |
|
Original LibreOffice bug report: https://bugs.freedesktop.org/70496 When LibreOffice executes 'SELECT * FROM agendas' (via MySQL Connector/C++ 1.1.2) through a prepared statement (with no parameters), it leads to a segfault in libmariadb. When MySQL Connector/C++ is linked against libmysqlclient18 5.5.31+dfsg-0+wheezy1, the segfault does not happen. The full original reproduction database can be downloaded from zip file in directory mysqldumps from Backtrace & other gdb information: #0 net_field_length (packet=0x7fff57edd758) , }, , , , , , |
| Comments |
| Comment by Georg Richter [ 2013-10-20 ] |
|
Which version of client library do you use? Can't repeat issue with latest rev. 102 |
| Comment by Lionel Elie Mamane [ 2013-10-20 ] |
|
Reproduced with bzr revision 40 and bzr revision 101 of libmariadb. |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
Here is my exact reproduction script. Usually LibreOffice builds mariadb-native-client through its own build system, but to exclude problems coming from that, I built mariadb-native-client through its own build system. |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
LibreOffice test file |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
patch applied to mariadb-native-client so that it builds in a way that it can be statically linked into a dynamic library. |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
patch applied to LibreOffice sources to link against externally build mariadb-native-client Needs commit 02a11749da521e8e2099b464c0fcbebce9e95e22 fdo#70496 revert to using libmysqlclient Change-Id: I5b98b5e7840e4f1c6005aee0c1f43ef814ecf77b or later. |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
Don't know if it is relevant, but LibreOffice executes these two queries on the same table: |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
I tried single-stepping (in gdb) through execution of mysql_stmt_store_result and mthd_stmt_read_all_rows, but in the end it always finishes with error "Lost connection to MySQL server during query"... My single-stepping makes it too slow :-| |
| Comment by Lionel Elie Mamane [ 2013-10-21 ] |
|
Anyway, here is what happens before the mysql_stmt_store_result |
| Comment by Georg Richter [ 2013-10-27 ] |
|
Can you please retest with latest revision (104). I did some rework on prepared statements (max_length for double was not set correctly). |
| Comment by Lionel Elie Mamane [ 2013-10-28 ] |
|
Reproduced with revision 105, with much the same backtrace: #0 net_field_length (packet=packet@entry=0x7ffff78e3818) |
| Comment by Georg Richter [ 2013-10-28 ] |
|
Hi, unfortunately I wasn't able to build LibreOffice. Would it be possible to get access to your machine or to install it on one of our test machines? Thanks for your help! |
| Comment by Georg Richter [ 2013-11-20 ] |
|
Fixed in rev. 107. Special thanks to Lionel for his tremendous help! |