<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Guys,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here's a simple test case that causes a segfault with the perl bindings patched to enable spelling correction:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>use strict; </DIV><DIV>use warnings; </DIV><DIV>use Search::Xapian; </DIV><DIV>my $db = Search::Xapian::WritableDatabase-&gt;new("test.db", Search::Xapian::DB_CREATE_OR_OPEN); </DIV><DIV>if (!defined($db)) { </DIV><DIV>    die("Failed to open xapian_database: $!"); </DIV><DIV>  } </DIV><DIV>my $indexer = Search::Xapian::TermGenerator-&gt;new(); </DIV><DIV>$indexer-&gt;set_flags(Search::Xapian::FLAG_SPELLING); </DIV><DIV>my $document = Search::Xapian::Document-&gt;new(); </DIV><DIV>$indexer-&gt;set_document($document); </DIV><DIV>$indexer-&gt;index_text(lc('test'), 1); </DIV><DIV>$db-&gt;add_document($document); </DIV><DIV>undef $db;  </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here's the patch to enable spelling against Search-Xapian-1.0.4.0:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Helvetica"><A href="http://rusty.devel.infogears.com/xap-perl-spelling.diff">http://rusty.devel.infogears.com/xap-perl-spelling.diff</A></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here's the backtrace against 1.0.4:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Program received signal SIGSEGV, Segmentation fault.</DIV><DIV>[Switching to Thread -1208211776 (LWP 27230)]</DIV><DIV>0x001c9bbc in Xapian::WritableDatabase::add_spelling (this=0x9d77de0, word=@0xbf846fa0, freqinc=1) at ./include/xapian/base.h:154</DIV><DIV>154         return dest;</DIV><DIV>Current language:  auto; currently c++</DIV><DIV>(gdb) bt</DIV><DIV>#0  0x001c9bbc in Xapian::WritableDatabase::add_spelling (this=0x9d77de0, word=@0xbf846fa0, freqinc=1) at ./include/xapian/base.h:154</DIV><DIV>#1  0x0032608a in Xapian::TermGenerator::Internal::index_text (this=0x9d77dc8, itor={p = 0x0, end = 0x9cb5db8 "", seqlen = 0}, weight=1, </DIV><DIV>    prefix=@0xbf84703c, with_positions=true) at queryparser/termgenerator_internal.cc:207</DIV><DIV>#2  0x0032506c in Xapian::TermGenerator::index_text (this=0x9c94cd0, itor=@0xbf84702c, weight=1, prefix=@0xbf84703c) at queryparser/termgenerator.cc:90</DIV><DIV>#3  0x0017100e in XS_Search__Xapian__TermGenerator_index_text (my_perl=0x9c78008, cv=0x9d7f7e8) at /usr/local/include/xapian/termgenerator.h:115</DIV><DIV>#4  0x00c3142d in Perl_pp_entersub () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so</DIV><DIV>#5  0x00c2a88f in Perl_runops_standard () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so</DIV><DIV>#6  0x00bd010e in perl_run () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so</DIV><DIV>#7  0x0804921e in main ()</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Any help would be great as I'm excited to get spelling correction working.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style=""><FONT class="Apple-style-span" face="Helvetica Neue"><SPAN class="Apple-style-span" style="font-family: Helvetica Neue; "><SPAN class="Apple-style-span" style="font-family: Helvetica Neue; ">Thanks,</SPAN></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" face="Monaco" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;; font-family: Monaco; "><FONT class="Apple-style-span" face="Helvetica Neue" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;; font-family: Helvetica Neue; "><BR class="khtml-block-placeholder"></SPAN></FONT></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" face="Helvetica Neue"><SPAN class="Apple-style-span" style="font-family: Helvetica Neue; "><SPAN class="Apple-style-span" style="font-family: Helvetica Neue; ">Rusty</SPAN></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" face="Helvetica" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;; font-family: Helvetica; "><SPAN class="Apple-style-span" style="font-family: Helvetica; font-size: 14px; "><SPAN class="Apple-style-span" style="font-family: Helvetica; font-size: 14px; ">--</SPAN></SPAN></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;"><FONT class="Apple-style-span" face="Optima"><SPAN class="Apple-style-span" style="font-family: Optima; font-size: 14px; "><SPAN class="Apple-style-span" style="font-family: Optima; font-size: 14px; ">Rusty Conover</SPAN></SPAN></FONT></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" face="Optima"><SPAN class="Apple-style-span" style="font-family: Optima; "><SPAN class="Apple-style-span" style="font-family: Optima; ">InfoGears Inc.</SPAN></SPAN></FONT></DIV><DIV style=""><FONT class="Apple-style-span" face="Monaco" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;; font-family: Monaco; "><FONT class="Apple-style-span" face="Optima" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;; font-family: Optima; "><SPAN class="Apple-style-span" style="font-family: Optima; font-size: 11px; "><SPAN class="Apple-style-span" style="font-family: Optima; font-size: 11px; ">Web: </SPAN></SPAN></SPAN></FONT><FONT class="Apple-style-span" color="#0007FF" face="Optima" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;; color: rgb(0, 7, 255); font-family: Optima; "><SPAN class="Apple-style-span" style="color: rgb(0, 7, 255); font-family: Optima; font-size: 11px; "><SPAN class="Apple-style-span" style="color: rgb(0, 7, 255); font-family: Optima; font-size: 11px; "><A href="http://www.infogears.com">http://www.infogears.com</A></SPAN></SPAN></SPAN></FONT></SPAN></FONT></DIV><DIV style="; font-family: Monaco; font-size: 14px; "><FONT class="Apple-style-span" face="Lucida Sans" size="3"><SPAN class="Apple-style-span" style="font-size: 12px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV></SPAN><FONT class="Apple-style-span" face="Helvetica"></FONT><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>