Out of memory crash while importing large pdf

Bug #367779 reported by craigleat
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Medium
Ujjwala Potluri

Bug Description

Running Inkscape r21233 (self compiled) on Ubuntu 7.10
gc 6.8
cairo 1.8.6
poppler 0.10.6
glib 2.20.1

App crashes while importing a PDF with a large bitmap. PDF is 110Mb.

I watched the memory usage during the import and inkscape gobbles up nearly 2Gb of RAM.

I could put the PDF on a ftp server. Let me know if there is anyone interested in testing.

BTW
$ ulimit -d
unlimited

Back trace is attached.

Revision history for this message
craigleat (craig-leat) wrote :
Revision history for this message
theAdib (theadib) wrote :

Please could you provide the svg and the image that crashes inkscape?

tags: added: cairo crash exporting pdf
Changed in inkscape:
importance: Undecided → High
milestone: none → 0.47
status: New → Triaged
tags: added: import poppler
removed: cairo exporting
summary: - Out of memory crash
+ Out of memory crash while importing large pdf
Revision history for this message
theAdib (theadib) wrote :

Sorry, I mean the pdf that crashes while importing. If you can not push to Launchpad, do you have a ftp service?

Revision history for this message
craigleat (craig-leat) wrote :

To reproduce the crash do the following:

1. Start a new drawing
2. Set document properties to A2 landscape
3. Import the attached file: A2 Test map.pdf
4. Leave PDF import settings at the default values and click OK
5. Wait several minutes and Inkscape crashes

Revision history for this message
craigleat (craig-leat) wrote :

I have attached another smaller PDF map generated by a different app (Ghostscript). Opening the PDF crashes Inkscape, this time with a polite dialog stating that Inkscape has suffered an internal error. The terminal output seems the same: "GC Warning: Out of memory!"

Revision history for this message
craigleat (craig-leat) wrote :

I finally managed to create a PDF that Inkscape will open by removing entities from the original map. I also managed to save the PDF as an Inkscape SVG. However, Inkscape still crashes while working with this SVG.

Terminal output:
$ ./inkscape

** (inkscape:6627): WARNING **: GC Warning: Repeated allocation of very large block (appr. size 16384):
        May lead to memory leak and poor performance.

** (inkscape:6627): WARNING **: GC Warning: Repeated allocation of very large block (appr. size 16384):
        May lead to memory leak and poor performance.

** (inkscape:6627): WARNING **: GC Warning: Repeated allocation of very large block (appr. size 16384):
        May lead to memory leak and poor performance.

** (inkscape:6627): WARNING **: GC Warning: Out of Memory! Returning NIL!

terminate called after throwing an instance of 'std::bad_alloc'
  what(): std::bad_alloc

Emergency save activated!

Emergency save document locations:
  /tmp/inkscape-
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
Aborted (core dumped)

tags: added: importing
removed: import
su_v (suv-lp)
tags: added: performance
ScislaC (scislac)
Changed in inkscape:
milestone: 0.47 → none
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on WIndows XP, Inkscape 0.48.2 and trunk revision 10923.

Revision history for this message
Steven (t-mail-p) wrote :

This svg crashes Inkscape 0.48.4 r9939

Win7 64bit
4gig ram

Revision history for this message
Frank Niemann (3-info-p) wrote :

Bug still around on Inkscape 0.48.4 running on Windows 7 (64 bit).

This 3MB file crashes:
http://www.quickborn.de/quickborn_media/Dokumente/Rathaus/Wahlen/Kommunalwahl+2013/Wahlbezirke+Quickborn+(Gesamt%C3%BCbersicht).pdf

File size, though, can't be the main issue, as this 7 MB file is imported without problems (though it takes a little while):

http://www.luebeck.de/stadt_politik/rathaus/wahlen/bundestagswahl13/files/lubeca2013_bu13_3.pdf

Furthermore, the issue can't be related to multi-page PDF. Importing the map on p.2 from the following 6 MB PDF works without problems

http://www.buchholz.de/downloads/datei/OTAzMDAwNjQ0Oy07L3Vzci9sb2NhbC9odHRwZC92aHRkb2NzL2Ntcy9idWNoaG9sei9tZWRpZW4vZG9rdW1lbnRlL3dhaGxiZXJlaWNoZV9zdGFkdF9idWNoaG9sei5wZGY%3D

The map on p.9 of this 3 MB document, however, lets inkscape crash:

http://midgard.at.schwedler.com/attachment/6a9f29555e952f7a4a8e0f630acd9dd5/0d2d020ff40916b80438b79046cf8787/Wahlkreiseinteilung_mit_Karte.pdf

Finally, a case of an import that does not crash, but is displaying incompletely (background picture missing)
http://www.stadt-stade.info/uploads/wahlen/Wahlbereiche.pdf

Import was always done using standard parameters (precision coarse/ 2.0; replace flow text by standard text, replace PDFfonts, embed pictures).

Changed in inkscape:
assignee: nobody → Ujjwala Potluri (ujjwalapotluri)
Revision history for this message
Victor Westmann (victor.westmann) wrote :

I tried the PDf file (20 MB size, filename "A2 Test Map.zip") on Windows 7 Home Premium (64 bit) with 8 GB RAM and it freezes Inkscape 0.91 64 bit.

Revision history for this message
boussad (picks) wrote :

Its likely to be a memory problem.

Force windows to use all the available RAM memory:

Step1: Go to Start Button and Type "Run"

Step 2: In the Run Box: Type " msconfig ".

Step 3: Go to Boot tab in the System configuration window.

Step 4: Click advanced option and Check the "Maximum memory" Check box.

Step 5: Restart when prompted.
see: https://inro.in/lucky-patcher/ , https://inro.in/9apps/ & https://inro.in/vidmate/

Revision history for this message
Celina cruz (celina27) wrote :

Hi,
You should make sure that the value of the Optimize loading in the Text edit mode for files over option is less than the size of your document.

Changed in inkscape:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.