Bug 199827 - app-text/xpdf-3.02: crash on some files
Bug#: 199827 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: printing@gentoo.org Reported By: e.asphyx@gmail.com
Component: Applications
URL: 
Summary: app-text/xpdf-3.02: crash on some files
Keywords:  
Status Whiteboard: 
Opened: 2007-11-20 21:23 0000
Description:   Opened: 2007-11-20 21:23 0000
Xpdf 3.02 (poppler version) crashes on some files. Maybe, some
fontconfig-related problem (see stack backtrace).

Reproducible: Always

Steps to Reproduce:
1. Try to open, for example,
http://oss.org.cn/up_soft/rsn/NVIDIA_Linux_Advantage.pdf

------- Comment #1 From Eugene Zagidullin 2007-11-20 21:24:34 0000 -------
Created an attachment (id=136543) [details]
Stack backtrace

------- Comment #2 From Eugene Zagidullin 2007-11-20 21:24:54 0000 -------
Created an attachment (id=136545) [details]
emerge --info

------- Comment #3 From Eugene Zagidullin 2007-11-20 21:26:19 0000 -------
Currently installed fontconfig-2.4.2, poppler-0.6.1-r1

------- Comment #4 From Jakub Moc (RETIRED) 2007-11-20 21:27:38 0000 -------
Please, attach a more useful backtrace...

http://www.gentoo.org/proj/en/qa/backtraces.xml

------- Comment #5 From Eugene Zagidullin 2007-11-20 23:31:33 0000 -------
Created an attachment (id=136556) [details]
Stack backtrace

I have xpdf, poppler and fontconfig rebuilded with debugging info. More
informative stack trace attached.

------- Comment #6 From Jakub Moc (RETIRED) 2007-11-20 23:35:43 0000 -------
Much better indeed... :)

------- Comment #7 From Stefan Schweizer 2007-11-21 15:50:20 0000 -------
hmh, thomas, do you have an idea why this is? How have you made that poppler
version exactly? Is there any chance we could get this upstream to either
poppler or xpdf? ;)

------- Comment #8 From Thomas Kreuzer 2007-11-21 16:54:51 0000 -------
(In reply to comment #7)
> hmh, thomas, do you have an idea why this is? How have you made that poppler
> version exactly? Is there any chance we could get this upstream to either
> poppler or xpdf? ;)
> 

Hard to tell, either this is a mere poppler problem, because if you do a: 

$ pdf2ps yourpdffile.pdf
$ ps2pdf yourpdffile.ps

the resulting pdf will work. (both are poppler command line tools.)

Or it is indeed the conflict of the redundant code in xpdf, the GlobalParams.*
are right now included in the xpdf-3.02-poppler package, even though they are
also provided by poppler (some functions are missing there though)
In poppler uses fcfg slightly differently in their constructor, compared to
xpdf.

I will try to compile xpdf with the patched poppler and see if the problem
remains.

------- Comment #9 From Thomas Kreuzer 2007-11-21 19:26:09 0000 -------
Ok, with the patched poppler version it works correct.
So it seems xpdf doesn't initialize some Fontconfig stuff, that poppler later
wants to access, so basically we need to patch poppler, I will try to get the
patch upstream, again.

regards,
Thomas

------- Comment #10 From Thomas Kreuzer 2007-11-21 21:13:37 0000 -------
Created an attachment (id=136636) [details]
xpdf-3.92-poppler source package

Poppler doesn't really want to include xpdf specific stuff it seems, they
provide the xpdf headers only per flag, anyhow, this package should fix the
breakage for now

------- Comment #11 From Thomas Kreuzer 2007-11-21 21:20:04 0000 -------
Created an attachment (id=136638) [details]
source package (updated)

sorry, I forgot to clean the package, before uploading it :p

------- Comment #12 From Stefan Schweizer 2007-11-21 21:40:26 0000 -------
I wonder, how have you fixed it now? Anyway, thanks for fixing.

------- Comment #13 From Thomas Kreuzer 2007-11-21 23:47:50 0000 -------
Well, instead of patching poppler with the xpdf code, I patched xpdf with the
poppler code :p

This solution is also sub-optimal though, but it should do the trick now.
I hope no other bug will emerge, and I will keep trying to get the xpdf patch
for poppler upstream, but xpdf never was supposed to be spereated in library
style, so it is kind of a compromise for the poppler guys whether to include
xpdf code or not.

regards,
Thomas