[GRASS-dev] winGRASS: debugging vector db issues

Moritz Lennert mlennert at club.worldonline.be
Sun Feb 25 17:08:25 EST 2007


On Tue, February 20, 2007 12:34, Moritz Lennert wrote:
> On Wed, February 14, 2007 02:49, Moritz Lennert wrote:
>> Hello Martin,
>>
>> Markus tells me that you might participate in trying to debug the vector
>> db problems we are having in winGRASS.
>>
>> Paul and I have both failed to find the reason up to now. It seems to me
>> that the (or at least the first...) problem is with the table
>> description,
>> and within that most probably in the column description (
>> db__recv_*_definition in xdrtable.c and xdrcolumn.c in
>> lib/db/dbmi_base/).
>> I don't know if Paul has come to the same conclusion.
>>
>
> I think I have been able to get closer to the exact point of the problem.
>
> Using db.select as the test case, the error seems to happen around a call
> to xdr_int() in lib/db/dbmi_base/xdrstring.c.
>
> Below you can see the debug output. Everything marked with 'Moritz:' are
> my debugging statements. As you can see the problem seems to be the next
> attempt of reading a string after the first column name was read. This
> happens either on the second column name, if there are more than one
> column, or on the attempt to read the table name in xdrtable.c after
> having read the (unique) column name.
>
> The problem is in line 105 of lib/db/dbmi_base/xdrstring.c:
>
> if(!xdr_int (&xdrs, &len) || len <= 0)  /* len will include the null byte
> */
>
> len = 0 in this case.
>
> IIUC, xdr_int() is an internal function of the XDR library, so maybe there
> are some specificities with the Windows version of this library which we
> need to take into account ?

Some more info. I found the following note on the qgis wiki where the code
of the xdr library comes from
(http://wiki.qgis.org/qgiswiki/BuildingWindowsBinaryOnLinux):

"TODO: Use DLL. Currently if DLL is used db drivers do not work because of
'\n' conversion (text mode expected). Find out how to force xdrlib to
expect binary mode when compiled as DLL."

Could this be the cause of our problems ? Paul, you patched the xdr code,
replacing bzero with memset and bcopy with memmove. Does this have
anything to do with the above ?

Moritz




More information about the grass-dev mailing list