[Xapian-devel] Sample quickstartindex unable to create database on Windows 2008
Charlie Hull
charlie at juggler.net
Thu Jul 2 11:43:03 BST 2009
Olly Betts wrote:
> On Wed, Jul 01, 2009 at 11:11:45AM -0700, Martin Margo wrote:
>> I debugged the program and in database.cc in Xapian code line 205 function
>> WritableDatabase::WritableDatabase(const std::string &path, int action) : Database ()
>>
>> 'path' variable is preceeded with weird characters, such as so:
>> "ÌÌÌÌC:\tmp\junk14"
>>
>> const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
>>
>> While it should have read 'C:\tmp\junk14'.
>
> But that is just passed straight in from argv[1] by
> quickstartindex.cc...
>
> What is argv[1] as passed to quickstartindex?
>
> And what are these 4 bytes exactly? They're showing up as 0xcc here,
> but it's not clear if they've been mangled from their original values.
>
> Or are you looking at the raw data inside the string class? That would
> probably have the length followed by the string data.
Hi all,
I've confirmed this problem on Visual C++ 2005 Express. Debugging inside
the WritableDatabase constructor:
WritableDatabase::WritableDatabase(const std::string &path, int action)
: Database()
{
The debugger shows 'path' is a '<Bad Ptr>'. Somehow VC++ doesn't like
passing const references to std::strings in this way.
BTW copying argv[1] into a temporary buffer to make sure it's definitely
zero terminated etc., then making a new std::string round it, then
passing a reference to that doesn't help.
I'm wondering (though not with any real evidence) if
http://trac.xapian.org/ticket/140
has any relevance.
Cheers
Charlie
>
> Cheers,
> Olly
>
> _______________________________________________
> Xapian-devel mailing list
> Xapian-devel at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-devel
>
More information about the Xapian-devel
mailing list