Bug 310912 - nepomukindexer crashes if a file has a (wrong) pdf extension
Summary: nepomukindexer crashes if a file has a (wrong) pdf extension
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: fileindexer (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Nepomuk Bugs Coordination
Depends on:
Reported: 2012-11-30 10:20 UTC by Christophe Marin
Modified: 2012-12-20 22:55 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Marin 2012-11-30 10:20:38 UTC
Using nepomuk-core master, the crash is reproducible.

- Rename a text file and append the pdf extension,
- Try to run nepomukindexer on this file -> crash

# cp test.txt test.pdf
# nepomukindexer test.pdf
nepomukindexer(20434)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-krop/ksycoca4"
nepomukindexer(20434)/nepomuk (library) Nepomuk2::ResourceManagerPrivate::_k_storageServiceInitialized: Nepomuk Storage service up and initialized.
nepomukindexer(20434)/nepomuk (library) {anonymous}::GlobalModelContainer::init: Connecting to local socket "/tmp/ksocket-krop/nepomuk-socket"
nepomukindexer(20434)/nepomuk (strigi service) Nepomuk2::Indexer::indexFile:  QUrl( "nepomuk:/res/0121e7c9-3492-4003-aaad-53a99a340620" )  "application/pdf"
"Error: May not be a PDF file (continuing anyway)" 
"Error: Couldn't find trailer dictionary" 
"Error: Couldn't read xref table" 
[1]    20434 segmentation fault (core dumped)  nepomukindexer test.pdf


Thread 1 (Thread 0x7fccc3bfb780 (LWP 20391)):
#0  0x00007fccc33e898b in Poppler::Document::info(QString const&) const () from /usr/lib64/libpoppler-qt4.so.4
#1  0x00007fcccb4f95d5 in Nepomuk2::PopplerExtractor::extract (this=0xf46f40, resUri=..., fileUrl=..., mimeType=...)
    at /kde/src/kdebase/nepomuk-core/services/fileindexer/indexer/popplerextractor.cpp:56
#2  0x000000000040923f in Nepomuk2::Indexer::indexFile (this=0x7fff42dd6ad0, url=...) at /kde/src/kdebase/nepomuk-core/services/fileindexer/indexer/indexer.cpp:113
#3  0x00000000004082c1 in main (argc=2, argv=0x7fff42dd6fa8) at /kde/src/kdebase/nepomuk-core/services/fileindexer/indexer/main.cpp:100
Comment 1 Simeon Bird 2012-12-17 23:48:40 UTC
Git commit 56e476cd9b995143b4ca9a67257dc7642c879841 by Simeon Bird.
Committed on 18/12/2012 at 00:44.
Pushed by sbird into branch 'master'.

Fix crash if asked to index invalid pdf document. Fix is
as suggested in the poppler-qt4 example.

M  +6    -0    services/fileindexer/indexer/popplerextractor.cpp

Comment 2 Albert Astals Cid 2012-12-17 23:56:58 UTC
You forgot the 4.10 branch
Comment 3 Christoph Feck 2012-12-20 21:09:23 UTC
Simon, could you please check comment #2?
Comment 4 Simeon Bird 2012-12-20 21:48:37 UTC
It got merged across a day later - I wanted to double-check with Vishesh since we are in freeze.
Comment 5 Vishesh Handa 2012-12-20 22:55:51 UTC
(In reply to comment #4)
> It got merged across a day later - I wanted to double-check with Vishesh
> since we are in freeze.

the freeze was just for that day :)

Feel free to commit anything.