Bug 128572 - Crash LibreOffice Calc when running python script importing matplotlib.pyplot
Summary: Crash LibreOffice Calc when running python script importing matplotlib.pyplot
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
Reported: 2019-11-03 17:36 UTC by bill.a.lucyk
Modified: 2020-07-04 03:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description bill.a.lucyk 2019-11-03 17:36:06 UTC
I have a script that runs in LibreOffice Calc that uses matplotlib.pyplot.
It used to work on a daily basis, but I ran it yesterday, (after a gap of maybe 2 months) and it crashed libreoffice.

Through trial and error I narrowed down the last statement run before the crash to  "import matplotlib.pyplot as plt".  When I removed the statement, the script ran without a crash.

I moved the "import matplotlib.pyplot as plt" line down to after the logging started, and this message came out in the log before the crash occurred:  "Loaded backend qt5agg version unknown."  QT5Agg is a "Backend" for pyplot, i.e., it provides lower-level graphics support for the drawing of the chart images.

If I put this in a python script outside of the libreoffice environment (for example, in a jupyter notebook, or a standalone python script), it doesn't crash.

I'm wondering whether LO cannot access the backend QT5Agg, and that's why this crash is happening.

As I say, this used to work fine every time, and after no changes to the script it crashes Libreoffice, this would have occurred over perhaps the last 2 months.  I've been keeping my software up-to-date.

Python : 3.6.8
Matplotib : 3.1.1
Kubuntu 18.04
KDE: 5.12.9
QT : 5.9.5

Steps to Reproduce:
1.  Create python script with the following lines of code:  (I'm assuming that it would be necessary to match the OS, LO version, etc.)  This is a simplified script that I hope will suffice for bug reporting purposes)

import matplotlib
import matplotlib.pyplot as plt

def ThisBreaksinLO():

2.  Open an empty Calc spreadsheet and run the script
3.  It will cause LO to crash

Actual Results:
LibreOffice crashed

Expected Results:
The script will run without crashing LibreOffice.  The script does not do anything but load the modules.

Reproducible: Always

User Profile Reset: No

Additional Info:
Build ID: 1:6.0.7-0ubuntu0.18.04.10
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: en-CA (en_CA.UTF-8); Calc: group
Comment 1 Xisco Faulí 2019-11-04 11:20:50 UTC
Thank you for reporting the bug.
it seems you're using an old version of LibreOffice.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 2 QA Administrators 2020-06-03 03:48:49 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2020-07-04 03:37:22 UTC
Dear bill.a.lucyk,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team