Download it now!
Bug 64654 - EDITING: PHOTO ALBUM, crash Insert slides a large number of photos
Summary: EDITING: PHOTO ALBUM, crash Insert slides a large number of photos
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: Other Windows (All)
: medium major
Assignee: Armin Le Grand
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-15 23:23 UTC by m.a.riosv
Modified: 2016-09-15 21:51 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
pdf, steps up to crash. (137.75 KB, application/pdf)
2013-05-16 21:10 UTC, m.a.riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m.a.riosv 2013-05-15 23:23:39 UTC
Win7x64Ultimate 4Mb.
Version: 4.1.0.0.alpha1+ Build ID: 35fdbea1a112c0f0bf8ea6e9003cf0e13b9cd88
Standard memory settings: 50 Mb memory, 5,2 object, 20 number of objects.

Inserting photo album slides, no matter the number of photos per slide.

With: 60 jpg images - 102 Mb ->no crash
With: 61 jpg images - 106 Mb ->crash
Comment 1 Joel Madero 2013-05-16 18:42:32 UTC
mariosv - do you mind describing the process to get this crash? Sorry not familiar with photo album so explicit steps will help us triage
Comment 2 Samuel Mehrbrodt (CIB) 2013-05-16 20:14:08 UTC
I reproduced this using Windows 7 64bit when I inserted ~200 Images.
However, on Ubuntu it didn't crash.

@Joel: Just use the Photo Album to insert images (Impress->Insert->Image->Photo Album)
Comment 3 Joel Madero 2013-05-16 20:17:31 UTC
Thanks Samuel - I learn something new about LibreOffice every day
Comment 4 m.a.riosv 2013-05-16 21:10:43 UTC
Created attachment 79440 [details]
pdf, steps up to crash.

New Presentation document.
Menu/Insert/Picture/Photo album.
Add - 61 jpg images.
Insert slides
Crash
Comment 5 Caolán McNamara 2015-02-11 21:14:01 UTC
I imagine this is an Out of Memory, so it would be interesting to get a re-test on e.g. a current windows daily build to see if the various graphic cache re-works have had any effect on this
Comment 6 QA Administrators 2016-02-21 08:35:56 UTC Comment hidden (obsolete)
Comment 7 Armin Le Grand 2016-04-26 15:09:42 UTC
Cannot reproduce using

Version: 5.2.0.0.alpha1+
Build ID: fdc1bd89559ea5efe2b3f6aa45b5158fedaed587
CPU Threads: 8; OS Version: Windows 6.1; UI Render: default; 

Probably solved with the size check for swapped in graphics (0ca0202a0994c0b7c99c366fd5cafd8a655df203). Still, get an endless loop in OLEObjCache which has a timer and seems all the time to check if it should unload someting. Will check if I can reproduce this...
Comment 8 Armin Le Grand 2016-04-26 15:28:24 UTC
Really strange - the office works, but is unresponsive - something consumes 100% of one CPU core...
Comment 9 Armin Le Grand 2016-04-27 10:55:11 UTC
Found out that EditEngines consume the time, their OnlineSpellTimer triggers all the time, never stops. Is a timeout of '1000' intended...? Changed to 10000, solves the problem.
Nonetheless, the app crashes on closing the document (RequestHandler::pGlobal destructor)...
OTOH too many outliners exist, this leads to the trace that currently for each inserted graphic a new DrawModel is created and not destoyed. Found a problem in SdPhotoAlbumDialog::createCaption where a SdrModel is created by using pDoc->AllocModel(), but never freed. Each SdrModel creates 4 SdrOutliners (SdrOutliners: 3 by model, 1 by Sd (mpInternalOutliner)). It is only used to construct a single SfxItemSet to set some attributes at the created CaptionShape. This again will lead to problems since the SfxItemSet/SfxItemPool which is used to hold the items is *not* from the same SdrModel that the SdrObject is in.
I would guess that not 'AllocModel()' was intended, but just getting the SdrModel from the existing document.
Comment 10 Armin Le Grand 2016-04-27 10:59:03 UTC
Error was added by ommit 070141b854c7731aa44ccf6ce446802ad8653697, 'tdf#64573: Add captions to Photo Album'. This bug also explains why the added caption looks so bad. Trying a solution...
Comment 11 Armin Le Grand 2016-04-27 11:01:08 UTC
BTW: Only happens when creating caoption objects is switched on (default). It is questionable why all is done using UNO API, except creation of the SDrCaptionObj's.
Comment 12 Armin Le Grand 2016-04-27 12:11:03 UTC
Okay, when using pDoc as SdrModel no extra SdrModels get created. Still had a crash, since CreatePresObj was used and the object was added to the slide (pSlide->InsertObject). PresObj's are already added at creation, so it was added double and gets deleted double -> crash.
Both problems are due to unlucky design, people programming have to know too much about PresObjs and SdrModels to use the internal tooling. SdrModel::AllocModel() should not exist, maybe a Clone that would make clear what happens. PresObjs should only be fetchable (GetPresObj is there) and are created on demand dependent of PageLayout, even a CreatePresObj(PRESOBJ_TITLE, ...) may return null if a layout is set that allows no PRESOBJ_TITLE. All bad traps...
Comment 13 Armin Le Grand 2016-04-27 13:40:33 UTC
Two errors corrected, patch on gerrit.
Comment 14 Armin Le Grand 2016-04-28 09:21:07 UTC
Need to rebase, conflicted with https://bugs.documentfoundation.org/show_bug.cgi?id=99450 where thankfully someone already found the double Insert...
Comment 15 Commit Notification 2016-04-29 11:18:37 UTC
Armin Le Grand committed a patch related to this issue.
It has been pushed to "master":

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

tdf#64654 create no extra SdrModels, do not insert PresObj

It will be available in 5.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 16 Xisco Faulí 2016-09-15 20:51:32 UTC
Hi,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Regards
Comment 17 m.a.riosv 2016-09-15 21:51:35 UTC
Works fine for me with:
win10x64
Version: 5.2.2.1 (x64)
Build ID: 3c2231d4aa4c68281f28ad35a100c092cff84f5d
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; 
Locale: es-ES (es_ES); Calc: group

No issue inserting more than 200 images at once.