Bug 118374 - CRASH: Writer's master document crashed when insert pdf file
Summary: CRASH: Writer's master document crashed when insert pdf file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: highest critical
Assignee: Julien Nabet
URL:
Whiteboard: target:6.2.0 target:6.1.0.1
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2018-06-25 15:05 UTC by Roman Kuznetsov
Modified: 2018-06-28 09:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["libpdfimportlo.so", "pdfi::Element::applyToChildren(pdfi::ElementTreeVisitor &)"]


Attachments
PDf file (16.12 KB, application/pdf)
2018-06-25 15:06 UTC, Roman Kuznetsov
Details
gdb backtrace (37.03 KB, text/plain)
2018-06-25 16:07 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2018-06-25 15:05:42 UTC
Description:
master document crashed when insert pdf file

Steps to Reproduce:
1. Create a Writer's master document
2. Open Navigator
3. Select icon Insert->File
4. Select PDF file
5. LibreOffice crashes

Actual Results:
LibreOffice crashes

Expected Results:
LibreOffice doesn't crash


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Roman Kuznetsov 2018-06-25 15:06:38 UTC
Created attachment 143100 [details]
PDf file
Comment 2 Roman Kuznetsov 2018-06-25 15:08:15 UTC
Версия: 6.0.3.2
ID сборки: 8f48d515416608e3a835360314dac7e47fd0b821
Потоков ЦП: 4; ОС:Linux 4.13; Отрисовка ИП: по умолчанию; VCL: gtk2; 
Локаль: ru-RU (ru_RU.UTF-8); Calc: group

Xubuntu 17.10 / 64 bit
Comment 3 Xisco Faulí 2018-06-25 15:55:38 UTC
Regression introduced by:

author	Noel Grandin <noel.grandin@collabora.co.uk>	2018-02-28 11:09:43 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2018-03-06 10:07:02 +0100
commit a9ef943769b06e6bdffe7326f288b27e08a95698 (patch)
tree ede6ab60bd28609eaf250e7bec61cdb28da61542
parent 240e67e37e1aaf459315e31a298bfb434fc1da8c (diff)
loplugin:useuniqueptr in sdext

Bisected with:

Adding Cc: to Noel Grandin
Comment 4 Xisco Faulí 2018-06-25 15:58:34 UTC
I can also reproduce it in

Versión: 6.1.0.0.beta2
Id. de compilación: 0f4d2060bc90b4008fbc8e6d9a49ec7eeea60b78
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group threaded

but not in

Versión: 6.0.4.2
Id. de compilación: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group
Comment 5 Xisco Faulí 2018-06-25 16:07:16 UTC
Created attachment 143105 [details]
gdb backtrace
Comment 6 Julien Nabet 2018-06-26 08:24:04 UTC
Since we've been using std::unique_ptr with the quoted commit in 	sdext/source/pdfimport/tree part, it seems call to delete should be removed in:
- https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/tree/writertreevisiting.cxx#422
- https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/tree/writertreevisiting.cxx#822 too?
- https://opengrok.libreoffice.org/xref/core/sdext/source/pdfimport/tree/genericelements.cxx#450 too?

I'll be able to test this only when come back to home after my day time job.
Comment 7 Julien Nabet 2018-06-26 18:14:52 UTC
I submitted this patch on gerrit:
https://gerrit.libreoffice.org/#/c/56490/
Comment 8 Commit Notification 2018-06-27 05:04:22 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4964cb80ec603a1ce9937f230fc6ed6b761a6e1f

tdf#118374: fix crash from loplugin:useuniqueptr in sdext

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-06-27 06:39:00 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=010a9de17f1629343471c62b5c4dbd6810e1d0a1&h=libreoffice-6-1

tdf#118374: fix crash from loplugin:useuniqueptr in sdext

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Xisco Faulí 2018-06-28 09:35:55 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 6ebc026e34d0c119067e7dfbad8d932f92844760
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

@Julien, Thanks for fixing this!!
Comment 11 Julien Nabet 2018-06-28 09:50:01 UTC
(In reply to Xisco Faulí from comment #10)
> ...
> @Julien, Thanks for fixing this!!

Thank you for your feedback! :-)