Bug 140339 - CRASH: after closing firebird document
Summary: CRASH: after closing firebird document
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Database-Firebird-Default Crash
  Show dependency treegraph
 
Reported: 2021-02-11 14:44 UTC by Xisco Faulí
Modified: 2023-04-30 08:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (5.92 KB, text/plain)
2021-02-11 20:06 UTC, Julien Nabet
Details
bt with debug symbols (8.54 KB, text/plain)
2021-02-20 08:13 UTC, Julien Nabet
Details
bts in KO case (11.30 KB, text/plain)
2021-02-20 10:03 UTC, Julien Nabet
Details
bts in OK cases (14.84 KB, text/plain)
2021-02-20 10:05 UTC, Julien Nabet
Details
Valgrind trace (358.43 KB, text/x-log)
2021-02-20 11:55 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2021-02-11 14:44:17 UTC
Steps to reproduce:
1. Open attachment 169603 [details] from bug 140285
2. Activate the macros while loading the document
3. Close LibreOffice

-> Crash

Reproduced in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 066799b4a162aa0a4bc6aa28339f1f943a13971e
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2021-02-11 14:45:19 UTC
Regression introduced by:

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

author	Julien Nabet <serval2412@yahoo.fr>	2020-11-13 18:45:29 +0100
committer	Stephan Bergmann <sbergman@redhat.com>	2020-11-26 15:06:59 +0100
commit 86744f03992213af162df6954313c9f9e44e3a0a (patch)
tree ac3eb1d28ad78a81ad8d453c560415059540c0c0
parent 952242a20cdc4a0248a95c1e1d61b1c213ae270a (diff)
firebird: update to 3.0.7

Bisected with: bibisect-linux64-7.2

Adding Cc: to Julien Nabet
Comment 2 Julien Nabet 2021-02-11 20:06:52 UTC
Created attachment 169692 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I got an assertion here but no bt, only some stacktrace without detailed symbols on console
Comment 3 Julien Nabet 2021-02-11 20:08:10 UTC
No idea what's the root cause here so I can't help => uncc myself
Feel free to revert the commit of course!
Comment 4 Julien Nabet 2021-02-20 08:13:50 UTC
Created attachment 169908 [details]
bt with debug symbols

Here's a real bt retrieved on pc Debian x86-64 with master sources updated today + gen rendering.
Comment 5 Julien Nabet 2021-02-20 08:29:29 UTC
Quite weirdly when not enabling macros, when closing LO, connectivity::firebird::Connection::disposing() isn't called.
Comment 6 Julien Nabet 2021-02-20 09:01:17 UTC
Firebird is the only one with Connection::disposing(const EventObject&)
 except connectivity/source/cpool/ZPooledConnection.cxx

https://opengrok.libreoffice.org/xref/core/connectivity/source/cpool/ZPooledConnection.cxx?r=6ec7f2b2#42
https://opengrok.libreoffice.org/xref/core/connectivity/source/cpool/ZPooledConnection.cxx?r=6ec7f2b2#52

All other connectivity DBs seem to only use disposing() method.

I added some fprintf in these 2 disposing methods in Firebird.
see:
https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/Connection.cxx?r=1250aecd#838

https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/Connection.cxx?r=1250aecd#895


If I disable macros and browse table, when closing, I see these calls:
- Connection::disposing()
- Connection::disposing(const EventObject&)

If I enable macros and browse table, when closing, I got:
- Connection::disposing(const EventObject&)
- Connection::disposing()
and it crashes in this last one.

I don't know what's the use of Connection::disposing(const EventObject&), I can just tell if I empty the method, it doesn't crash.
Of course, I know it's a not a fix per se but at least it's a hint.
Comment 7 Julien Nabet 2021-02-20 10:03:16 UTC
Created attachment 169910 [details]
bts in KO case

Here are the calls in KO case, ie:
launch odb file, enable macros.

When closing odb file, first bt in the file
When quitting odb file, second bt in the file which leads to the pb.
Comment 8 Julien Nabet 2021-02-20 10:05:57 UTC
Created attachment 169911 [details]
bts in OK cases

To be more precise, I also put the results in 2 OK cases.
1) when when closing directly after launching odb + disable macros:
no disposing call after closing odb
no disposing call after quitting LO

2) when when closing after launching odb + disable macros + browsing tables:
the 2 disposing methods are called

no disposing call when quitting LO.
Comment 9 Julien Nabet 2021-02-20 11:55:37 UTC
Created attachment 169914 [details]
Valgrind trace

Here's a Valgrind trace on pc Debian x86-64 with enable-symbols (not enable-dbgutil) + gen rendering if it can help.
Comment 10 Xisco Faulí 2021-06-01 08:52:25 UTC
Still reproducible in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: f49e5902a3737c02fabf5bec23243ccb126426c4
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 11 Buovjaga 2022-02-01 14:13:08 UTC
No crash on Windows, but crashes still on Linux.

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: ba0100be03c6bbc5ae10201bae340b3f7b7c4500
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 27 January 2022