Bug 91782 - Export draw-document to eps result in crash
Summary: Export draw-document to eps result in crash
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: Other All
: high critical
Assignee: Julien Nabet
URL:
Whiteboard: target:5.1.0 target:5.0.2 target:5.0.1
Keywords: haveBacktrace, regression
: 91772 93235 93344 93429 93471 93585 (view as bug list)
Depends on:
Blocks: VclPtr
  Show dependency treegraph
 
Reported: 2015-05-31 18:21 UTC by Jorendc
Modified: 2016-10-25 19:24 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (11.49 KB, text/plain)
2015-05-31 20:06 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jorendc 2015-05-31 18:21:48 UTC
* Open Draw
* File > Export ...
* File Format: EPS
* Save

LibreOffice crashes

Tested using Windows 7 x64 with LibreOffice Version: 5.1.0.0.alpha1+
Build ID: 6a626955eb8b803fa58a58baafaa2a06ab4761f2
TinderBox: Win-x86@39, Branch:master, Time: 2015-05-30_07:46:48
Locale: nl-BE (nl_BE)
Comment 1 raal 2015-05-31 19:31:01 UTC
I can confirm with Version: 5.1.0.0.alpha1+
Build ID: ef2e135cfb8f107a154aaab9b54f2dfca0edf6a0
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-05-28_23:58:34
Comment 2 Julien Nabet 2015-05-31 20:06:46 UTC
Created attachment 116200 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 Julien Nabet 2015-05-31 20:19:45 UTC
Michael/Noel:
with this patch, no crash and eps export seems ok:
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 1cc70b9..ff573ed 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -116,7 +116,7 @@ private:
     SvStream*           mpPS;
     const GDIMetaFile*  pMTF;
     GDIMetaFile*        pAMTF;              // only created if Graphics is not a Metafile
-    ScopedVclPtr<VirtualDevice> pVDev;
+    ScopedVclPtrInstance<VirtualDevice> pVDev;
 
     double              nBoundingX1;        // this represents the bounding box
     double              nBoundingY1;

Is it a right fix?
Comment 4 Julien Nabet 2015-05-31 20:35:20 UTC
*** Bug 91772 has been marked as a duplicate of this bug. ***
Comment 5 Julien Nabet 2015-05-31 20:52:35 UTC
In vcl/README.lifecycle, I noticed this:
-       VirtualDevice aDev;
+       ScopedVclPtrInstance<VirtualDevice> pDev;

May we blindly apply this to all these instances:
http://opengrok.libreoffice.org/search?q=%22ScopedVclPtr%3CVirtualDevice%3E%22&project=core&defs=&refs=&path=&hist=
?
Comment 6 Michael Meeks 2015-06-01 08:08:49 UTC
No - please don't blindly apply that; in many cases the VirtualDevice is correctly constructed in the constructor for these; and duplicating that will create a lot of problems.

Best to work out which commit this was included in (many of them have been audited), and then re-check each instance - to ensure that there is no construction of the VirtualDevice.

Thanks though for isolating a fix; will review & commit !
Comment 7 Commit Notification 2015-06-01 08:30:28 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#91782 - fix VirtualDevice allocation crasher in eps filter.

It will be available in 5.1.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 8 Michael Meeks 2015-06-01 09:01:13 UTC
It'd be great to test & close etc. if fixed =)
Comment 9 Michael Meeks 2015-06-02 09:54:45 UTC
Marking fixed for now; thanks !
Comment 10 Roman Kuznetsov 2015-08-12 19:43:24 UTC
backporting 5.0 will be made?

this bug in LO 5.0.0.5 is reproduced
Comment 11 Roman Kuznetsov 2015-08-12 19:44:45 UTC
*** Bug 93344 has been marked as a duplicate of this bug. ***
Comment 12 Julien Nabet 2015-08-13 05:40:39 UTC
Gerrit review for 5.0 branch: https://gerrit.libreoffice.org/#/c/17688/
Comment 13 Commit Notification 2015-08-13 06:57:12 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6071bab93bae55cf037d1c31c63879cab66ad0d9&h=libreoffice-5-0

tdf#91782 - fix VirtualDevice allocation crasher in eps filter.

It will be available in 5.0.2.

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 14 Commit Notification 2015-08-14 12:15:15 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-0-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=23eec7bbf0cfbf6bdff4d98cdea77eb35ae6b5c4&h=libreoffice-5-0-1

tdf#91782 - fix VirtualDevice allocation crasher in eps filter.

It will be available in 5.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 15 V Stuart Foote 2015-08-16 19:23:50 UTC
*** Bug 93471 has been marked as a duplicate of this bug. ***
Comment 16 V Stuart Foote 2015-08-16 19:30:20 UTC
*** Bug 93429 has been marked as a duplicate of this bug. ***
Comment 17 Julien Nabet 2015-08-22 09:27:35 UTC
*** Bug 93585 has been marked as a duplicate of this bug. ***
Comment 18 Julien Nabet 2015-08-22 15:49:37 UTC
*** Bug 93235 has been marked as a duplicate of this bug. ***
Comment 19 Doug 2015-08-29 14:08:41 UTC
SUCCESSFUL eps export of chart in Calc LO Version: 5.0.1.2.0+ Build ID: 00m0(Build:2) Locale: en-US (en_US.UTF-8) on Linux OpenSuse 13.2 KDE Plasma 5.3.95.