Description: Hi, With poppler 25.02.0, opening PDF files in LibreOffice (Writer) fails with: ``` General Error. General input/output error. ``` Screenshot here: https://pasteboard.co/W5s0NnuAhj25.png Steps to Reproduce: 1. Build LibreOffice with poppler 25.02.0 2. Open a PDF file in LibreOffice Writer 3. See error Actual Results: ``` General Error. General input/output error. ``` Expected Results: PDF file opening as expected Reproducible: Always User Profile Reset: Yes Additional Info: This issue is affecting both `24.8.5.x` and `25.2.0.x` versions. I wasn't able to generate more logs than the error in the description for the moment, sorry about that. For cross-reference, this issue was reported on our side (Arch Linux) here: https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/-/issues/6 I'm happy to provide any information that could help or test any patches :)
Created attachment 199437 [details] Screenshot of the error
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Created attachment 199438 [details] Sample document to reproduce the issue
not reproduced with poppler-25.01, testing with poppler-25.02...
confirmed as in bug 165363 and external downstream for LFS and arch linux. Seems LO only up to poppler 25.01 for CVE-2024-56378 with https://gerrit.libreoffice.org/c/core/+/179903 and backport to 24.8 with https://gerrit.libreoffice.org/c/core/+/179956
> not reproduced with poppler-25.01, testing with poppler-25.02... @Xisco, yes sorry... I should have made clearer that this only happens with poppler-25.02.
(In reply to Robin Candau from comment #6) > > not reproduced with poppler-25.01, testing with poppler-25.02... > > @Xisco, yes sorry... I should have made clearer that this only happens with > poppler-25.02. then it looks like a poppler regression, isn't it ?
I can't reproduce the issue with LibreOffice master bf4fe0c2ba1d0a44cc07c6afba6d56b8adf8af50 using --without-system-poppler with https://gerrit.libreoffice.org/c/core/+/182169 on top. PDF file opens fine for me
*** Bug 165363 has been marked as a duplicate of this bug. ***
Hi Robin, Is https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/-/commit/070fd4f2f5d939e6d4f21f96dd15f306f526575d missing anything ? I'm surprised it works out of the box without tweaking any patch
(In reply to Xisco Faulí from comment #10) > Hi Robin, > Is > https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/- > /commit/070fd4f2f5d939e6d4f21f96dd15f306f526575d missing anything ? I'm > surprised it works out of the box without tweaking any patch Hi, It should not, I was able to rebuild the package against poppler 25.02.0 just now without issue nor requiring any additional tweaking.
I repro with the Arch-packaged version, but building master with --with-system-poppler, I can't repro. Robin: can you repro with master?
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/12c1596b0fd152399bed90f3d26014a32efc24e3 related tdf#165433: poppler: upgrade to 25.02.0 It will be available in 25.8.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.
Internal poppler has been upgraded to 25.02.0 as well. No crash for me when building with --without-system-poppler. Testing from others is appreciated as well
Same error in Archlinux with poppler 25.02.0 I also get a coredump with xpdfimport when the error happens #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007ffff74a56d3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89 #2 0x00007ffff744bba0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007ffff7433582 in __GI_abort () at abort.c:73 #4 0x00007ffff7697b2c in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95 #5 0x00007ffff76ae3ba in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48 #6 0x00007ffff769752a in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58 #7 0x00007ffff76ae676 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff7876d60 <typeinfo for std::logic_error>, dest=0x7ffff76c5a30 <std::logic_error::~logic_error()>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98 #8 0x00007ffff769b2dd in std::__throw_logic_error (__s=0x5555555620a0 "basic_string: construction from null is not valid") at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/functexcept.cc:70 #9 0x0000555555557549 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> > () at /usr/include/c++/14.2.1/bits/basic_string.h:651 #10 0x000055555555812f in std::make_unique<GlobalParams, char const*&> () at /usr/include/c++/14.2.1/bits/unique_ptr.h:1077 #11 main (argc=-7792, argv=0xd6da) at /usr/src/debug/libreoffice-fresh/libreoffice-25.2.0.3/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:127 Checking the source code changes from poppler 25.02.0 it seems that GlobalParams doesn't have a constructor that accepts a nullptr anymore https://fossies.org/diffs/poppler/25.01.0_vs_25.02.0/poppler/GlobalParams.h-diff.html
(In reply to Xisco Faulí from comment #14) > Internal poppler has been upgraded to 25.02.0 as well. No crash for me when > building with --without-system-poppler. Testing from others is appreciated > as well I backported the related patch (https://git.libreoffice.org/core/commit/12c1596b0fd152399bed90f3d26014a32efc24e3) into our LibreOffice package and built it with internal poppler 25.02.0 (using --without-system-poppler) for testing purposes. It built fine and I can open PDF files without issues. I'm confused... I guess that means there's either an issue with our poppler 25.02.0 build somehow, or the culprit is elsewhere? (In reply to Buovjaga from comment #12) > I repro with the Arch-packaged version, but building master with > --with-system-poppler, I can't repro. > > Robin: can you repro with master? Given the above result, I guess the issue is elsewhere. But I'll still try to give master a go tomorrow, just in case.
(In reply to Robin Candau from comment #16) > (In reply to Xisco Faulí from comment #14) > > Internal poppler has been upgraded to 25.02.0 as well. No crash for me when > > building with --without-system-poppler. Testing from others is appreciated > > as well > > I backported the related patch > (https://git.libreoffice.org/core/commit/ > 12c1596b0fd152399bed90f3d26014a32efc24e3) into our LibreOffice package and > built it with internal poppler 25.02.0 (using --without-system-poppler) for > testing purposes. It built fine and I can open PDF files without issues. > > I'm confused... I guess that means there's either an issue with our poppler > 25.02.0 build somehow, or the culprit is elsewhere? The only difference seems to be external/poppler/disable-freetype.patch.1
I was able to reproduce this issue on Fedora (Rawhide) using their LibreOffice package (25.2.0), which is built with their poppler (25.02.0) system package (not LibreOffice's internal poppler), as we do at Arch Linux. See screenshots here with full versions details: https://postimg.cc/gallery/rdz0Bbk (I'll upload them as attachments as well). That means this issue is not specific to our poppler build (nor to Arch Linux overall) after all.
Created attachment 199463 [details] Bug Reproduced on Fedora Rawhide
Created attachment 199464 [details] Fedora Rawhide versions details
(In reply to Robin Candau from comment #18) > I was able to reproduce this issue on Fedora (Rawhide) using their > LibreOffice package (25.2.0), which is built with their poppler (25.02.0) > system package (not LibreOffice's internal poppler), as we do at Arch Linux. > > See screenshots here with full versions details: > https://postimg.cc/gallery/rdz0Bbk (I'll upload them as attachments as well). > > That means this issue is not specific to our poppler build (nor to Arch > Linux overall) after all. This issue also happens on OpenSUSE (Tumbleweed) (see https://postimg.cc/gallery/pLCcYKR or screenshots in attachments), so this definitely seems to affect every LibreOffice builds / packages compiled with system poppler 25.02.0.
Created attachment 199465 [details] Bug Reproduced on OpenSUSE Tumbleweed
Created attachment 199466 [details] OpenSUSE Tumbleweed versions details
(In reply to Buovjaga from comment #17) > (In reply to Robin Candau from comment #16) > > (In reply to Xisco Faulí from comment #14) > > > Internal poppler has been upgraded to 25.02.0 as well. No crash for me when > > > building with --without-system-poppler. Testing from others is appreciated > > > as well > > > > I backported the related patch > > (https://git.libreoffice.org/core/commit/ > > 12c1596b0fd152399bed90f3d26014a32efc24e3) into our LibreOffice package and > > built it with internal poppler 25.02.0 (using --without-system-poppler) for > > testing purposes. It built fine and I can open PDF files without issues. > > > > I'm confused... I guess that means there's either an issue with our poppler > > 25.02.0 build somehow, or the culprit is elsewhere? > > The only difference seems to be external/poppler/disable-freetype.patch.1 Given that the bug is reproducible on other distributions shipping poppler 25.02.0 and building their LibreOffice package against it (rather than with the LO internal version), I agree that there might be a difference somewhere between the system poppler build shipped by said distributions and the LO internal one (most likely some patching done on the LO side?). This "disable-freetype.patch.1" could be it. However: 1 - Applying it to our poppler package results in a failed build, so I need to investigate what's missing from it for us to test that. 2 - Regardless, disabling freetype support altogether in our poppler build is most likely not desirable for us..
(In reply to Buovjaga from comment #12) > I repro with the Arch-packaged version, but building master with > --with-system-poppler, I can't repro. > > Robin: can you repro with master? Yes I can. I rebuilt our LibreOffice package with sources pointing to a clone of the master branch (built with system poppler) and I still face the same issue. ``` $ libreoffice --version LibreOffice 25.8.0.0.alpha0 7dddb827c921fc2b5cdca899c66417cda1822db6 ```
What compiler flags does LibreOffice use when compiling internal poppler. Maybe we're hitting some compile or link time optimisation bug.
Created attachment 199476 [details] output from "make verbose=True poppler"
(In reply to Xisco Faulí from comment #27) > Created attachment 199476 [details] > output from "make verbose=True poppler" I attached the output from make verbose=True poppler. It's done in https://opengrok.libreoffice.org/xref/core/external/poppler/Module_poppler.mk We apply some patches on top in https://opengrok.libreoffice.org/xref/core/external/poppler/UnpackedTarball_poppler.mk and create the static library in https://opengrok.libreoffice.org/xref/core/external/poppler/StaticLibrary_poppler.mk
*** Bug 165469 has been marked as a duplicate of this bug. ***
Created attachment 199496 [details] Patch: Fix PDF import with system poppler >= 25.02
(In reply to Robin Candau from comment #30) > Created attachment 199496 [details] > Patch: Fix PDF import with system poppler >= 25.02 Thanks for the patch. Would you like to submit it? https://wiki.documentfoundation.org/Development/gerrit/setup https://wiki.documentfoundation.org/Development/gerrit/SubmitPatch#Submit_a_patch_for_review_with_gerrit https://wiki.documentfoundation.org/Development/GetInvolved#4._Submit_the_patch
We were able to fix the issue. The culprit is https://git.libreoffice.org/core/+/refs/heads/master/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx#112 Indeed, as pointed by codestation (https://bugs.documentfoundation.org/show_bug.cgi?id=165433#c15), since poppler 25.02.0, GlobalParams doesn't have a constructor that accepts a nullptr anymore (see https://gitlab.freedesktop.org/poppler/poppler/-/commit/b50390f748b59cb0a64b912636ecf6527bd0d12a). As such, the data directory location defined for SYSTEM_POPPLER have to be updated accordingly (if SYSTEM_POPPLER >= 25.02.0). Here is the patch we applied (also available in the attachments): ``` diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx index ebed12070..9b63559be 100644 --- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx @@ -110,7 +110,11 @@ int main(int argc, char **argv) /* Get data directory location */ #ifdef SYSTEM_POPPLER +#if POPPLER_CHECK_VERSION(25, 0, 2) + const std::string datadir = ""; +#else const char* datadir = nullptr; +#endif #else /* Creates an absolute path to the poppler_data directory, by taking the path * to the xpdfimport executable (provided in argv[0], and concatenating a ```
(In reply to Buovjaga from comment #31) > (In reply to Robin Candau from comment #30) > > Created attachment 199496 [details] > > Patch: Fix PDF import with system poppler >= 25.02 > > Thanks for the patch. Would you like to submit it? > > https://wiki.documentfoundation.org/Development/gerrit/setup > https://wiki.documentfoundation.org/Development/gerrit/ > SubmitPatch#Submit_a_patch_for_review_with_gerrit > https://wiki.documentfoundation.org/Development/GetInvolved#4. > _Submit_the_patch Sure!
(In reply to Buovjaga from comment #31) > (In reply to Robin Candau from comment #30) > > Created attachment 199496 [details] > > Patch: Fix PDF import with system poppler >= 25.02 > > Thanks for the patch. Would you like to submit it? > > https://wiki.documentfoundation.org/Development/gerrit/setup > https://wiki.documentfoundation.org/Development/gerrit/ > SubmitPatch#Submit_a_patch_for_review_with_gerrit > https://wiki.documentfoundation.org/Development/GetInvolved#4. > _Submit_the_patch Patch submitted: https://gerrit.libreoffice.org/c/core/+/182282
Robin Candau committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/406afe11711df9fcabbc829fcff00aef2f44c1d9 tdf#165433 Fix PDF imports with (system) poppler >= 25.02.0 It will be available in 25.8.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.
Looking at https://cgit.freedesktop.org/poppler/poppler/commit/?id=b50390f748b59cb0a64b912636ecf6527bd0d12a But for what its worth, no impact with filter import on opening a PDF with the LibreOffice Community *Windows* builds that now build with poppler 25.02.0 2025-02-26 nightly with 12c1596b0fd152399bed90f3d26014a32efc24e3 Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 12c1596b0fd152399bed90f3d26014a32efc24e3 CPU threads: 8; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded
Robin Candau committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/6a442575b7e802d1a3c4c4c18cd59a66d87a9217 tdf#165433 Fix PDF imports with (system) poppler >= 25.02.0 It will be available in 25.2.2. 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.
Robin Candau committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/c680052f44c394d037cdddcde54f795a8b2a51b4 tdf#165433 Fix PDF imports with (system) poppler >= 25.02.0 It will be available in 24.8.6. 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.
Hi Robin, Should this issue be closed now ?
(In reply to Xisco Faulí from comment #39) > Hi Robin, > Should this issue be closed now ? Hi Xisco, Yes! Sorry 0:) I marked it as "resolved" ;)