Bug 99365 - Python-UNO segfaults when calling setSourceDocument on GraphicExportFilter
Summary: Python-UNO segfaults when calling setSourceDocument on GraphicExportFilter
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-18 05:47 UTC by Jens Troeger
Modified: 2016-12-07 12:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Writer document with a single image. (145.81 KB, application/vnd.oasis.opendocument.text)
2016-04-18 15:54 UTC, Jens Troeger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Troeger 2016-04-18 05:47:35 UTC
Based on the following forum discussion: https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=82965&p=384571#p384557

This code snippet segfaults on both Linux and Mac. Here is the Linux call stack if that helps (sorry, no symbols for this build):

>>> ...
>>> sm = uno.getComponentContext().ServiceManager
>>> s = sm.createInstanceWithContext("com.sun.star.drawing.GraphicExportFilter", uno.getComponentContext())
>>> s.setSourceDocument(shape)

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff09a940d in Application::GetSolarMutex() () from /usr/lib64/libreoffice/program/../program/libmergedlo.so
(gdb) bt
#0  0x00007ffff09a940d in Application::GetSolarMutex() () from /usr/lib64/libreoffice/program/../program/libmergedlo.so
#1  0x00007ffff00209ef in ?? () from /usr/lib64/libreoffice/program/../program/libmergedlo.so
#2  0x00007ffff28982b7 in ?? () from /usr/lib64/libreoffice/program/libgcc3_uno.so
#3  0x00007ffff28975ad in ?? () from /usr/lib64/libreoffice/program/libgcc3_uno.so
#4  0x00007ffff2897de2 in ?? () from /usr/lib64/libreoffice/program/libgcc3_uno.so
#5  0x00007ffff2462f7b in ?? () from /usr/lib64/libreoffice/program/libreflectionlo.so
#6  0x00007ffff268196a in ?? () from /usr/lib64/libreoffice/program/libinvocationlo.so
#7  0x00007ffff5a5ce67 in ?? () from /usr/lib64/libreoffice/program/libpyuno.so
#8  0x00007ffff795bdc8 in PyObject_Call () from /usr/lib64/libpython3.4m.so.1.0
#9  0x00007ffff7a41a48 in PyEval_EvalFrameEx () from /usr/lib64/libpython3.4m.so.1.0
#10 0x00007ffff7a456b3 in PyEval_EvalCodeEx () from /usr/lib64/libpython3.4m.so.1.0
#11 0x00007ffff7a4575b in PyEval_EvalCode () from /usr/lib64/libpython3.4m.so.1.0
#12 0x00007ffff7a701ae in PyRun_InteractiveOneObject () from /usr/lib64/libpython3.4m.so.1.0
#13 0x00007ffff7a7049e in PyRun_InteractiveLoopFlags () from /usr/lib64/libpython3.4m.so.1.0
#14 0x00007ffff7a714ee in PyRun_AnyFileExFlags () from /usr/lib64/libpython3.4m.so.1.0
#15 0x00007ffff7a8b7d3 in Py_Main () from /usr/lib64/libpython3.4m.so.1.0
#16 0x0000000000400b16 in main ()
Comment 1 Jens Troeger 2016-04-18 14:43:39 UTC
Same happens on LO 4.4.7.2 and the latest 5.1.2.
Comment 2 raal 2016-04-18 15:37:02 UTC
Please prepare test case, thank you
Comment 3 Jens Troeger 2016-04-18 15:54:03 UTC
Created attachment 124462 [details]
Writer document with a single image.
Comment 4 Jens Troeger 2016-04-18 15:54:40 UTC
Comment on attachment 124462 [details]
Writer document with a single image.

See the attached document. Run office as a server:

/path/to/soffice --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"

Then open your Python interpreter, and follow these steps:

>>> import uno
>>> local = uno.getComponentContext()
>>> resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local)
>>> context = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
>>> desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
>>> document = desktop.loadComponentFromURL("file:///path/to/foo.odt", "_blank", 0, ())
>>> shapeenum = document.DrawPage.createEnumeration()
>>> shape = shapeenum.nextElement()
>>> sm = uno.getComponentContext().ServiceManager
>>> s = sm.createInstanceWithContext("com.sun.star.drawing.GraphicExportFilter", uno.getComponentContext())
>>> s.setSourceDocument(shape)
Segmentation fault: 11
Comment 5 QA Administrators 2016-11-08 12:20:57 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2016-12-07 12:23:31 UTC
Dear Bug Submitter,

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

MassPing-NeedInfo-20161207