Bug 199871 - pamscale goes berserk
pamscale goes berserk
Product: Fedora
Classification: Fedora
Component: netpbm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2006-07-23 13:46 EDT by Tom Horsley
Modified: 2013-07-02 19:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-22 06:08:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tom Horsley 2006-07-23 13:46:31 EDT
Description of problem:

On i386 platform attempting to scale a 5598x5125 .pnm file with a scale
factor of 8 (reducing it from 600dpi to 72dpi) using the cubic filter
seems to go berserk. Memory goes to 100%, swap goes to 100%, the whole
system becomes nonresponsive.

The x86_64 build of pamscale does not exhibit this problem, but simply
spits out the converted file in short order.

Also the equivalent ImageMagic "convert" command works fine on i386 in
just a few seconds (naturally I changed my script to use convert instead
of pamscale).

Version-Release number of selected component (if applicable):

How reproducible:
Every time I try to scale a big image.

Steps to Reproduce:
1. pamscale -reduce 8 -filter=cubic < infile > outfile
Actual results:

System grinds to a halt with lots of thrashing.

Expected results:

converted file in a second or two.

Additional info:

There are 2gig of physical memory and 8gig of swap on this system, so
consuming everything is pretty impressive.
Comment 1 Jindrich Novy 2006-08-07 07:41:30 EDT
The pnm file you use for downsampling is pgm or ppm?
Comment 2 Tom Horsley 2006-08-07 17:11:23 EDT
Here's the source of the image:

scanimage --mode Gray --depth 8 --resolution 600 -x 217 -y 237 | \
   pamflip -rotate270 > chemlawn.pnm

I forget which is which in pgm versus ppm, but it is whatever the heck
that scanimage call generates (8 bit grayscale).

Possibly relevant, the actual image I used for testing was a scan of a small
piece of paper, so the 217x237 mm image will actually have quite a lot
of white background from the scanner lid (though it seems to have the same
behavior for different scans).
Comment 3 Jindrich Novy 2006-08-12 15:28:01 EDT
Fixed. It was caused by the fact, that pamscale used uninitialized variables for
the output X and Y resolutions of the image and the cubic filter pass then tried
to fill the image up in the invalid bounds what caused wasting of all system
resources. FC5 update is comming soon.
Comment 4 Fedora Update System 2006-08-14 11:59:27 EDT
netpbm-10.34-1.fc5 has been pushed for fc5, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.