whatdoineed2do / imgcat

an image cataloger/preview image extractor - generate html index page for directories of images (jpegs/png/gif or RAWs)
2 stars 0 forks source link

OoM handling with Magick #3

Open whatdoineed2do opened 7 years ago

whatdoineed2do commented 7 years ago

MAGICK_TMPDIR=/some/small/loop/device imgcat ...

if you forget, this will use /tmp - even with 1Gb of free space it can quickly fill up with magick tmp files and then coredump. trap this in ImageThumbGen (one of the _genthumbnail methods) and handle properly

whatdoineed2do commented 7 years ago

https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=32745&p=149961

IM generates an file with a hole (pwrite 1byte to the size required) and then mmap it - but when the tmp disk partition is full there is no check check against this an when accessing the mmap'd area it goes bang with bus error.

Deep within IM caching - no exceptions are thrown by the IM i/f that can be caught.