After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 712330 - crash when opening png file: gmem.c:110: failed to allocate 4096 bytes
crash when opening png file: gmem.c:110: failed to allocate 4096 bytes
Status: RESOLVED DUPLICATE of bug 719619
Product: GIMP
Classification: Other
Component: General
2.8.8
Other Linux
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2013-11-14 19:27 UTC by Mikko Tiihonen
Modified: 2013-12-30 21:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Backtrace of crash (27.93 KB, text/plain)
2013-11-14 19:27 UTC, Mikko Tiihonen
Details

Description Mikko Tiihonen 2013-11-14 19:27:05 UTC
Created attachment 259837 [details]
Backtrace of crash

GNU Image Manipulation Program version 2.8.8
git-describe: GIMP_2_8_6-115-g76dd14f

using GEGL version 0.2.0 (compiled against version 0.2.0)
using GLib version 2.38.1 (compiled against version 2.38.1)
using GdkPixbuf version 2.30.0 (compiled against version 2.30.0)
using GTK+ version 2.24.22 (compiled against version 2.24.22)
using Pango version 1.36.0 (compiled against version 1.36.0)
using Fontconfig version 2.11.0 (compiled against version 2.11.0)
using Cairo version 1.13.1 (compiled against version 1.13.1)

Fedora package: gimp-2.8.8-3.fc20.x86_64

The crash occurs when I run the following command:
% gimp pirkko1.png
The crash happens immediately after the loading bar hits 100%

Image information:
pirkko1.png: PNG image data, 10196 x 14024, 8-bit/color RGB, non-interlaced, 148M, just scanned using gnome simple scan

gthumb can open the picture correctly
Comment 1 Michael Natterer 2013-11-14 19:43:02 UTC
That image allocates more than 1 Gig of tiles, how large is your tile
cache setting? Check preferences.
Comment 2 Michael Natterer 2013-11-14 19:57:37 UTC
Such a large image works fine here btw with a tile cache size of
2 Gig and 12 Gig of physical memory.
Comment 3 Mikko Tiihonen 2013-11-14 20:08:53 UTC
I have tile cache size of 7 Gig and 16 Gig of physical memory.
Comment 4 Michael Natterer 2013-11-14 20:12:40 UTC
You must be on a 64 bit system then. I can't reproduce that crash at all.
Does it happen with all images of similar size or only with that one?
Comment 5 Mikko Tiihonen 2013-11-14 20:28:10 UTC
In the last hour I have scanned 4 large images (same dimensions, ~ same size). They all crash the same way.

Yes. I'm running a 64bit system.

Fedora bug reporter automatically reported also a fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1030624 with more automatically analyzed results as attachments.
Comment 6 Nils Philippsen 2013-11-15 16:16:29 UTC
Hmm:

Thread 1 (Thread 0x7f0472f7d9c0 (LWP 1840))

  • #0 g_logv
    at gmessages.c line 989

--> This (failing to allocate 4kB) makes it seem as if the GIMP process has completely exhausted the amount of memory the OS is willing to give it. Are there system limits on how much memory a user process is allowed to have ("ulimit -m")? If not, it seems as if you've simply run out of available memory (RAM + Swap).
Comment 7 Nils Philippsen 2013-11-15 16:18:38 UTC
NB: This is the relevant line of the backtrace which Bugzilla hid so obligingly:

msg = 0x7f0476dccbe0 "gmem.c:110: failed to allocate 4096 bytes"
Comment 8 Duncan Grisby 2013-12-29 22:50:41 UTC
I have recently been hitting this on 64 bit Fedora 19, since a recent round of package updates. I never had a problem before.

Running gimp with strace shows that it fails to do an mmap system call;

...
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe1fad55000
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe1fad51000
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe1fad4d000
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)

and further digging shows that it's not out of memory, it is out of maps. I increased sysctl vm.max_map_count from 65530 to 131072, and the problem has gone away. Looking at /proc/<pid>/maps in the now-working gimp process, I see 70054 maps, which confirms that it has used more than the previous limit.

It looks as though something has changed in the way memory is mapped.
Comment 9 Michael Schumacher 2013-12-30 12:37:28 UTC
Is this bug 719619? This one involves the 3.12 Linux kernel.
Comment 10 Duncan Grisby 2013-12-30 14:20:03 UTC
Yes, it is something to do with the 3.12 Linux kernel. I can confirm that reverting to 3.11 makes the problem I'm seeing go away. With 3.12, a particular sequence of gimp operations (with a 36 megapixel image) results in 70054 entries in /proc/<pid>/maps, while the same set of steps with kernel 3.11 only has 1177 maps entries.
Comment 11 Michael Schumacher 2013-12-30 21:12:07 UTC
I'm resolving this bug as a duplicate of the newer report - because that one has the 3.12 kernel in focus from the start.

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