strigicmd crashes due to old libclucene0 bug

Bug #500864 reported by Jos van den Oever
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
clucene-core (Ubuntu)
New
Undecided
Unassigned

Bug Description

A bug in libclucene0 that was fixed [1] long ago causes strigicmd to crash.

It would be best to update to the latest stable release (0.9.21b) but adding the patch below suffices too.

The crash (segmentation fault) can be obtained by running e.g.
  mkdir /tmp/clucene
  valgrind strigicmd create -t clucene -j 1 -d /tmp/clucene $HOME
It might take a while for the crash to happens which is why running with valgrind is good: it shows the memory corruption [3] quickly.

This problem exists in jaunty and karmic [2].

[1] http://clucene.svn.sourceforge.net/viewvc/clucene?view=rev&revision=2688
diff -r clucene-core-0.9.20/src/CLucene/analysis/AnalysisHeader.cpp clucene-core-0.9.21b/src/CLucene/analysis/AnalysisHeader.cpp
81c81
< if(bufferTextLen>size)
---
> if(bufferTextLen>=size)

[2]
libclucene0ldbl:
  Installed: 0.9.20-3
  Candidate: 0.9.20-3
  Version table:
 *** 0.9.20-3 0
        500 http://nl.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status
libclucene0ldbl:
  Installed: 0.9.20-3
  Candidate: 0.9.20-3
  Version table:
 *** 0.9.20-3 0
        500 http://nl.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

==2065== Invalid read of size 4
==2065== at 0x599DB90: wcslen (wcslen.c:30)
==2065== by 0x7024B4B: lucene::util::StringBuffer::prepend(wchar_t const*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x7037D44: lucene::analysis::standard::StandardTokenizer::ReadNumber(wchar_t const*, wchar_t, lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x7038007: lucene::analysis::standard::StandardTokenizer::ReadNumber(wchar_t const*, wchar_t, lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x7038DD2: lucene::analysis::standard::StandardTokenizer::next(lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x7037B1E: lucene::analysis::standard::StandardFilter::next(lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x70349ED: lucene::analysis::LowerCaseFilter::next(lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x7034542: lucene::analysis::StopFilter::next(lucene::analysis::Token*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x703FFAD: lucene::index::DocumentWriter::invertDocument(lucene::document::Document const*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x704077E: lucene::index::DocumentWriter::addDocument(char const*, lucene::document::Document*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x704A9E1: lucene::index::IndexWriter::addDocument(lucene::document::Document*, lucene::analysis::Analyzer*) (in /usr/lib/libclucene.so.0.0.0)
==2065== by 0x6D9ED4C: CLuceneIndexWriter::finishAnalysis(Strigi::AnalysisResult const*) (in /usr/lib/strigi/strigiindex_clucene.so)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.