[OSM-dev] 64-bit osm2pgsql incorrect slim table entries

Phil! Gold phil_g at pobox.com
Mon Feb 20 02:38:28 GMT 2012


I've been having some problems with my 64-bit osm2pgsql import.  It
appears to be corrupting the members of the parts array in the
planet_osm_rels table.  As an example, here's one chosen effectively at
random from my database:

    new64=# SELECT id, way_off, rel_off, parts, members FROM planet_osm_rels LIMIT 1;
    -[ RECORD 1 ]------------------------------------------------
    id      | 133403
    way_off | 0
    rel_off | 3
    parts   | {92449187,-5247925070415029361,2991402324819948480}
    members | {w34315220,outer,w34315151,outer,w92449187,outer}

Of the three member ways, two have drastically incorrect entries in the
parts array.

The problem occurs with the 0.70.5 64-bit osm2pgsql build and with the
most recent subversion revision (r27862) if it's built with OSMID64
uncommented in osmtypes.h.  The problem does not appear to occur if the
subversion HEAD is built with 32-bit integers.

I have a sample source file that reliably demonstrates the problem for me
at http://static.aperiodic.net/tmp/md-175.osm.pbf.  A 64-bit import and
query has this result:

    new64=# SELECT parts FROM planet_osm_rels WHERE id = 1345970;
    -[ RECORD 1 ]---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    parts | {11510529,53540938,114836426,53540949,53540937,114836420,53540965,53540940,53541552,131940164,53541550,131940163,53541549,53541548,53541558,78388509,131940162,130536452,130536459,130536455,130536446,130536456,130536449,11517091,75356047,58641269,58641237,58641195,130536515,130536513,0,0,-1223133920,-5249156523472453632,7515291472,46169998152,0,0,-4294967296,-4615550575240396740,-4615556966300262160,134639935,134639933,-5254079407471836336,578274096085729280,0,578274096085729288,-4615555677661543585,3220325215,0,0,0,-72056494509457408,-4615550406662029312,8126078124064,-5229416535952457711,-5249156520399645760,-4615556330644089920,-5228929543570309160,-5229304776608382976}

A 32-bit import and query has this result:

    new32=# SELECT parts FROM planet_osm_rels WHERE id = 1345970;
    -[ RECORD 1 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    parts | {11510529,53540938,114836426,53540949,53540937,114836420,53540965,53540940,53541552,131940164,53541550,131940163,53541549,53541548,53541558,78388509,131940162,130536452,130536459,130536455,130536446,130536456,130536449,11517091,75356047,58641269,58641237,58641195,130536515,130536513,9988626,58075236,58075235,116069196,116069326,58360641,58360640,52489043,52489044,116069235,5272600,53541859,92122474,92122470,78344026,130536516,50523285,50523286,116069190,116069293,58360644,58360643,52489045,92121396,116069458,9989239,53541857,92122450,92122448,55204718}

I'm using PostgreSQL 9.0 on Debian installed via dpkg with PostGIS 1.5.2
installed by hand.  The PBF was created by osmosis 0.39.  If I get a
chance, I'll try it with PostgreSQL 9.1 and PostGIS 1.5.3, both from
Debian packages, but I don't know when I'll have time for further
debugging.

Has anyone else seen similar issues with 64-bit osm2pgsql?

-- 
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
Remember that any vulnerabilities you have are to be revealed strictly on
a need-to-know basis.  Also remember that no one needs to know.
                       -- Evil Overlord's Handbook, entry 198
---- --- --



More information about the dev mailing list