Bug 96785 - Crash when copying object from wpd
Summary: Crash when copying object from wpd
Status: RESOLVED DUPLICATE of bug 97108
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2015-12-29 12:38 UTC by Julien Nabet
Modified: 2016-02-19 22:13 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (6.47 KB, text/plain)
2015-12-29 12:38 UTC, Julien Nabet
Details
new bt after applying a naive patch (12.14 KB, text/plain)
2015-12-29 12:54 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2015-12-29 12:38:16 UTC
Created attachment 121606 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated yesterday, I got a crash when doing:
1) Retrieve an example wpd file at https://bugs.documentfoundation.org/attachment.cgi?id=73516
2) Open the wpd file (it'll launch Writer)
3) Go on page and click on the first image
4) Ctrl-C
=> Crash
Comment 1 Julien Nabet 2015-12-29 12:40:46 UTC
I noticed the assert has been added with http://cgit.freedesktop.org/libreoffice/core/commit/?id=e4a06fc983fd6a94a6138503c3fc94b567bc3a68
But I don't think it's the root cause.
Comment 2 Julien Nabet 2015-12-29 12:41:25 UTC
I reproduced the crash with LO Debian package 5.0.4.2RC
Comment 3 Julien Nabet 2015-12-29 12:54:15 UTC
Created attachment 121607 [details]
new bt after applying a naive patch

With this patch, I go further but have another bt.
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 127798f..1e68f754 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -701,8 +701,11 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
     // objects without persistence are not really stored by the method
     if (xObj.is() && StoreEmbeddedObject(xObj, rName, true, rSrcShellID, rDestShellID))
     {
-        assert(!rDestShellID.isEmpty() && !rDestShellID.startsWith("0x")); // assume that every shell has a base URL
-        xResult = Get_Impl(rName, xObj, &rDestShellID);
+        if (!rDestShellID.isEmpty())
+        {
+            assert(!rDestShellID.startsWith("0x")); // assume that every shell has a base URL
+            xResult = Get_Impl(rName, xObj, &rDestShellID);
+        }
         if ( !xResult.is() )
         {
             // this is a case when object has no real persistence

assert has been added with http://cgit.freedesktop.org/libreoffice/core/commit/?id=291f55edf3d5c1d443cbd9a06bc6f7fd773884e5
Comment 4 Julien Nabet 2015-12-29 12:56:37 UTC
David: thought you might be interested in this one since it concerns wpd file
Michael: thought you might be interested in this one since you added the assert statements quoted in my previous comments.
Comment 5 Michael Stahl (allotropia) 2016-02-19 22:13:13 UTC

*** This bug has been marked as a duplicate of bug 97108 ***