Bug 125472 - Crash vcllo!OutputDevice::RemoveTransparenciesFromMetaFile+0xa68:
Summary: Crash vcllo!OutputDevice::RemoveTransparenciesFromMetaFile+0xa68:
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.3.0
Keywords: bibisectRequest, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2019-05-23 21:19 UTC by Telesto
Modified: 2019-05-28 11:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bt Windows (windbg) (59.33 KB, text/plain)
2019-05-24 07:23 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2019-05-23 21:19:22 UTC
Description:
Crash vcllo!OutputDevice::RemoveTransparenciesFromMetaFile+0xa68:

Steps to Reproduce:
1. open https://documentation.libreoffice.org/assets/Uploads/Documentation/en/WG5.4/WG54-WriterGuideLO.odt
2. Press Print
3. Select Microsoft XPS Printer or a PDF Printer
4. Press OK & Wait (a long, very long time) Crash somewhere at after pag 250

Actual Results:
Crash

Expected Results:
no crash


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.3.0.0.alpha1+
Build ID: 959e8ae7ea33ce94dd80ee8ea172b6db64593873
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-05-21_23:35:12
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL
Comment 1 Julien Nabet 2019-05-24 07:23:45 UTC
Created attachment 151653 [details]
bt Windows (windbg)

On Windows 10 with master sources updated yesterday + enable-dbgutil, I could reproduce this. (after less than 20 pages)
Comment 2 Xisco Faulí 2019-05-24 07:49:21 UTC
it doesn't crash in

Versión: 6.2.3.2
Id. de compilación: aecc05fe267cc68dde00352a451aa867b3b546ac
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES
Calc: threaded

it might be a regression in master...
Comment 3 Julien Nabet 2019-05-24 08:00:24 UTC
It could be due to my patch here:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=3ff0c23b54ba4e7a534693ba25a3ffb27d1c18e1

I'll test the revert of it locally.
Comment 4 Julien Nabet 2019-05-24 08:18:05 UTC
I confirm by reverting the patch locally, it works.
I'm trying to find another way to fix this to avoid list use.
Of course, if I find nothing quickly (in the very next days), I'll just revert the patch.
Comment 5 Julien Nabet 2019-05-24 08:40:50 UTC
It was just a invalidation pb.
Since I had replaced list by vector, it's not possible to create a const end iterator for the loop.

Here's the patch to apply which includes some simplification:
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 1ca7014778f5..2aec6add9634 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -917,8 +917,6 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
                         bTreatSpecial = true;
                 }

-                ConnectedComponentsList::iterator       aCurrCC;
-                const ConnectedComponentsList::iterator aLastCC( aCCList.end() );
                 bool                                    bSomeComponentsChanged;

                 // now, this is unfortunate: since changing anyone of
@@ -934,7 +932,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
                     bSomeComponentsChanged = false;

                     // iterate over all current members of aCCList
-                    for( aCurrCC=aCCList.begin(); aCurrCC != aLastCC; )
+                    for( auto aCurrCC=aCCList.begin(); aCurrCC != aCCList.end(); )
                     {
                         // first check if current element's bounds are
                         // empty. This ensures that empty actions are not

I'll be able to submit it after my day time job.
If someone wants to submit it, don't hesitate to! :-)
Comment 6 Julien Nabet 2019-05-24 20:38:06 UTC
Patch submitted on gerrit:
https://gerrit.libreoffice.org/#/c/72922/
Comment 7 Commit Notification 2019-05-24 21:34:20 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/7f3d3e74fdcffb55da7fd7f55ac4c1f85d35745c%5E%21

tdf#125472: fix RemoveTransparenciesFromMetaFile(vcl/gdi)

It will be available in 6.3.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 8 Xisco Faulí 2019-05-28 10:34:26 UTC
@Telesto,
Could you please verify this issue is fixed ?
Comment 9 Telesto 2019-05-28 11:12:04 UTC
Version: 6.3.0.0.alpha1+
Build ID: 63b39fe87644587210214198fb67d6b3fb3343c5
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-05-27_01:42:59
Locale: it-IT (nl_NL); UI-Language: en-US
Calc: CL