osm2pgsql - Seg Fault

Hi geeks,

I was trying to import some data using osm2pgsql on Ubuntu but had no luck with partial files of Ukraine or Turkey - here is output:

postgres@seth-desktop:/media/store/OSM/osm2pgsql$ ./osm2pgsql -lsc -O gazetteer -C 500 -d gazetteer turkey.osm.bz2
osm2pgsql SVN version 0.70.5

Using projection SRS 4326 (Latlong)
NOTICE: table “place” does not exist, skipping
NOTICE: type “keyvalue” does not exist, skipping
NOTICE: type “wordscore” does not exist, skipping
NOTICE: type “stringlanguagetype” does not exist, skipping
NOTICE: type “keyvaluetype” does not exist, skipping
NOTICE: function get_connected_ways(pg_catalog.int4[]) does not exist, skipping
Mid: pgsql, scale=10000000, cache=500MB, maxblocks=64001*8192
Setting up table: planet_osm_nodes
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index “planet_osm_nodes_pkey” for table “planet_osm_nodes”
Setting up table: planet_osm_ways
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index “planet_osm_ways_pkey” for table “planet_osm_ways”
Setting up table: planet_osm_rels
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index “planet_osm_rels_pkey” for table “planet_osm_rels”

Reading in file: turkey.osm.bz2
Processing: Node(2490k) Way(140k) Relation(1105) parse time: 80s

Node stats: total(2490850), max(1234826715)
Way stats: total(140727), max(107445058)
Relation stats: total(1105), max(1526723)
node cache: stored: 2490850(100.00%), storage efficiency: 8.25%, hit rate: 100.00%
Stopping table: planet_osm_nodes
Stopping table: planet_osm_rels
Stopping table: planet_osm_ways
Building index on table: planet_osm_rels
Stopped table: planet_osm_nodes
Building index on table: planet_osm_ways
Stopped table: planet_osm_rels
Stopped table: planet_osm_ways
Segmentation fault

Can anyone help me with this problem?

Where did you get those planet extract files?

Also, the segfault happens long after the extract files have been processed. Those ‘Stopped table’ messages are part of the index building and vacuum analyse parts of osm2pgsql. You might want to run osm2pgsql in gdb to gather more info about what exactly it’s doing when it segfaults.

I got osm from http://download.geofabrik.de/osm/europe/

Ok I will try to run it in gdb - thanks.

Here is output in gdb:

[New Thread 0x7ffff2c6c700 (LWP 14677)]
Stopping table: planet_osm_nodes
[New Thread 0x7ffff246b700 (LWP 14678)]
Stopping table: planet_osm_ways
[New Thread 0x7ffff1c6a700 (LWP 14679)]
Stopping table: planet_osm_rels
Building index on table: planet_osm_ways
Stopped table: planet_osm_nodes
[Thread 0x7ffff2c6c700 (LWP 14677) exited]
Building index on table: planet_osm_rels
Stopped table: planet_osm_rels
[Thread 0x7ffff1c6a700 (LWP 14679) exited]
Stopped table: planet_osm_ways
[Thread 0x7ffff246b700 (LWP 14678) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff61a40e4 in fclose () from /lib/x86_64-linux-gnu/libc.so.6

A stack trace would be more helpful.

I found problem: i was starting osm2pgsql under postgres user - when i started it from regular user - import was completed normally.

It still shouldn’t segfault, but glad to hear it now works for you.

Thanks for your interest in my problem - i’m really appreciate it. But i can’t search addresses - this is other problem so i will start new thread.