[postgis-devel] WKB Problems on 64-Bit Linux

Markus Schaber markus at schabi.de
Tue Mar 8 09:13:03 PST 2005


Hi,

I just ran an extended variant[1] of jdbc2 "make alltests" against the
64-bit PostGIS enabled server. As it fails on 244 tests that all pass on
IA32, there seems to be a rather serious WKB parsing problem on 64-Bit.

I identified some of the failed queries from the test log, and here they
are:

jdbc_test=# select
'010400000002000000010100000000000000000026400000000000002840010100000000000000000034400000000000003440'::geometry;
ERROR:  invalid wkb
jdbc_test=# select
'0104000080020000000101000080000000000000264000000000000028400000000000002A400101000080000000000000344000000000000034400000000000003440'::geometry;
ERROR:  invalid wkb

jdbc_test=# select
'01030000C002000000050000000000000000002440000000000000244000000000000000000000000000001C400000000000003440000000000000244000000000000000000000000000001C400000000000003440000000000000344000000000000000000000000000001C400000000000003440000000000000244000000000000000000000000000001C400000000000002440000000000000244000000000000000000000000000001C40050000000000000000001440000000000000144000000000000000000000000000001C400000000000001440000000000000184000000000000000000000000000001C400000000000001840000000000000184000000000000000000000000000001C400000000000001840000000000000144000000000000000000000000000001C400000000000001440000000000000144000000000000000000000000000001C40'::geometry;
ERROR:  invalid wkb
jdbc_test=# select
'00C00000030000000200000005402400000000000040240000000000000000000000000000401C000000000000403400000000000040240000000000000000000000000000401C000000000000403400000000000040340000000000000000000000000000401C000000000000403400000000000040240000000000000000000000000000401C000000000000402400000000000040240000000000000000000000000000401C00000000000000000005401400000000000040140000000000000000000000000000401C000000000000401400000000000040180000000000000000000000000000401C000000000000401800000000000040180000000000000000000000000000401C000000000000401800000000000040140000000000000000000000000000401C000000000000401400000000000040140000000000000000000000000000401C000000000000'::geometry;

ERROR:  invalid wkb

jdbc_test=# select
'010300000002000000050000000000000000002440000000000000244000000000000034400000000000002440000000000000344000000000000034400000000000003440000000000000244000000000000024400000000000002440050000000000000000001440000000000000144000000000000014400000000000001840000000000000184000000000000018400000000000001840000000000000144000000000000014400000000000001440'::geometry;
ERROR:  invalid wkb
jdbc_test=# select
'000000000300000002000000054024000000000000402400000000000040340000000000004024000000000000403400000000000040340000000000004034000000000000402400000000000040240000000000004024000000000000000000054014000000000000401400000000000040140000000000004018000000000000401800000000000040180000000000004018000000000000401400000000000040140000000000004014000000000000'::geometry;

It seems that it can parse more bytea reps than hexed reps, and it also
seems that it fails on XDR more often than on NDR.

The last two hexEWKB reps above both represent 'POLYGON((10 10,20 10,20
20,20 10,10 10),(5 5,5 6,6 6,6 5,5 5))', it seems to be very critical
case as it is failing on both binary and hex encoding, as well as on
both XDR and NDR encoding. You can also provoke it via:

jdbc_test=# select 'POLYGON((10 10,20 10,20 20,20 10,10 10),(5 5,5 6,6
6,6 5,5 5))'::geometry::bytea::geometry;
ERROR:  invalid wkb
jdbc_test=# select 'POLYGON((10 10,20 10,20 20,20 10,10 10),(5 5,5 6,6
6,6 5,5 5))'::geometry::text::geometry;
ERROR:  invalid wkb

For the curious, I also attached the full test.log file in bzip2
compressed format.

HTH,
Markus

Footnotes:
[1] The extensions include EWKB and hexEWKB input, for which I added
support. I did not commit this code yet, as I think it is 1.1 material.
The 1.0.0 code does not utilize WKB parsing on the server side, and so
fails all tests.

-- 
Markus Schaber - http://schabi.de/

But hey!, Standard compliance is something we should strive for, so
let's try and change the Standard :-) [Alexandre Oliva, GCC Developer]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.log.bz2
Type: application/x-bzip
Size: 5411 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20050308/36e08ccb/attachment.bin>


More information about the postgis-devel mailing list