[sword-devel] Sword search problems

Karl Kleinpaste karl at kleinpaste.org
Sun Aug 5 15:10:43 MST 2007

A recent feature addition in GnomeSword is providing an icon in the
module manager to say whether a clucene index exists for each module.
This is very blunt:

	SWModule *mod = mgr->Modules.find(mod_name)->second;
	return mod->hasSearchFramework();

This reproducibly upchucks, only when installing a new module.  That is,
after any new modules have finished being installed from the repository,
we shut down/re-init the backend, and then we re-build the module
display tree, passing through this code for each module.

For all modules except the brand new one, "mod" gets a reasonable value,
and mod->hasSearchFramework() returns something sensible for us.  For a
new module, I still get a reasonable value for mod, but then the call to
hasSearchFramework() dies on SEGV.  (We should simply get back "false"
because no index has yet been built.)  I can't see anything that we
should be doing differently -- by the time we're re-building the module
display tree, every module that has been installed should be fully
present and all the usual tests against them should be appropriate.

Is anyone else familiar with a failure mode of this sort?  Have I missed
something else that should be done?


PS- This is in main_has_search_framework(), a C wrapper function to the
C++ interface.  "mgr" has the same value for every module as we pass
through this code, and the "mod" values all look appropriate.

Breakpoint 1, main_has_search_framework (mod_name=0xaf89de0 "ERda_en") at sword.cc:1358
1358            SWModule *mod = mgr->Modules.find(mod_name)->second;
(gdb) p mgr
$29 = (struct sword::SWMgr *) 0x9671a70
(gdb) n
1359            return mod->hasSearchFramework();
(gdb) p mod
$30 = (struct sword::SWModule *) 0x96545c0
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0x080cc57a in main_has_search_framework (mod_name=0xaf89de0 "ERda_en") at sword.cc:1359
1359            return mod->hasSearchFramework();

More information about the sword-devel mailing list