Forum Bugs

[BUG] Special characters crash linux version

olmo
When having � in the text, prince will crash:
I fixed this by removing it. Just wanted to report this to maybe get readable good error?
*** glibc detected *** /var/www/prince/install/lib/prince/bin/prince: free(): invalid pointer: 0x0000000003d5f000 ***
======= Backtrace: =========
[0xe6a782]
[0xe70cee]
[0x88b665]
[0x88c88e]
[0x46bd27]
[0xdf0648]
[0xe0b914]
[0x400656]
[0xe4618e]
[0x400369]
======= Memory map: ========
00400000-01308000 r-xp 00000000 09:02 98598                              /var/www/prince/install/lib/prince/bin/prince
01507000-01542000 rw-p 00f07000 09:02 98598                              /var/www/prince/install/lib/prince/bin/prince
01542000-03c29000 rw-p 01542000 00:00 0
03c29000-03c32000 r--p 03c29000 00:00 0
03c32000-03c39000 rw-p 03c32000 00:00 0
03c39000-03c3a000 r--p 03c39000 00:00 0
03c3a000-03cb3000 rw-p 03c3a000 00:00 0
03cb3000-03cbc000 r--p 03cb3000 00:00 0
03cbc000-03cc3000 rw-p 03cbc000 00:00 0
03cc3000-03cc4000 r--p 03cc3000 00:00 0
03cc4000-04857000 rw-p 03cc4000 00:00 0
7f5ffc000000-7f5ffc021000 rw-p 7f5ffc000000 00:00 0
7f5ffc021000-7f6000000000 ---p 7f5ffc021000 00:00 0
7f6002400000-7f600253c000 rw-p 7f6002400000 00:00 0
7f600253c000-7f6002558000 r-xp 00000000 09:02 17768468                   /lib/ld-2.7.so
7f6002558000-7f6002757000 ---p 0001c000 09:02 17768468                   /lib/ld-2.7.so
7f6002757000-7f6002759000 rw-p 0001b000 09:02 17768468                   /lib/ld-2.7.so
7f6002759000-7f60028a3000 r-xp 00000000 09:02 17768461                   /lib/libc-2.7.so
7f60028a3000-7f6002aa2000 ---p 0014a000 09:02 17768461                   /lib/libc-2.7.so
7f6002aa2000-7f6002aa5000 r--p 00149000 09:02 17768461                   /lib/libc-2.7.so
7f6002aa5000-7f6002aa7000 rw-p 0014c000 09:02 17768461                   /lib/libc-2.7.so
7f6002aa7000-7f6002aac000 rw-p 7f6002aa7000 00:00 0
7f6002aac000-7f6002ab6000 r-xp 00000000 09:02 17768469                   /lib/libnss_files-2.7.so
7f6002ab6000-7f6002cb6000 ---p 0000a000 09:02 17768469                   /lib/libnss_files-2.7.so
7f6002cb6000-7f6002cb8000 rw-p 0000a000 09:02 17768469                   /lib/libnss_files-2.7.so
7f6002cc2000-7f6002ccb000 r--s 00000000 09:02 951329                     /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-le64.cache-3
7f6002ccb000-7f6002ccd000 r--s 00000000 09:02 951328                     /var/cache/fontconfig/fd9505950c048a77dc4b710eb6a628ed-le64.cache-3
7f6002ccd000-7f6002cd1000 r--s 00000000 09:02 951327                     /var/cache/fontconfig/ddc79d3ea06a7c6ffa86ede85f3bb5df-le64.cache-3
7f6002cd1000-7f6002cd2000 r--s 00000000 09:02 951326                     /var/cache/fontconfig/e7071f4a29fa870f4323321c154eba04-le64.cache-3
7f6002cd2000-7f6002cd4000 r--s 00000000 09:02 951325                     /var/cache/fontconfig/a2ab74764b07279e7c36ddb1d302cf26-le64.cache-3
7f6002cd4000-7f6002cd7000 r--s 00000000 09:02 951324                     /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-le64.cache-3
7f6002cd7000-7f6002cda000 r--s 00000000 09:02 951323                     /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-le64.cache-3
7f6002cda000-7f6002cdd000 r--s 00000000 09:02 951322                     /var/cache/fontconfig/20bd79ad97094406f7d1b9654bfbd926-le64.cache-3
7f6002cdd000-7f6002ce1000 r--s 00000000 09:02 951321                     /var/cache/fontconfig/9c0624108b9a2ae8552f664125be8356-le64.cache-3
7f6002ce1000-7f6002cea000 r--s 00000000 09:02 951320                     /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-le64.cache-3
7f6002cea000-7f6002ced000 r--s 00000000 09:02 951319                     /var/cache/fontconfig/da1bd5ca8443ffe22927a23ce431d198-le64.cache-3
7f6002ced000-7f6002cef000 r--s 00000000 09:02 951318                     /var/cache/fontconfig/ddd4086aec35a5275babba44bb759c3c-le64.cache-3
7f6002cef000-7f6002cf2000 r--s 00000000 09:02 951317                     /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-le64.cache-3
7f6002cf2000-7f6002cf6000 r--s 00000000 09:02 951316                     /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-le64.cache-3
7f6002cf6000-7f6002d00000 r--s 00000000 09:02 951315                     /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-le64.cache-3
7f6002d00000-7f6002d09000 r--s 00000000 09:02 951312                     /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-3
7f6002d09000-7f6002d10000 r--s 00000000 09:02 951310                     /var/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-3
7f6002d10000-7f6002d12000 rw-p 7f6002d10000 00:00 0
7ffffffe9000-7fffffffe000 rw-p 7ffffffea000 00:00 0                      [stack]
7fffffffe000-7ffffffff000 r-xp 7fffffffe000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
mikeday
Yikes! Can you attach a short sample document that reproduces this problem?
olmo
The PHP behind the page:
<?php echo html_entity_decode($theText); ?>


The HTML source:
<p> Zo is daar de Allg�u.. </p>


In the database:
<p> Zo is daar de Allgäu..</p>


I can't really send you a HTML sample document, as it only happens when I get the text from our database. when saving the HTML document that generates the error, it will render just fine.
I tried making the same HTML file exactly as the database printed text(only not from the database) and it worked.. But when I get the text from the database it breaks.

I thought maybe its because of the database encoding? its "latin1"

Note: I fixed it by removing html_entity_decode() function, as it should not have been called in the first place..

Edited by olmo

mikeday
How are you running Prince, from PHP? Are you calling the convert_string() method? Are you running on MacOS X? Is there a <meta charset...> in the document head?
mikeday
Actually I have been able to reproduce this issue myself now, so we should be able to track it down and fix it.
mikeday
We have now released Prince 9 rev 2, which fixes this issue affecting invalid bytes in UTF-8 documents.