Bug 128862 - CRASH: Unable to open tables in HSQLDB odb-files with apostrophe " ' " character in table name
Summary: CRASH: Unable to open tables in HSQLDB odb-files with apostrophe " ' " charac...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: x86-64 (AMD64) All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:6.5.0 target:6.4.0.1 target:6.3.4
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2019-11-17 16:57 UTC by zerianis10
Modified: 2019-11-24 10:46 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
The file in question that is causing the issues (8.22 KB, application/vnd.sun.xml.base)
2019-11-17 17:37 UTC, zerianis10
Details
bt with debug symbols (7.65 KB, text/plain)
2019-11-19 22:03 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zerianis10 2019-11-17 16:57:33 UTC
Description:
When I click on Tables inside any .odb file when Javascript is enabled, Libreoffice instantly crashes.

Steps to Reproduce:
1. Open any .odb file.
2. Click on Table to view the tables in the file.
3. Instant crash to desktop.

Actual Results:
Crashes to desktop

Expected Results:
It should have shown the tables inside the database file.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
This also creates a problem where Libreoffice after you restart it on the crash gets caught in a "Open-Close-Open-Close" infinite loop where you have to manually use the Task Manager to force Libreoffice to close.

Then whatever setting has been corrupted is cleared and when you try to reopen Libreoffice again, it will open regularly.
Comment 1 zerianis10 2019-11-17 17:24:59 UTC
As an update to this I have tried another .odb file that I had with some of the information as in the .odb file that does not work.

For some reason this bug is not reproducable with that second .odb file.

I can open the tables just fine, view and edit information in the .odb file, and save then open as per normal.
Comment 2 zerianis10 2019-11-17 17:37:35 UTC
Created attachment 155899 [details]
The file in question that is causing the issues
Comment 3 Julien Nabet 2019-11-18 08:40:43 UTC
On Win10 with LO 6.3.3, I could reproduce this.
Comment 4 Alex Thurgood 2019-11-18 13:51:35 UTC
I get an immediate crash when trying to load the ODB file with

Version: 6.3.1.2
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded
Comment 5 Alex Thurgood 2019-11-18 13:53:44 UTC
Same crash with 

Version: 6.4.0.0.alpha0+
Build ID: f0c832acb53326ccc9a8c1a47401fbc9e1081feb
CPU threads: 8; OS: Mac OS X 10.14.6; UI render: GL; VCL: osx; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2019-09-11_05:45:47
Locale: fr-FR (fr_FR.UTF-8); UI-Language: en-US
Calc: threaded

I'm guessing the file is corrupt in some way ?
Comment 6 Alex Thurgood 2019-11-18 13:57:36 UTC
No crash with

Version: 5.4.7.2
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group

I can open the table and see the data.

Using OpenJDK 12 with all versions of LO tested.


The only difference I can guess is that the migration wizard in later versions of LO alters or reads the ODB file in some way that causes the crash.
Comment 7 Alex Thurgood 2019-11-18 13:59:49 UTC
Hmm, reading the name of the table, let me guess:

- the table is more than 30 characters long

- the migration assistant baulks on tables with names that are more than 30 characters in length or with special characters (e.g. the possessive "apostrophe")

More testing required.
Comment 8 Alex Thurgood 2019-11-18 14:04:52 UTC
Yep, remove the apostrophe in the table name and all is well.
Comment 9 Alex Thurgood 2019-11-18 14:06:11 UTC
I also removed the spaces first, but I still got a crash, so I assume that having spaces in the name is not the issue.

Only when I removed the apostrophe could I open the table without crashing


Version: 6.2.8.2
Build ID: f82ddfca21ebc1e222a662a32b25c0c9d20169ee
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded
Comment 10 Alex Thurgood 2019-11-18 14:14:59 UTC
First crashes for me (but possibly somewhere earlier in the 6.1 branch) with

Version: 6.1.6.3
Build ID: 5896ab1714085361c45cf540f76f60673dd96a72
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded

Also tested : LO6062 - table is displayed correctly, no crash.
Comment 11 Alex Thurgood 2019-11-18 14:16:00 UTC
For me, the mess around the switch to default firebird implementation is probably the reason for this somewhere.
Comment 12 Alex Thurgood 2019-11-18 14:17:39 UTC
@zerianis10 : as a workaround, load the ODB file into an older version of LO (before 6.1), then remove the apostrophe in the table name, resave, then you should be able to re-open it again in the latest versions of LO.
Comment 13 Robert Großkopf 2019-11-18 18:57:56 UTC
Have tested this one. Appears first in LO 6.1.0, works well in LO 6.0.5. Note it is the internal HSQLDB, which crashes here.
Tested with OpenSUSE 15 64bit rpm Linux.

I will set the version to LO 6.1.0
Comment 14 Julien Nabet 2019-11-19 20:17:15 UTC
Alex: how could migration assistant be the culprit since it's not been called?
For the rest, I agree with you, the apostroph in tablename causes pb but I don't know what's the difference between 6.0 and 6.1.
So yes it needs some bibisect.
Comment 15 Julien Nabet 2019-11-19 22:03:52 UTC
Created attachment 155952 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this
Comment 16 Julien Nabet 2019-11-19 22:08:46 UTC
I gave a try with https://gerrit.libreoffice.org/#/c/83245/1

It doesn't crash but I noticed this log:
warn:connectivity.hsqldb:625946:625946:connectivity/source/drivers/hsqldb/HConnection.cxx:301: DBG_UNHANDLED_EXCEPTION in bool connectivity::hsqldb::OHsqlConnection::impl_isTextTable_nothrow(const rtl::OUString&) exception: com.sun.star.sdbc.SQLException message: Unexpected token: S in statement [s] context: com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SQLState: 37000 ErrorCode: -11
    wrapped: void
Comment 17 Alex Thurgood 2019-11-20 11:49:59 UTC
(In reply to Julien Nabet from comment #14)
> Alex: how could migration assistant be the culprit since it's not been
> called?
> For the rest, I agree with you, the apostroph in tablename causes pb but I
> don't know what's the difference between 6.0 and 6.1.
> So yes it needs some bibisect.

My thinking was that the code responsible for fetching and parsing the table name had been changed to take account of the implementation to migrate to Firebird. This was speculation on my part.
Comment 18 Xisco Faulí 2019-11-20 16:24:07 UTC
I can't reproduce it in

Versión: 6.3.3.2 (x86)
Id. de compilación: a64200df03143b798afd1ec74a12ab50359878ed
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES
Calc: threaded
Comment 19 Xisco Faulí 2019-11-20 16:25:34 UTC
well, actually it can be reproduced on mac, changing the OS back to ALL
Comment 20 Xisco Faulí 2019-11-20 17:20:13 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=ee0e19296b959b4545b094f49a8b0c0b546399d7

author	Noel Grandin <noel.grandin@collabora.co.uk>	2018-04-03 14:57:25 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2018-04-05 11:17:45 +0200
commit ee0e19296b959b4545b094f49a8b0c0b546399d7 (patch)
tree 23143651b2cb6f98146730f050c5093edde518d7
parent b3ab7292931fe8fb0411b667de31c68988ce3c94 (diff)
make DBG_UNHANDLED_EXCEPTION log in non-dbgutl mode, too
So we can use it like SAL_WARN

Bisected with: bibisect-mac64-6.1

Adding Cc: to Noel Grandin
Comment 21 Commit Notification 2019-11-21 21:17:09 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c5f0e89ee5b1d13416987ddceaccc4d8a0816986

tdf#128862: fix HSQLDB odb-files with apostrophe crash

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2019-11-22 09:25:51 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/1050c56ec41afae842834afb2b3dcca133efc71e

tdf#128862: fix HSQLDB odb-files with apostrophe crash

It will be available in 6.4.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Julien Nabet 2019-11-22 09:30:29 UTC
The patch for 6.3 branch is on review:
https://gerrit.libreoffice.org/#/c/83436/

Just to be clear, the patch is more a workaround than a real fix (see comments from https://gerrit.libreoffice.org/#/c/83245/ with RTTI gory details).

Moreover if HSQLDB should accept quotes in table name, we still got a pb to take into account without loggging an error.
Comment 24 Xisco Faulí 2019-11-22 09:59:22 UTC
Verified in

Version: 6.5.0.0.alpha0+
Build ID: d0eb495c6a3eca77a475759298f58a70ab73851f
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Julien, thanks for the fix or workaround or whatever it's is!
Comment 25 Commit Notification 2019-11-22 16:05:46 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/5fd96e4b96da471afef510c8e3c26ab3c4890881

tdf#128862: fix HSQLDB odb-files with apostrophe crash

It will be available in 6.3.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Commit Notification 2019-11-23 19:18:26 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-3-4":

https://git.libreoffice.org/core/commit/59c51419381a2b2532fbd0d094f62e0527e60369

tdf#128862: fix HSQLDB odb-files with apostrophe crash

It will be available in 6.3.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.