Page 1 of 1

Convert crash on sparc

Posted: 2008-12-11T07:04:51-07:00
by naoliv
Hi!

From http://bugs.debian.org/508443, convert is crashing when being used in sparc, with this file: http://people.debian.org/~naoliv/misc/i ... k/djvu.svg

Running it with debug, I can see:

Code: Select all

/usr/bin/convert -debug All -geometry 22x22 -depth 8 -background none djvu.svg hi22-djvu.png
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: utility.c/unknown/809/Configure
  Command line: /usr/bin/convert {-debug} {All} {-geometry} {22x22} {-depth} {8} {-background} {none} {djvu.svg} {hi22-djvu.png}
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.3.7/config/colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/config/colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6.3.7/colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/home/naoliv/.magick/colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "colors.xml"
2008-12-11T14:00:13+00:00 0:01 0.000u 6.3.7 Configure convert[3696]: color.c/unknown/2692/Configure
  Loading color map "/usr/lib/ImageMagick-6.3.7/config/colors.xml" ...
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.3.7/config/coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/config/coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6.3.7/coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/home/naoliv/.magick/coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "coder.xml"
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Exception convert[3696]: configure.c/unknown/507/Exception
  unable to access configure file `coder.xml'
2008-12-11T14:00:13+00:00 0:01 0.120u 6.3.7 Configure convert[3696]: coder.c/unknown/630/Configure
  Loading coder map "built-in" ...
2008-12-11T14:00:13+00:00 0:01 0.130u 6.3.7 Module convert[3696]: module.c/unknown/1074/Module
  Searching for module "SVG" using filename "svg.la"
2008-12-11T14:00:13+00:00 0:01 0.130u 6.3.7 Module convert[3696]: module.c/unknown/479/Module
  Searching for coder module file "svg.la" ...
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Module convert[3696]: module.c/unknown/1094/Module
  Opening module at path "/usr/lib/ImageMagick-6.3.7/modules-Q16/coders/svg.la"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Module convert[3696]: module.c/unknown/1128/Module
  Method "RegisterSVGImage" in module "SVG" at address 0xf753fa6c
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Module convert[3696]: module.c/unknown/1143/Module
  Method "UnregisterSVGImage" in module "SVG" at address 0xf753fa20
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Blob convert[3696]: blob.c/unknown/2324/Blob
    read 4096 magic header bytes
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Cache convert[3696]: cache.c/unknown/2162/Cache
  destroy 
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.3.7/config/magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/config/magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6.3.7/magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.3.7/magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "/home/naoliv/.magick/magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Configure convert[3696]: configure.c/unknown/482/Configure
  Searching for configure file: "magic.xml"
2008-12-11T14:00:13+00:00 0:01 0.150u 6.3.7 Exception convert[3696]: configure.c/unknown/507/Exception
  unable to access configure file `magic.xml'
2008-12-11T14:00:13+00:00 0:01 0.160u 6.3.7 Exception convert[3696]: magic.c/unknown/870/Exception
  unable to access configure file `'
2008-12-11T14:00:13+00:00 0:01 0.160u 6.3.7 Configure convert[3696]: magic.c/unknown/678/Configure
  Loading magic map "built-in" ...
2008-12-11T14:00:13+00:00 0:01 0.170u 6.3.7 Blob convert[3696]: blob.c/unknown/2324/Blob
    read 4096 magic header bytes
And then it stays at 100% of the CPU, with a memory usage increase.
It works OK on other machines that I have tested.

Version is 6.3.7-9. Can I do something else to try do debug this, please?

Thank you!

Re: Convert crash on sparc

Posted: 2008-12-11T11:02:23-07:00
by naoliv
Hi again!

It seems that anything related with this SVG file fails.
I can't use identify, convert, mogrify, etc, but only on the sparc machine (it works on i386, for example).

With another SVG file (ImageMagick's www/source/piechart.svg, for example) and on the same machine (sparc), everything works normally.

The problematic SVG file fails (http://people.debian.org/~naoliv/misc/i ... report.txt) to validate using http://jiggles.w3.org/svgvalidator/ (while the other SVG files pass it).

You can get a strace here: http://people.debian.org/~naoliv/misc/i ... strace.out (note that it starts to use more and more memory, until it gets killed).

When it fails, it gives this message:

Code: Select all

GLib-ERROR **: /build/buildd/glib2.0-2.16.6/glib/gmem.c:175: failed to allocate 3758096384 bytes
aborting...
Can it be related with glib2.0?

Unfortunately I can't get imagemagick compiled with debug symbols on this test machine:

Code: Select all

$ gdb convert core
(...)
Core was generated by `/usr/bin/convert -geometry 22x22 -depth 8 -background none djvu.svg hi22-djvu.p'.
Program terminated with signal 6, Aborted.
[New process 29421]
#0  0xf79eb7ac in raise () from /lib/libc.so.6
(gdb) bt full
#0  0xf79eb7ac in raise () from /lib/libc.so.6
No symbol table info available.
#1  0xf7daac80 in ?? () from /usr/lib/libMagick.so.10
No symbol table info available.
#2  0xf7daac80 in ?? () from /usr/lib/libMagick.so.10
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit

Re: Convert crash on sparc

Posted: 2008-12-11T11:22:07-07:00
by naoliv
Opened the problematic SVG file and saved it, without any modification (you can get it here: http://people.debian.org/~naoliv/misc/i ... /djvu2.svg). Now it validates but ImageMagick still can't handle it.

Re: Convert crash on sparc

Posted: 2008-12-11T21:49:05-07:00
by magick
It appears ImageMagick is in a loop requesting memory until it runs out. Post the output of this command:

identify -list configure

You can also add -debug all,trace to see if we can narrow down where the loop occurs. Otherwise we would need a proper stack trace before we can determine where the problem occurs within ImageMagick.

If you have bound to the librsvg delegate library, it is possible the problem is within that library. We cannot be sure without a stack trace.

Re: Convert crash on sparc

Posted: 2008-12-16T05:47:35-07:00
by naoliv
Hi!

identify -list configure:
http://people.debian.org/~naoliv/misc/i ... figure.txt

-debug all,trace:
http://people.debian.org/~naoliv/misc/i ... _trace.txt

gdb backtrace:
http://people.debian.org/~naoliv/misc/i ... t_full.txt

Is running "rsvg djvu.svg output.png" a good way (or at least, does it help in some way) to test if the problem is related with librsvg?

Thank you!

Re: Convert crash on sparc

Posted: 2008-12-16T10:18:40-07:00
by magick
The exception is thrown inside the rsvg delegate library so it could very well be a rsvg problem. Try ImageMagick 6.4.7-8, the latest release and see if the problem still occurs. We're using RSVG 2.22.3 and ImageMagick 6.4.7-8 and your SVG file converts without complaint.

[solved] Convert crash on sparc

Posted: 2008-12-23T13:32:59-07:00
by broucaries
It is a libsrvg problem corrected upstream. Very strange because crash or continue without error depending of arch