testListLabelPDFExport segfaulting

Stephan Bergmann sbergman at redhat.com
Thu Sep 14 08:50:35 UTC 2023


On 9/14/23 09:44, Dan Horák wrote:
> On Thu, 14 Sep 2023 09:16:38 +0200
> Stephan Bergmann <sbergman at redhat.com> wrote:
>> I'd suggest to rather make execution of the test dependent on
>> $(ENABLE_PDFIUM), or on PDFIUM in $(BUILD_TYPE) (cf. configure.ac).
>> (Otherwise, you would silently hide errors when parsePDFExport()
>> erroneously returns null.)
> 
> if I read
> https://opengrok.libreoffice.org/xref/core/test/source/unoapi_test.cxx?r=58ab2f00#213
> right, then parsePDFExport() can return NULL only when built without
> pdfium. There is an assert checking NULL value returned from
> pPDFium->openDocument(). Thus we shouldn't be hiding anything, I
> believe.

Yeah, it can only return null when vcl::pdf::PDFiumLibrary::get() 
returns null.  Which in turn can only happen when that uses 
vcl/source/pdf/DummyPDFiumLibrary.cxx rather than 
vcl/source/pdf/PDFiumLibrary.cxx.  A bit of an indirection, so I guess I 
would still use the explicit $(ENABLE_PDFIUM) way, but of course leave 
it up to you.

>> But I wonder why all the other tests that call parsePDFExport() don't
>> appear to be conditional on $(ENABLE_PDFIUM), either.



More information about the LibreOffice mailing list