Page 1 of 1

Bug on s390 arch on debian with svg conversion.

Posted: 2012-07-23T12:43:55-07:00
by broucaries
Dear imagemagick upstream,

We have a strange bug on s390 and one of your user is nice and able to do some debugging on this strange arch.

For now, it seems that rsvg is working fine, and I am clueless to pinpoint the cause of corruption.

Could you please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670661 and direclty mail to pino with copy to 670661@bugs.debian.org

Thank you very much.

Bastien

PS: it so rare to find a user willing to help on this kind of arch ;)

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-07-23T13:04:39-07:00
by magick
Unfortunately we do not have access to a s390 host and without access we have little hope of resolving this problem. The SVG coder utilizes the librsvg delegate library and renders either with Cairo or a GDK PIXBUF. Possible root causes could be a bug in ImageMagick, the compiler, librsvg, Cairo, or the GDK PIXBUF.

Have you seen this problem on any other architecture? Perhaps one we have access to?

We did try the conversion with the latest ImageMagick release under Fedora, CentOS 5.8, Windows 7, and Mac OS X and the rendering was proper.

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-08-01T07:34:35-07:00
by gdelcampo
The only tested archs are amd64 and s390. No other ones.
I think it is possible to reproduce the environment with hercules. I can try and show you the steps.

Rino

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-08-01T15:06:55-07:00
by magick
We tried the steps from http://josefsipek.net/docs/s390-linux/h ... -s390.html and it failed consistently with a bad archive for both stable and unstable.

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-09-23T08:40:29-07:00
by broucaries
Ok we have done for you the difficult stuff, from original reporter:

Hi all,
I'm very very sorry I kept you waiting. In the last time I have been very busy at work. My apologies!

Well, I reproduce the test environment with hercules emulator. You can download (from this link: http://brain-debug.org/zdebian.tar.xz) everything necessary in order to start the debian-s390x (AKA zdebian) instance.

In the package (xz compressed) you will find the following directories:
|---zlinux
|---dasd/
|---prt/
|---rdr/
|---hercules.cnf


- `dasd/`: it contains the dasd (virtual disk) file `3390.DEBIAN.0100`
- `prt`: the printer device
- `rdr`: the reader device (useful in installation process)
- `hercules.cnf`: emulator configuration file

After extracting the above files, you can start the vm with the following command:
$ sudo hercules -f zlinux/hercules.cnf

at hercules prompt, you have to type:
Command ==> ipl 0100
(wait until the debian login prompt)

At this point, you can connect to vm through a tun device on the real-box which will be connected to a ctc (channel-to-channel) device within emulator.

In my configuration:
- the tun0 device has 10.1.1.1 IP
- the ctc0 device has 10.1.1.2 IP

Then, from your real-box you can connect using ssh client:
$ ssh -l root 10.1.1.2

On debian system, I have already installed `imagemagick` and `librsvg2-bin` packages. Furthermore, I have already copied the img0.svg file in the root directory. Also, you will find generated png files from `convert` and `rsvg-convert` tools.

Eventually, If you want to allow network communication from zdebian machine to external net you have to type the following commands on real-box machine:
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo sysctl -w net.ipv4.conf.all.proxy_arp=1
$ sudo iptables -t nat -A POSTROUTING -o eth0 -s 10.1.1.0/24 ! -d 10.1.1.0/24 -j MASQUERADE

(Note: The configuration assumes the default iptables policy is ACCEPT)

I hope this helps. Please, let me know.

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-09-23T10:23:30-07:00
by magick
What is the root password?
  • ssh -l root 10.1.1.2
    root@10.1.1.2's password:
    Permission denied, please try again.

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-09-24T06:21:35-07:00
by broucaries
According to rhino

What an airhead! root-pwd is: passw0rd

An errata corrige:


After extracting the above files, you can start the vm with the following

command:
$ cd zlinux
$ sudo hercules -f hercules.cnf
at hercules prompt, you have to type: Command ==> ipl 0100 (wait until the debian login prompt)

Re: Bug on s390 arch on debian with svg conversion.

Posted: 2012-09-27T17:52:01-07:00
by magick
Type 'convert -list format'. Is RSVG associated with the SVG tag? If not, add --with-rsvg to the configure command line when you build ImageMagick.

We downloaded ImageMagick-6.6.0-10.tar.gz to the s390 emulator and installed RSVG and RSVG development packages. We built and installed ImageMagick and it rendered img0.svg properly. If that fails, edit magick/magick-config.h and comment out the MAGICKCORE_CAIRO_DELEGATE define. Now rebuild and reinstall. Does that produce a proper rendering? Recent versions of ImageMagick utilize the PANGO renderer and may return superior results.

If all else fails, you can delete the svg.so module and ImageMagick will revert to the rsvg delegate program and return proper results.

Note, the SVG code has changed very little over the last several years and it primarily relies on delegate libraries such as RSVG, Pango, and Cairo. The img0.svg image renders for us on all the systems we tried, CentOS, Redhat, Fedora, and Mac. It seems likely that the problem may be the CAIRO rendering specifically on the s390. When we commented out the MAGICKCORE_CAIRO_DELEGATE, the image rendered properly. If MAGICKCORE_CAIRO_DELEGATE is not defined, ImageMagick reverts to direct GDK rendering.

We would have more detailed results but we got a bit frustrated with the s390 emulator. It took more than 30 minutes each time we made a change and attempted to rebuild and reinstall ImageMagick. Its just a few minutes on our 6 core physical machine.