osm2pgsql-dev / osm2pgsql

OpenStreetMap data to PostgreSQL converter
https://osm2pgsql.org
GNU General Public License v2.0
1.5k stars 474 forks source link

Segmentation fault inside geos. #330

Closed molind closed 9 years ago

molind commented 9 years ago

Segfault happened during import of the planet-150406.osm.pbf. I tried to import planet few times with different versions of osm2pgsql. Bug reproduced in 0.87.2 and in HEAD commit.

if you need some specific info, gdb is still opened on server. And i could provide more data, than just backtrace.

Command was:

gdb --args osm2pgsql --create --flat-nodes flatnodes.bin --cache-strategy dense -v --hstore-all --proj 3857 --prefix planet --slim -C10000 --number-processes 6 --style allIncluded.style planet-150406.osm.pbf

And crashlog with backtrace:

Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Node-cache: cache=10000MB, maxblocks=1280000*8192, allocation method=10
Mid: loading persistent node cache from flatnodes.bin
Allocated space for persistent node cache file
Maximum node in persistent node cache: 0
Mid: pgsql, scale=100 cache=10000
Setting up table: planet_nodes
Setting up table: planet_ways
Setting up table: planet_rels

Reading in file: planet-latest.osm.pbf
Processing: Node(2798277k 1376.4k/s) Way(280377k 22.29k/s) Relation(191160 94.82/s)
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff712a7fc in geos::algorithm::locate::IndexedPointInAreaLocator::IntervalIndexedGeometry::~IntervalIndexedGeometry (
    this=0x10d08a40, __in_chrg=<optimized out>) at IndexedPointInAreaLocator.cpp:50
50                      delete allocatedSegments[i];
(gdb) bt
#0  0x00007ffff712a7fc in geos::algorithm::locate::IndexedPointInAreaLocator::IntervalIndexedGeometry::~IntervalIndexedGeometry (
    this=0x10d08a40, __in_chrg=<optimized out>) at IndexedPointInAreaLocator.cpp:50
#1  0x00007ffff712a868 in geos::algorithm::locate::IndexedPointInAreaLocator::~IndexedPointInAreaLocator (this=0x10d08a20,
    __in_chrg=<optimized out>) at IndexedPointInAreaLocator.cpp:115
#2  0x00007ffff712a8a9 in geos::algorithm::locate::IndexedPointInAreaLocator::~IndexedPointInAreaLocator (this=0x10d08a20,
    __in_chrg=<optimized out>) at IndexedPointInAreaLocator.cpp:116
#3  0x00007ffff714918e in geos::geom::prep::PreparedPolygon::~PreparedPolygon (this=0x10d08980, __in_chrg=<optimized out>)
    at PreparedPolygon.cpp:50
#4  0x00007ffff7149219 in geos::geom::prep::PreparedPolygon::~PreparedPolygon (this=0x10d08980, __in_chrg=<optimized out>)
    at PreparedPolygon.cpp:56
#5  0x000000000047edd3 in destroy (geom=0x10d08980) at /usr/local/include/geos/geom/prep/PreparedGeometryFactory.h:75
#6  geometry_builder::build_both (this=0x6ce5b0, xnodes=<optimized out>, xcount=<optimized out>, make_polygon=1, enable_multi=0,
    split_at=<optimized out>, osm_id=280282) at geometry-builder.cpp:711
#7  0x0000000000451843 in output_pgsql_t::pgsql_out_relation (this=0x6ce3a0, id=4294967295, rel_tags=0x555e5d0, member_count=-10960,
    xnodes=0x10b9f600, xtags=0xfd7ccd8, xcount=0xf709a40, xid=0xf2d8e50, xrole=0x10b9f600, pending=false) at output-pgsql.cpp:190
#8  0x0000000000452344 in output_pgsql_t::pgsql_process_relation (this=0x12861a80, id=4294967295, members=0xa41, member_count=2625,
    tags=0x10b9f600, exists=310778384, pending=false) at output-pgsql.cpp:522
#9  0x00000000004526e3 in output_pgsql_t::relation_add (this=0x6ce3a0, id=280282, members=0x5566920, member_count=2625, tags=0x555e5d0)
    at output-pgsql.cpp:552
#10 0x0000000000427b4f in osmdata_t::relation_add (this=this@entry=0x7fffffffd9e0, id=280282, members=0x5566920, member_count=2625,
    tags=tags@entry=0x555e5d0) at osmdata.cpp:61
#11 0x000000000046271b in parse_pbf_t::processOsmDataRelations (this=this@entry=0x555e570, osmdata=osmdata@entry=0x7fffffffd9e0,
    group=group@entry=0x8be6220, string_table=string_table@entry=0x8841ad0) at parse-pbf.cpp:467
#12 0x000000000046291d in parse_pbf_t::processOsmData (this=this@entry=0x555e570, osmdata=osmdata@entry=0x7fffffffd9e0,
    data=data@entry=0x7ffd19504010, length=<optimized out>) at parse-pbf.cpp:510
#13 0x0000000000462d9d in parse_pbf_t::streamFile (this=0x555e570, filename=<optimized out>, osmdata=0x7fffffffd9e0) at parse-pbf.cpp:583
#14 0x000000000045f52e in parse_delegate_t::streamFile (this=this@entry=0x7fffffffda10, input_reader=<optimized out>,
    filename=0x6cde58 "planet-latest.osm.pbf", sanitize=0, osmdata=osmdata@entry=0x7fffffffd9e0) at parse.cpp:39
#15 0x000000000040f829 in main (argc=<optimized out>, argv=<optimized out>) at osm2pgsql.cpp:107
pnorman commented 9 years ago

What geos version?

molind commented 9 years ago

OS, Ubuntu 14.10, all libs is updated to recent version.

geos version is 3.4.2

molind commented 9 years ago

Seems that's was my hardware issue. RAM showed errors during memtest. And during huge memory usage error popped up.

Safe to close this issue.