Forum Bugs

glibc error when converting html to PDF

thecowster
The page at http://gateway.mdgms.com is converted fine by Prince 6, but Prince 9 gets the following error from glibc:

child killed: SIGABRT
*** glibc detected *** /usr/local/prince-9.0r2/lib/prince/bin/prince: munmap_chunk(): invalid pointer: 0x000000000105947f ***
======= Backtrace: =========
[0xe910e2]
[0x46bc6f]
[0xe16c88]
[0xe31f54]
[0x400656]
[0xe6c7ce]
[0x400369]
======= Memory map: ========
00400000-0133a000 r-xp 00000000 08:02 788549                             /usr/local/prince-9.0r2/lib/prince/bin/prince
01539000-01575000 rw-p 00f39000 08:02 788549                             /usr/local/prince-9.0r2/lib/prince/bin/prince
01575000-03c5c000 rw-p 01575000 00:00 0 
03c5c000-03c65000 r--p 03c5c000 00:00 0 
03c65000-03c6c000 rw-p 03c65000 00:00 0 
03c6c000-03c6d000 r--p 03c6c000 00:00 0 
03c6d000-03ce6000 rw-p 03c6d000 00:00 0 
03ce6000-03cef000 r--p 03ce6000 00:00 0 
03cef000-03cf6000 rw-p 03cef000 00:00 0 
03cf6000-03cf7000 r--p 03cf6000 00:00 0 
03cf7000-03d50000 rw-p 03cf7000 00:00 0 
2b3b3c84f000-2b3b3c851000 rw-p 2b3b3c84f000 00:00 0 
2b3b3c851000-2b3b3c86a000 r--s 00000000 08:04 167859000                  /home/fts/.fontconfig/73a61b34dd8ca4d8a159807604ab432f-le64.cache-3
2b3b3c86a000-2b3b3c86e000 r--s 00000000 08:04 167859001                  /home/fts/.fontconfig/f4023520196b2bc2c439adcafb2470ff-le64.cache-3
2b3b3c86e000-2b3b3c872000 r--s 00000000 08:04 167859002                  /home/fts/.fontconfig/177aa5f8e4784b879645141d1d73ae7a-le64.cache-3
2b3b3c872000-2b3b3c877000 r--s 00000000 08:04 167859003                  /home/fts/.fontconfig/a3ef620b97f3ad86e0ccce6d4afaa4cc-le64.cache-3
2b3b3c877000-2b3b3c879000 r--s 00000000 08:04 167859004                  /home/fts/.fontconfig/49aab29dc58e529ef78a6d0aaa3ba41d-le64.cache-3
2b3b3c879000-2b3b3c882000 r--s 00000000 08:04 167859005                  /home/fts/.fontconfig/b79f3aaa7d385a141ab53ec885cc22a8-le64.cache-3
2b3b3c88b000-2b3b3c895000 r-xp 00000000 08:02 393243                     /lib64/libnss_files-2.6.so
2b3b3c895000-2b3b3ca94000 ---p 0000a000 08:02 393243                     /lib64/libnss_files-2.6.so
2b3b3ca94000-2b3b3ca95000 r--p 00009000 08:02 393243                     /lib64/libnss_files-2.6.so
2b3b3ca95000-2b3b3ca96000 rw-p 0000a000 08:02 393243                     /lib64/libnss_files-2.6.so
2b3b3ca96000-2b3b3cbdd000 r-xp 00000000 08:02 393227                     /lib64/libc-2.6.so
2b3b3cbdd000-2b3b3cddd000 ---p 00147000 08:02 393227                     /lib64/libc-2.6.so
2b3b3cddd000-2b3b3cde1000 r--p 00147000 08:02 393227                     /lib64/libc-2.6.so
2b3b3cde1000-2b3b3cde2000 rw-p 0014b000 08:02 393227                     /lib64/libc-2.6.so
2b3b3cde2000-2b3b3cde7000 rw-p 2b3b3cde2000 00:00 0 
2b3b3cde7000-2b3b3ce01000 r-xp 00000000 08:02 393219                     /lib64/ld-2.6.so
2b3b3ce01000-2b3b3d001000 ---p 0001a000 08:02 393219                     /lib64/ld-2.6.so
2b3b3d001000-2b3b3d002000 r--p 0001a000 08:02 393219                     /lib64/ld-2.6.so
2b3b3d002000-2b3b3d003000 rw-p 0001b000 08:02 393219                     /lib64/ld-2.6.so
2b3b3d003000-2b3b3d103000 rw-p 2b3b3d003000 00:00 0 
2b3b3d103000-2b3b3d10a000 r--s 00000000 08:02 557314                     /usr/lib/gconv/gconv-modules.cache
2b3b3d10c000-2b3b3d110000 r-xp 00000000 08:02 393241                     /lib64/libnss_dns-2.6.so
2b3b3d110000-2b3b3d30f000 ---p 00004000 08:02 393241                     /lib64/libnss_dns-2.6.so
2b3b3d30f000-2b3b3d310000 r--p 00003000 08:02 393241                     /lib64/libnss_dns-2.6.so
2b3b3d310000-2b3b3d311000 rw-p 00004000 08:02 393241                     /lib64/libnss_dns-2.6.so
2b3b3d311000-2b3b3d322000 r-xp 00000000 08:02 393253                     /lib64/libresolv-2.6.so
2b3b3d322000-2b3b3d522000 ---p 00011000 08:02 393253                     /lib64/libresolv-2.6.so
2b3b3d522000-2b3b3d523000 r--p 00011000 08:02 393253                     /lib64/libresolv-2.6.so
2b3b3d523000-2b3b3d524000 rw-p 00012000 08:02 393253                     /lib64/libresolv-2.6.so
2b3b3d524000-2b3b3d564000 rw-p 2b3b3d524000 00:00 0 
7fff6e245000-7fff6e25b000 rw-p 7fff6e245000 00:00 0                      [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vdso]


I saw the forum topic at http://www.princexml.com/forum/topic/2374/need-help-encounter-glibc-error-when-i-convert-smaller-files, but the error reported there appears to be quite distinct to what I'm seeing above. Therefore rather than mix two issues in the same thread I created a new post for this topic. (I hope I did the right thing!)

I should perhaps mention that the page at http://gateway.mdgms.com is not intended as a source for PDFs, it was rather just an arbitrarily chosen existing page that I used to test our Prince 9 installation was working.

Thanks

Edited by thecowster

mikeday
Are there any issues converting a small test document stored as a local file? eg.
<html><body>Hello!</body></html>

Do you get the same error if you use the old HTML parser, with "-i html4" on the command-line? Also, can you rerun with --debug and post the output log?
thecowster
Are there any issues converting a small test document stored as a local file?


No. Most html documents work fine, even much larger pages. This error is certainly not a common occurrence.

Do you get the same error if you use the old HTML parser, with "-i html4"


No, with -ihtml4 the pdf is generated just fine.

rerun with --debug and post the output log


See below. (Also, I have some ~40MB core dumps in case they interest you)

prince: debug: loading license: /usr/local/prince-9.0r2/lib/prince/license/license.dat
prince: loading style sheet: /usr/local/prince-9.0r2/lib/prince/style/fonts.css
prince: debug: loaded resource: /usr/local/prince-9.0r2/lib/prince/style/fonts.css
prince: debug: loaded resource: type: no
prince: Loading document...
prince: loading document: http://gateway.mdgms.com/
prince: debug: loaded resource: http://gateway.mdgms.com/login.html
prince: debug: loaded resource: type: yes(resource_type("text/html", [], html, no))
prince: loading HTML5 input: http://gateway.mdgms.com/
prince: loading document: http://gateway.mdgms.com/
prince: debug: loaded resource: http://gateway.mdgms.com/login.html
prince: debug: loaded resource: type: yes(resource_type("text/html", [], html, no))

*** Mercury runtime: caught segmentation violation ***
cause: address not mapped to object
address involved: (nil)
This may have been caused by a stack overflow, due to unbounded recursion.
exiting from signal handler
Segmentation fault (core dumped)

Edited by thecowster

mikeday
Are you running the latest Prince 9 release? There was an issue with character encoding that was fixed in Prince 9 rev 2.

Also, which platform and Linux distribution are you running? This seems very similar to the nested <a> issue (which we are just preparing to release a fix for), however I can't seem to reproduce the problem here on 64-bit Ubuntu 12.04, or CentOS 5.
thecowster
Are you running the latest Prince 9 release?


We're running prince 9.0 rev 2:

[fts@princexml1.test pdfgen]$ prince-9 --version
Prince 9.0 rev 2
Copyright 2002-2013 YesLogic Pty. Ltd.
Server License


Also, which platform and Linux distribution are you running?


This occurs on our development system, which is running Fedora release 7 (Moonshine). I just noticed that this does not occur on our production systems, which are running CentOS release 5.2 (Final). Both are 64 bit machines.

[fts@princexml1.test pdfgen]$ uname -a
Linux princexml1.test 2.6.20.16-IS-oprofile #1 SMP Wed Aug 22 12:05:00 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
[fts@princexml1.test pdfgen]$ cat /etc/redhat-release
Fedora release 7 (Moonshine)




Edited by thecowster

mikeday
Hmm, Prince doesn't have install packages for Fedora release 7, and release 7 is not supported by Fedora any more so it doesn't get updated packages or security fixes. So if there is a library compatibility issue affecting HTTP downloads, it will be awkward to work around. I don't suppose it is totally out of the question to suggest upgrading the development machine? :)
thecowster
Thanks again for the super-fast feedback. All is clear now! :-)

We'll handle this topic internally now.