Bug 176320

Summary: crash with PDF of focus-campus.de (freetype)
Product: [Applications] okular Reporter: Helge Hielscher <hhielscher>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED UPSTREAM    
Severity: crash CC: aacid, andresbajotierra, archx, bradh, nick.degraeve, pgrahl, sime.essert
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Okular crash file

Description Helge Hielscher 2008-11-28 10:45:07 UTC
Version:           0.7.80 (using Devel)
Installed from:    Compiled sources

Okular crashes with this PDF
http://www.focus-campus.de/download.html?f=FC_0848.pdf

KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = okular path = <unknown> pid = 15149
sock_file=/home/helge/.kde4/socket-iwan/kdeinit4__0
okular: Fatal IO error: client killed
Comment 1 Dario Andres 2008-11-28 14:44:19 UTC
Qt: 4.4.3
KDE: 4.1.3 (KDE 4.1.3)
Okular: 0.7.3
poppler (and poppler-qt) 0.10.0
freetype2 2.3.7
on ArchLinux x86_64

Here I can reproduce it. 
Seems related to poppler.

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x418c8950 (LWP 12600)]         
0x00007f718ff1557f in cff_parse_real () from /usr/lib/libfreetype.so.6
(gdb) bt full                                                         
#0  0x00007f718ff1557f in cff_parse_real () from /usr/lib/libfreetype.so.6
No symbol table info available.                                           
#1  0x00007f718ff156d0 in cff_parse_num () from /usr/lib/libfreetype.so.6 
No symbol table info available.                                           
#2  0x00007f718ff15946 in cff_parser_run () from /usr/lib/libfreetype.so.6
No symbol table info available.                                           
#3  0x00007f718ff199fd in cff_subfont_load () from /usr/lib/libfreetype.so.6
No symbol table info available.                                             
#4  0x00007f718ff19eae in cff_face_init () from /usr/lib/libfreetype.so.6   
No symbol table info available.                                             
#5  0x00007f718fefa200 in open_face () from /usr/lib/libfreetype.so.6       
No symbol table info available.                                             
#6  0x00007f718fefc61e in FT_Open_Face () from /usr/lib/libfreetype.so.6    
No symbol table info available.                                             
#7  0x00007f718fefd330 in FT_New_Memory_Face () from /usr/lib/libfreetype.so.6
No symbol table info available.                                               
#8  0x00007f718930dc1b in SplashFTFontFile::loadType1Font ()                  
   from /usr/lib/libpoppler.so.4                                              
No symbol table info available.                                               
#9  0x00007f718930e974 in SplashFontEngine::loadType1CFont ()                 
   from /usr/lib/libpoppler.so.4                                              
---Type <return> to continue, or q <return> to quit---                        
No symbol table info available.                                               
#10 0x00007f718923baca in SplashOutputDev::doUpdateFont ()                    
   from /usr/lib/libpoppler.so.4                                              
No symbol table info available.                                               
#11 0x00007f718923bdac in SplashOutputDev::drawChar ()                        
   from /usr/lib/libpoppler.so.4                                              
No symbol table info available.                                               
#12 0x00007f7189279500 in Gfx::doShowText () from /usr/lib/libpoppler.so.4    
No symbol table info available.                                               
#13 0x00007f718927a194 in Gfx::opShowText () from /usr/lib/libpoppler.so.4    
No symbol table info available.                                               
#14 0x00007f718927156d in Gfx::go () from /usr/lib/libpoppler.so.4            
No symbol table info available.                                               
#15 0x00007f7189275a16 in Gfx::display () from /usr/lib/libpoppler.so.4       
No symbol table info available.                                               
#16 0x00007f71892b8030 in Page::displaySlice () from /usr/lib/libpoppler.so.4 
No symbol table info available.                                               
#17 0x00007f71895ccd4d in Poppler::Page::renderToImage ()                     
   from /usr/lib/libpoppler-qt4.so.3                                          
No symbol table info available.
#18 0x00007f718982e8c4 in PDFPixmapGeneratorThread::run (this=0x15fd140)
---Type <return> to continue, or q <return> to quit---
    at /home/dario/Build/ABS/kdegraphics/src/kdegraphics-4.1.3/okular/generators/poppler/generator_pdf.cpp:1780
        page = <value optimized out>
        width = <value optimized out>
        height = <value optimized out>
        pageWidth = 842
        pageHeight = 595
        genTextPage = false
        pp = <value optimized out>
        __PRETTY_FUNCTION__ = "virtual void PDFPixmapGeneratorThread::run()"
#19 0x00007f7196c86d79 in ?? () from /usr/lib/libQtCore.so.4
No symbol table info available.
#20 0x00007f7196a16fe7 in start_thread () from /lib/libpthread.so.0
No symbol table info available.
#21 0x00007f719135823d in clone () from /lib/libc.so.6
No symbol table info available.
#22 0x0000000000000000 in ?? ()
Comment 2 Albert Astals Cid 2008-11-28 20:32:52 UTC
Related to poppler? I see it crashing in freetype eh ;-)

Works for me using poppler 0.10.1 and freetype either 2.3.5-1ubuntu4.8.04.1 or compiled from cvs
Comment 3 Dario Andres 2008-11-28 21:01:59 UTC
You're right :-P 
Updating poppler to 0.10.1 didn't solve the issue.

May be related to 
http://www.mail-archive.com/freetype-devel@nongnu.org/msg02803.html
(Regression Crash between freetype 2.3.5 and 2.3.7 / cff_parse_real(), seems to be related to GCC optimizations).

Helge, what freetype2 version do you have?
Comment 4 Dario Andres 2008-11-28 21:10:42 UTC
After recompiling freetype 2.3.7 (after unsetting CFLAGS and CXXFLAGS), I can't reproduce this bug anymore. So it seems to be fault of a GCC optimization on freetype2 2.3.7 :)
Comment 5 Helge Hielscher 2008-11-29 00:09:24 UTC
# rpm -qa|grep freetype
libfreetype6-2.3.7-1plf2009.0
freetype-1.3.1-29mdv2009.0
freetype-tools-1.3.1-29mdv2009.0
libfreetype6-devel-2.3.7-1plf2009.0
Comment 6 Brad Hards 2008-11-29 09:47:24 UTC
Dario: did you rebuild the package with different options, or do a clean build from upstream sources?
Comment 7 Brad Hards 2008-11-29 09:49:29 UTC
Three Okular bugs, all involving SIGFPE, perhaps all in freetype:
#170427
#176304
#176320
Comment 8 Dario Andres 2008-11-29 14:05:46 UTC
Brad:
My distribution (ArchLinux) uses precompiled binaries (compiled with "-O2 -pipe")
But we can compile ourselves the distribution packages (it uses a BSD-port like system), and thus changing some compile options and so on.
I have compiled freetype2 (2.3.7) from source disabling the GCC options ("unset CFLAGS", seting CFLAGS="-g" ) to check the information I found about this bug (the link in comment 3). Then, I installed my own source-build package to overwrite the original freetype package. And the bug seems to be gone. I could even read the PDF :).
Is that what you were asking for? If not, just ask me again :)

I have only recompiled kdegraphics after updating my poppler packages to 0.10.1. But this wasn't neccesary to do after updating my freetype2 package.
Comment 9 Brad Hards 2008-11-29 23:46:09 UTC
Dario: I was trying to figure out whether it could be caused by some patches applied to freetype (Ubuntu / Debian has 107K diff applied, most of which looks harmless, but I didn't do a full check), or whether it is more likely a compiler problem. Sounds like the compiler optimisations might be the issue.

What gcc version is this with?
Comment 10 Dario Andres 2008-11-29 23:56:54 UTC
Here: I'm using gcc (GCC) 4.3.2
Comment 11 Pino Toscano 2009-01-12 11:48:09 UTC
*** Bug 176304 has been marked as a duplicate of this bug. ***
Comment 12 Pino Toscano 2009-01-19 10:38:40 UTC
*** Bug 181275 has been marked as a duplicate of this bug. ***
Comment 13 Pino Toscano 2009-01-19 10:44:52 UTC
Albert, Brad: is this problem strictly freetype's, or how it is used within poppler?
Comment 14 Grahl 2009-01-19 15:05:01 UTC
Created attachment 30419 [details]
Okular crash file

This is the crash report I got when trying to browse a PFD file with okular.
Comment 15 Pino Toscano 2009-01-19 15:11:33 UTC
@Grahl:
> Created an attachment (id=30419) [details]
> Okular crash file
> 
> This is the crash report I got when trying to browse a PFD file with okular.

This is an old crash in the Poppler library (that has nothing to do with this bug report); please update your Poppler.
Comment 16 Albert Astals Cid 2009-01-19 19:46:41 UTC
Strictly freetype as far as i know.
Comment 17 Pino Toscano 2009-01-24 15:39:11 UTC
As seen in various comments, this bug belongs either to freetype, or to gcc itself.
Thus closing it as UPSTREAM.
Comment 18 Pino Toscano 2009-02-16 22:19:20 UTC
*** Bug 184560 has been marked as a duplicate of this bug. ***