[Xapian-discuss] Databases on Windows

Colin Bell colinabell at gmail.com
Sun Apr 13 17:40:19 BST 2008


I've tested some lengths as Olly suggested and I noticed that the  
directory stops being created when more than 15 characters were in the  
name. The program then exits with no database available. I will  
rebuild Xapian with debug switched on and report back.

On 13 Apr 2008, at 10:46, Olly Betts wrote:

> On Sun, Apr 13, 2008 at 10:29:18AM +0100, James Aylett wrote:
>> On Sun, Apr 13, 2008 at 08:32:50AM +0100, Colin Bell wrote:
>>>>> [db directory created] "ÍÍÍÍresearch"
>>>>> and then exits without any errors.
> [...]
>>
>> Hmm. Unless anyone has any other suggestions, I think you're probably
>> gonna have to attack the VC++ debugger to that and step through to
>> find out where it fails, and possibly gain some insight as to where  
>> it
>> gets the directory name wrong. I don't know if the library build
>> you're using has debugging symbols, but if not you'll probably want  
>> to
>> rebuild it.
>
> I wonder if it's screwing up and passing mkdir() the address of the
> std::string object cast to (char*) rather than calling c_str() on  
> it, or
> something like that.  But surely that would have been noticed before?
>
> I believe MSVC uses what's known as the "short string optimisation",  
> so
> "research" would get stored in the string object, rather than the  
> object
> holding a pointer to it.  The four garbage characters would be the
> string length.
>
> It's hard to know quite where this would be going wrong.  Perhaps MSVC
> doesn't always correctly handle overloading where one form is extern
> "C"?
>
> Hmm, or perhaps it's an issue with the SSO.  What happens if you name
> the directory something longer?  If a much longer name works, see what
> length it stops working at.
>
> Cheers,
>    Olly




More information about the Xapian-discuss mailing list