Bug 171337 - Breaking a PDF imported with LO_IMPORT_USE_PDFIUM crashes second time
Summary: Breaking a PDF imported with LO_IMPORT_USE_PDFIUM crashes second time
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.8.0 target:26.2.3
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-16 07:14 UTC by Mike Kaganski
Modified: 2026-03-18 16:56 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2026-03-16 07:14:29 UTC
1. Open attachment 142643 [details] from bug 118105 in a debug build, using LO_IMPORT_USE_PDFIUM (e.g., 'LO_IMPORT_USE_PDFIUM=1 soffice path/to/3-collabora_online_slide_deck.pdf').

2. Right-click the PDF object, and Break it.

3. Close the document (without saving), but do not close the program.

4. Open the PDF document again, and break the object again.

On my Windows system, this crashes. The problem is EACCES inside afdko's cbConvert, because the file already exists. The problem is, that the second import may create a new instance of ImpSdrPdfImport, having exactly the same address, so than getPrefix returns the same value (see commit b3bfae88b66acf4e0ecbf3464362834f5ce3ac1e).
Comment 1 Mike Kaganski 2026-03-16 07:24:39 UTC
https://gerrit.libreoffice.org/c/core/+/201785
Comment 2 Commit Notification 2026-03-16 12:42:25 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dc4f4b85c50a2d24c5e2417854f54934bc4136da

tdf#171337: improve prefix generation to guarantee uniqueness

It will be available in 26.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.
Comment 3 Commit Notification 2026-03-18 16:56:09 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/5608d1643f7806f8cbaf704957fddc98c880bfb2

tdf#171337: improve prefix generation to guarantee uniqueness

It will be available in 26.2.3.

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.