Bug 112215 - LibreOffice crashes due to PPD file using CUPS
Summary: LibreOffice crashes due to PPD file using CUPS
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.3.0 target:6.2.0.1 target:6.1.5
Keywords: haveBacktrace
: 122768 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-04 16:00 UTC by jetibest
Modified: 2019-02-11 11:00 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Lexmark printer PPD file that makes LibreOffice crash whenever it is parsed. (131.30 KB, application/vnd.cups-ppd)
2017-09-04 16:00 UTC, jetibest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jetibest 2017-09-04 16:00:22 UTC
Created attachment 136013 [details]
Lexmark printer PPD file that makes LibreOffice crash whenever it is parsed.

I have a printer that uses a PPD file for the 'Lexmark MS310 Series'.
In the PPD file (see attachment) you can find the following two relevant lines:

*?FileSystem: ""
*?TTRasterizer: ""

Even though this is no syntax error according to 'cupstestppd' utility, it is these two lines that make LibreOffice crash (upon opening any Print dialog, and sometimes even when opening an existing file rendering LibreOffice unusable).

Removing these lines from the PPD file, and modifying the printer in the CUPS webinterface with these changes, solves the problem.

This only occurs when the PPD file is added to a printer, and the CUPS service is running.

I have reproduced this issue on two different computers consistently. And using the backtrace parameter, I found that the exception occurs somewhere in a PPDParser related code.


This behavior is bad since a PPD file should never be able to crash LibreOffice without any errors/warnings.
Comment 1 Buovjaga 2017-09-09 15:34:31 UTC
(In reply to jetibest from comment #0)
> This only occurs when the PPD file is added to a printer, and the CUPS
> service is running.
> 
> I have reproduced this issue on two different computers consistently. And
> using the backtrace parameter, I found that the exception occurs somewhere
> in a PPDParser related code.

Could you attach a backtrace?

It sounds like you already got one, but just for completeness: https://wiki.documentfoundation.org/QA/BugReport/Debug_Information

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the backtrace.
Comment 2 jetibest 2017-09-09 18:34:37 UTC
(In reply to Buovjaga from comment #1)
> (In reply to jetibest from comment #0)
> > This only occurs when the PPD file is added to a printer, and the CUPS
> > service is running.
> > 
> > I have reproduced this issue on two different computers consistently. And
> > using the backtrace parameter, I found that the exception occurs somewhere
> > in a PPDParser related code.
> 
> Could you attach a backtrace?
> 
> It sounds like you already got one, but just for completeness:
> https://wiki.documentfoundation.org/QA/BugReport/Debug_Information
> 
> Set to NEEDINFO.
> Change back to UNCONFIRMED after you have provided the backtrace.

Sure, these are the relevant lines:


Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x00007fc20d6f6188 in psp::PPDParser::PPDParser(rtl::OUString const&) () from /usr/lib/libreoffice/program/libvcllo.so
#0  0x00007fc20d6f6188 in psp::PPDParser::PPDParser(rtl::OUString const&) () at /usr/lib/libreoffice/program/libvcllo.so
#1  0x00007fc20d6fb19d in  () at /usr/lib/libreoffice/program/libvcllo.so
#2  0x00007fc20d6f6b53 in psp::PPDParser::getParser(rtl::OUString const&) () at /usr/lib/libreoffice/program/libvcllo.so
#3  0x00007fc20d6fca4d in  () at /usr/lib/libreoffice/program/libvcllo.so
#4  0x00007fc20d6ece95 in psp::JobData::operator=(psp::JobData const&) () at /usr/lib/libreoffice/program/libvcllo.so
#5  0x00007fc20d7349b5 in SalGenericInstance::configurePspInfoPrinter(PspSalInfoPrinter*, SalPrinterQueueInfo*, ImplJobSetup*) () at /usr/lib/libreoffice/program/libvcllo.so
#6  0x00007fc1f73b446e in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#7  0x00007fc20d5faf80 in  () at /usr/lib/libreoffice/program/libvcllo.so
#8  0x00007fc20d5ff206 in Printer::Printer(rtl::OUString const&) () at /usr/lib/libreoffice/program/libvcllo.so
#9  0x00007fc210ad191d in SfxPrinter::SfxPrinter(SfxItemSet*, JobSetup const&) () at /usr/lib/libreoffice/program/libsfxlo.so
#10 0x00007fc210ad1ab8 in SfxPrinter::Create(SvStream&, SfxItemSet*) () at /usr/lib/libreoffice/program/libsfxlo.so
#11 0x00007fc1d29cf0d9 in  () at /usr/lib/libreoffice/program/../program/libsclo.so
#12 0x00007fc209a71ca7 in SvXMLUnitConverter::convertPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () at /usr/lib/libreoffice/program/libxolo.so
#13 0x00007fc1d26dbe78 in  () at /usr/lib/libreoffice/program/../program/libsclo.so
#14 0x00007fc209a1641b in XMLDocumentSettingsContext::EndElement() () at /usr/lib/libreoffice/program/libxolo.so
#15 0x00007fc209a69840 in SvXMLImport::endElement(rtl::OUString const&) () at /usr/lib/libreoffice/program/libxolo.so
#16 0x00007fc209a5e9f0 in SvXMLImportContext::endUnknownElement(rtl::OUString const&, rtl::OUString const&) () at /usr/lib/libreoffice/program/libxolo.so
#17 0x00007fc209a5e816 in SvXMLImportContext::endFastElement(int) () at /usr/lib/libreoffice/program/libxolo.so
#18 0x00007fc209a696e0 in SvXMLImport::endFastElement(int) () at /usr/lib/libreoffice/program/libxolo.so
#19 0x00007fc1d322e310 in  () at /usr/lib/libreoffice/program/../program/libexpwraplo.so
#20 0x00007fc1d32345b8 in  () at /usr/lib/libreoffice/program/../program/libexpwraplo.so
#21 0x00007fc209a5ff7d in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) () at /usr/lib/libreoffice/program/libxolo.so
#22 0x00007fc1d26fac58 in  () at /usr/lib/libreoffice/program/../program/libsclo.so
#23 0x00007fc1d26fd27b in  () at /usr/lib/libreoffice/program/../program/libsclo.so
#24 0x00007fc1d2814eb0 in  () at /usr/lib/libreoffice/program/../program/libsclo.so
#25 0x00007fc1d2815bb5 in ScDocShell::Load(SfxMedium&) () at /usr/lib/libreoffice/program/../program/libsclo.so
#26 0x00007fc2109e319e in SfxObjectShell::LoadOwnFormat(SfxMedium&) () at /usr/lib/libreoffice/program/libsfxlo.so
#27 0x00007fc2109e7c9e in SfxObjectShell::DoLoad(SfxMedium*) () at /usr/lib/libreoffice/program/libsfxlo.so
#28 0x00007fc210a1e9e4 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () at /usr/lib/libreoffice/program/libsfxlo.so
#29 0x00007fc210ac72cd in  () at /usr/lib/libreoffice/program/libsfxlo.so
#30 0x00007fc1e17bc82c in  () at /usr/lib/libreoffice/program/../program/libfwklo.so
#31 0x00007fc1e17bd2c8 in  () at /usr/lib/libreoffice/program/../program/libfwklo.so
#32 0x00007fc1e174d839 in  () at /usr/lib/libreoffice/program/../program/libfwklo.so
#33 0x00007fc1e174e598 in  () at /usr/lib/libreoffice/program/../program/libfwklo.so
#34 0x00007fc2124e78e6 in comphelper::SynchronousDispatch::dispatch(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () at /usr/lib/libreoffice/program/libcomphelper.so
#35 0x00007fc214579d69 in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#36 0x00007fc214585935 in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#37 0x00007fc21455fada in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#38 0x00007fc214560d1b in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#39 0x00007fc20d44a1ff in  () at /usr/lib/libreoffice/program/libvcllo.so
#40 0x00007fc20d70dadb in SalGenericDisplay::DispatchInternalEvent() () at /usr/lib/libreoffice/program/libvcllo.so
#41 0x00007fc1f73b3b21 in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#42 0x00007fc1f73b3bb2 in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#43 0x00007fc2057fe8c5 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#44 0x00007fc2057fec88 in  () at /usr/lib/libglib-2.0.so.0
#45 0x00007fc2057fed1c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#46 0x00007fc1f73b310d in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#47 0x00007fc20d653fff in Application::Yield() () at /usr/lib/libreoffice/program/libvcllo.so
#48 0x00007fc20d6564a6 in Application::Execute() () at /usr/lib/libreoffice/program/libvcllo.so
#49 0x00007fc21456214b in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#50 0x00007fc20d65b198 in  () at /usr/lib/libreoffice/program/libvcllo.so
#51 0x00007fc20d65b2b2 in SVMain() () at /usr/lib/libreoffice/program/libvcllo.so
#52 0x00007fc21458dfd6 in soffice_main () at /usr/lib/libreoffice/program/libsofficeapp.so
#53 0x000055555555478d in  ()
#54 0x00007fc2141b84ca in __libc_start_main () at /usr/lib/libc.so.6
#55 0x00005555555547ca in  ()
Comment 3 Xisco Faulí 2018-11-27 20:00:53 UTC
Hello jetibest,
A new major release of LibreOffice is available since this bug was reported.
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 4 jetibest 2018-11-27 21:03:27 UTC
I don't know why I should be the one to go through the trouble of testing this. Since I'm in a good mood, I just installed cups and libre-office. Tested the print dialog, and it works. But then as soon as I added a new printer with the attached ppd file, it crashes upon opening the print dialog.

tl;dr the problem still occurs with LibreOffice version 6.1.3.2 (tested on Arch Linux).
Comment 5 Commit Notification 2018-11-28 14:10:10 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/3288d88e0c0842a44aa959e41cc665b9cf3804b9%5E%21

Resolves: tdf#112215 null deref on missing optional ppd value

It will be available in 6.3.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 6 Commit Notification 2018-11-28 15:11:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/8f6af557890ae687592075099a02960155511bd5%5E%21

Resolves: tdf#112215 null deref on missing optional ppd value

It will be available in 6.2.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 7 Xisco Faulí 2018-11-29 15:50:48 UTC
Hi jetibest,
Any chance you could verify the fix with a master build from http://dev-builds.libreoffice.org/daily/master/ ?
Comment 8 Xisco Faulí 2019-01-01 19:33:50 UTC
(In reply to Xisco Faulí from comment #7)
> Hi jetibest,
> Any chance you could verify the fix with a master build from
> http://dev-builds.libreoffice.org/daily/master/ ?

Hello jetibest,
did you have the change to check if the problem is fixed in LibreOffice 6.2.0.1 ? You can dowload it from https://wiki.documentfoundation.org/QA/GetInvolved#Test_Pre-releases
Comment 9 Xisco Faulí 2019-01-07 11:32:45 UTC
Closing as RESOLVED FIXED!
@Caolán McNamara, thanks for fixing this!
Comment 10 Commit Notification 2019-01-11 15:38:11 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/f100b106a52561f8a1934b4c3198712d7e9c464f%5E%21

Resolves: tdf#112215 null deref on missing optional ppd value

It will be available in 6.1.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 11 Xisco Faulí 2019-02-11 11:00:23 UTC
*** Bug 122768 has been marked as a duplicate of this bug. ***