[bt-devel] Crash in Bookshelf Manager with Xiphos module

Gary Holmlund gary.holmlund at gmail.com
Mon Jan 17 18:56:24 MST 2011


On 01/16/2011 09:10 PM, Gary Holmlund wrote:
>
> I was running Fedora 14 and was pleased to notice that an update of 
> Bibletime just came through. It was from 2.7.3 to 2.8.0. I was 
> searching to find something about the package person for Fedora and I 
> ran across a Bibletime crash in the Fedora bugzilla system.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=665712
>
> I was able to reproduce the bug in the latest code in both Fedora and 
> Windows. Using the bookshelf manager, just change to Xiphos as the 
> source. You might have to hit refresh.
>
> The crash is on line 154 of cswordmoduleinfo.cpp
> sword::ConfigEntMap config = 
> backend()->getConfig()->Sections.find(name().toUtf8().constData())->second;
>
> The Sections.find is returning an invalid iterator for a module which 
> is know to be in the Sections map. The name stored in the Sections map 
> is slightly different than the name to be found.
> "CitireÎntr-unAn" name stored in the Sections map
> "CitireÃŽntr-unAn" name returned by name().toUtf8()
>
> I note that if I change from .toUtf8 to .toLatin1 the search finds the 
> module. I am not sure that this is the right fix. I am wondering if 
> the name of the module in the Xiphos repository is not valid in utf8, 
> and therefore is incorrect.
>
> I can put a test into cswordmoduleinfo.cpp so it does not crash, but I 
> am wondering about the utf8 versus latin1 issue. What are your thoughts?
>
> Gary
I found the problem. Bt received a 8bit utf8 string from sword and 
converted it to a 16bit QString, but it did not do that correctly.

m_cachedName(module->Name()),    // original line

m_cachedName(QString::fromUtf8(module->Name())),  // fixed line

I have checked a fix into the master and stable-2.8

Gary






More information about the bt-devel mailing list