osmcode / osmcoastline

Extracts coastline data from OpenStreetMap planet file.
https://osmcode.org/osmcoastline/
GNU General Public License v3.0
108 stars 14 forks source link

test-invalid-complex-overlap failure #39

Closed sebastic closed 3 years ago

sebastic commented 3 years ago

As reported by Graham Inggs in Debian Bug #977868, the osmcoastline package fails to build in Debian unstable due to test-invalid-complex-overlap failing:

 1/19 Test  #1: test-invalid-complex-overlap .............................***Failed    0.36 sec
+ cat
+ /build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/src/osmcoastline --verbose --overwrite --output-database=/build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.db /build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.opl
+ RC=139
+ set -e
+ test 139 -eq 2

A possible cause is the upgrade of GEOS to 3.9.0.

Output of the test command:

[ 0:00] Started osmcoastline version 2.2.4 / libosmium version 2.15.6
[ 0:00] Using SRS 4326 for output. (Change with the --srs/s option.)
[ 0:00] Writing to output database '/build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.db'. (Was set with the --output-database/-o option.)
[ 0:00] Removing database output file (if it exists) (because you told me to with --overwrite/-f).
[ 0:00] Will create geometry index. (If you do not want an index use --no-index/-i.)
        - 'VirtualXPath'        [XML Path Language - XPath]
[ 0:00] Reading from file '/build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.opl'.
[ 0:00] Reading ways (1st pass through input file)...
[ 0:00]   There are 2 nodes where the coastline is not closed.
[ 0:00]   There are 2 coastline rings (0 from a single closed way and 2 others).
[ 0:00] Memory used: current: 320 MBytes, peak: 385 MBytes
[ 0:00] Reading nodes (2nd pass through input file)...
[ 0:00] Checking for missing locations...
[ 0:00]   All locations are there.
[ 0:00] Memory used: current: 328 MBytes, peak: 385 MBytes
[ 0:00] Check line segments for intersections and overlaps...
[ 0:00] Trying to close Antarctica ring...
[ 0:00]   Did not find open Antarctica ring.
[ 0:00] Close broken rings... (Use --close-distance/-c 0 if you do not want this.)
[ 0:00]   Closing if distance between nodes smaller than 1. (Set this with --close-distance/-c.)
[ 0:00]   Closed 1 rings. This left 0 nodes where the coastline could not be closed.
[ 0:00] Not writing out rings. (Use option --output-rings/-r if you want the rings.)
[ 0:00] Create polygons...
Warning 1: Self-intersection at or near point 1 1.05
Segmentation fault

Backtraces:

(gdb) bt
#0  0x00005555555a92da in is_valid_polygon (geometry=0x555555add0e0) at ./src/coastline_ring_collection.cpp:135
#1  0x00005555555aa6e7 in CoastlineRingCollection::add_polygons_to_vector (this=0x7fffffffd870) at ./src/coastline_ring_collection.cpp:152
#2  0x000055555557ade7 in create_polygons (coastline_rings=..., output=..., warnings=0x7fffffffd7b8, errors=0x7fffffffd7bc) at ./src/osmcoastline.cpp:76
#3  0x0000555555576dd8 in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/10/bits/unique_ptr.h:173
(gdb) bt full
#1  0x00005555555aa6e7 in CoastlineRingCollection::add_polygons_to_vector (this=0x7fffffffd870) at ./src/coastline_ring_collection.cpp:152
        geom = std::unique_ptr<OGRGeometry> = {get() = 0x555555add0e0}
        p = std::unique_ptr<OGRPolygon> = {get() = 0x555555adaef0}
        ring = std::shared_ptr<CoastlineRing> (use count 1, weak count 0) = {get() = 0x7fffe8000bf0}
        __for_range = std::__cxx11::list = {[0] = std::shared_ptr<CoastlineRing> (use count 1, weak count 0) = {get() = 0x7fffe8000bf0}, [1] = std::shared_ptr<CoastlineRing> (use count 1, weak count 0) = {get() = 0x5555559ed480}}
Python Exception <class 'gdb.error'> value has been optimized out: 
        __for_begin = 
Python Exception <class 'gdb.error'> value has been optimized out: 
        __for_end = 
        vector = std::vector of length 0, capacity 2
#2  0x000055555557ade7 in create_polygons (coastline_rings=..., output=..., warnings=0x7fffffffd7b8, errors=0x7fffffffd7bc) at ./src/osmcoastline.cpp:76
        all_polygons = std::vector of length 0, capacity 2
        is_valid = 0
        options = {0x7ffff68bace0 "\002", 0x0}
        mega_geometry = std::unique_ptr<OGRGeometry> = {get() = <optimized out>}
        polygons = std::vector of length 0, capacity 0 = {<error reading variable polygons (Cannot access memory at address 0x1)>
#3  0x0000555555576dd8 in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/10/bits/unique_ptr.h:173
        coastline_polygons = {m_output = @0x0, m_expand = 0, m_max_points_in_polygon = -402650080, m_polygons = std::vector of length -108596, capacity -11728124739830 = {std::unique_ptr<OGRPolygon> = {get() = 0x50}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x4f20545245534e49}, std::unique_ptr<OGRPolygon> = {get() = 0x43414c5045522052}, std::unique_ptr<OGRPolygon> = {get() = 0x27204f544e492045}, std::unique_ptr<OGRPolygon> = {
              get() = 0x69272e276e69616d}, std::unique_ptr<OGRPolygon> = {get() = 0x726f7272655f7864}, std::unique_ptr<OGRPolygon> = {get() = 0x5f73746e696f705f}, std::unique_ptr<OGRPolygon> = {get() = 0x595254454d4f4547}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x27746e657261705f}, std::unique_ptr<OGRPolygon> = {get() = 0x285345554c415620}, std::unique_ptr<OGRPolygon> = {get() = 0x29323f202c313f}, std::unique_ptr<OGRPolygon> = {
              get() = 0x91}, std::unique_ptr<OGRPolygon> = {get() = 0x78}, std::unique_ptr<OGRPolygon> = {get() = 0xb7e}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac0348}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555ac0888}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a93058}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac12b8}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {
              get() = 0x555555ac0828}, std::unique_ptr<OGRPolygon> = {get() = 0x656e696c5f786469}, std::unique_ptr<OGRPolygon> = {get() = 0x54454d4f45475f73}, std::unique_ptr<OGRPolygon> = {get() = 0x22005952}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x61}, std::unique_ptr<OGRPolygon> = {get() = 0x48}, std::unique_ptr<OGRPolygon> = {get() = 0x5555559dde08}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x55555598c728}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a31808}, std::unique_ptr<OGRPolygon> = {get() = 0x10}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x301}, std::unique_ptr<OGRPolygon> = {get() = 0x5555559dde40}, std::unique_ptr<OGRPolygon> = {get() = 0x5555559dde78}, std::unique_ptr<OGRPolygon> = {get() = 0x5555559ddeb0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x6f6e0057454e}, std::unique_ptr<OGRPolygon> = {get() = 0x71}, std::unique_ptr<OGRPolygon> = {get() = 0x60}, std::unique_ptr<OGRPolygon> = {get() = 0xb88}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555ac0688}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac03c8}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {
              get() = 0x555555a93f78}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x51}, std::unique_ptr<OGRPolygon> = {get() = 0x38}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x800000000}, std::unique_ptr<OGRPolygon> = {get() = 0x300000001}, std::unique_ptr<OGRPolygon> = {get() = 0x20000313f}, std::unique_ptr<OGRPolygon> = {get() = 0x5f00323f00000003}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x595254454d4f4547}, std::unique_ptr<OGRPolygon> = {get() = 0x20474e4953552022}, std::unique_ptr<OGRPolygon> = {get() = 0x6b70286565727472}, std::unique_ptr<OGRPolygon> = {
              get() = 0x6e696d78202c6469}, std::unique_ptr<OGRPolygon> = {get() = 0x21}, std::unique_ptr<OGRPolygon> = {get() = 0x8}, std::unique_ptr<OGRPolygon> = {get() = 0x736e6f6974706f}, std::unique_ptr<OGRPolygon> = {
              get() = 0x20}, std::unique_ptr<OGRPolygon> = {get() = 0x31}, std::unique_ptr<OGRPolygon> = {get() = 0x8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a90044}, std::unique_ptr<OGRPolygon> = {
              get() = 0x736e6d756c6f635f}, std::unique_ptr<OGRPolygon> = {get() = 0x5900}, std::unique_ptr<OGRPolygon> = {get() = 0x30}, std::unique_ptr<OGRPolygon> = {get() = 0x31}, std::unique_ptr<OGRPolygon> = {get() = 0x18}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x656e696c5f756967}, std::unique_ptr<OGRPolygon> = {get() = 0x54454d4f45475f73}, std::unique_ptr<OGRPolygon> = {get() = 0x22005952}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x21}, std::unique_ptr<OGRPolygon> = {get() = 0x10}, std::unique_ptr<OGRPolygon> = {get() = 0x544e490064696b70}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x31}, std::unique_ptr<OGRPolygon> = {get() = 0x20}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a3a6d8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a9f638}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555a52058}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a8fb88}, std::unique_ptr<OGRPolygon> = {get() = 0x51}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac4b90}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac0fb8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a0a8d0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555a113f8}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {
              get() = 0x41}, std::unique_ptr<OGRPolygon> = {get() = 0x30}, std::unique_ptr<OGRPolygon> = {get() = 0x555555adb1b8}, std::unique_ptr<OGRPolygon> = {get() = 0xd00000020}, std::unique_ptr<OGRPolygon> = {get() = 0x3}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a367b8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555acc8b8}, std::unique_ptr<OGRPolygon> = {get() = 0x21}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x10}, std::unique_ptr<OGRPolygon> = {get() = 0x414552006e696d78}, std::unique_ptr<OGRPolygon> = {get() = 0x4c}, std::unique_ptr<OGRPolygon> = {get() = 0x31}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x8}, std::unique_ptr<OGRPolygon> = {get() = 0x7f0042424444}, std::unique_ptr<OGRPolygon> = {get() = 0x6f0000000073656e}, std::unique_ptr<OGRPolygon> = {get() = 0x5952544500007972}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x30}, std::unique_ptr<OGRPolygon> = {get() = 0x91}, std::unique_ptr<OGRPolygon> = {get() = 0x80}, std::unique_ptr<OGRPolygon> = {get() = 0x555555aa1228}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x5555559e0338}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {
              get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x100000000}, std::unique_ptr<OGRPolygon> = {get() = 0x5ffff00000000}, std::unique_ptr<OGRPolygon> = {get() = 0xc80000}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x800000000}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac0d68}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a52258}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555967aa8}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x151}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a78330}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x5555555cb010}, std::unique_ptr<OGRPolygon> = {get() = 0x69616d27204f544e}, std::unique_ptr<OGRPolygon> = {get() = 0x74696c71732e276e}, std::unique_ptr<OGRPolygon> = {
              get() = 0x72657473616d5f65}, std::unique_ptr<OGRPolygon> = {get() = 0x285345554c415620}, std::unique_ptr<OGRPolygon> = {get() = 0x7265676769727427}, std::unique_ptr<OGRPolygon> = {get() = 0x6c5f646967272c27}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x4f45475f73656e69}, std::unique_ptr<OGRPolygon> = {get() = 0x272c27595254454d}, std::unique_ptr<OGRPolygon> = {get() = 0x302c2773656e696c}, std::unique_ptr<OGRPolygon> = {
              get() = 0x455441455243272c}, std::unique_ptr<OGRPolygon> = {get() = 0x5245474749525420}, std::unique_ptr<OGRPolygon> = {get() = 0x696c5f6469672220}, std::unique_ptr<OGRPolygon> = {get() = 0x4d4f45475f73656e}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x4641202259525445}, std::unique_ptr<OGRPolygon> = {get() = 0x454c454420524554}, std::unique_ptr<OGRPolygon> = {get() = 0x6c22204e4f204554}, std::unique_ptr<OGRPolygon> = {
              get() = 0x4f460a2273656e69}, std::unique_ptr<OGRPolygon> = {get() = 0x5220484341452052}, std::unique_ptr<OGRPolygon> = {get() = 0x4e4947454220574f}, std::unique_ptr<OGRPolygon> = {get() = 0x204554454c45440a}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x646922204d4f5246}, std::unique_ptr<OGRPolygon> = {get() = 0x5f73656e696c5f78}, std::unique_ptr<OGRPolygon> = {get() = 0x595254454d4f4547}, std::unique_ptr<OGRPolygon> = {
              get() = 0x2045524548572022}, std::unique_ptr<OGRPolygon> = {get() = 0x444c4f3d64696b70}, std::unique_ptr<OGRPolygon> = {get() = 0xa3b4449574f522e}, std::unique_ptr<OGRPolygon> = {get() = 0x2927444e45}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555a901b8}, std::unique_ptr<OGRPolygon> = {get() = 0x7fff00000000}, std::unique_ptr<OGRPolygon> = {get() = 0x55555591f0e8}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x55555591f0e8}, std::unique_ptr<OGRPolygon> = {get() = 0x800010080}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a52eb8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a52eb8}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {get() = 0x55555591f0e8}, std::unique_ptr<OGRPolygon> = {get() = 0xfffffffd00000000}, std::unique_ptr<OGRPolygon> = {get() = 0xfffffffd}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x61}, std::unique_ptr<OGRPolygon> = {get() = 0x48}, std::unique_ptr<OGRPolygon> = {get() = 0x5555559f4e38}, std::unique_ptr<OGRPolygon> = {get() = 0x7ffff4834822}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x555555a10578}, std::unique_ptr<OGRPolygon> = {get() = 0x555555ac24b8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a77578}, std::unique_ptr<OGRPolygon> = {
              get() = 0x555555a93cf8}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a8fb68}, std::unique_ptr<OGRPolygon> = {get() = 0x555555a8fa48}, std::unique_ptr<OGRPolygon> = {get() = 0x0}, std::unique_ptr<OGRPolygon> = {
              get() = 0x6469776f72}, std::unique_ptr<OGRPolygon> = {get() = 0x61}, std::unique_ptr<OGRPolygon> = {get() = 0x50}, std::unique_ptr<OGRPolygon> = {get() = 0x70205443454c4553}, std::unique_ptr<OGRPolygon> = {
              get() = 0x646f6e746e657261}, std::unique_ptr<OGRPolygon> = {get() = 0x27204d4f52462065}, std::unique_ptr<OGRPolygon> = {get() = 0x69272e276e69616d}, std::unique_ptr<OGRPolygon> = {get() = 0x73656e696c5f7864}, 
            std::unique_ptr<OGRPolygon> = {get() = 0x5254454d4f45475f}, std::unique_ptr<OGRPolygon> = {get() = 0x746e657261705f59}...}, m_max_split_depth = 16}
        stats = {ways = 6, unconnected_nodes = 2, rings = 2, rings_from_single_way = 0, rings_fixed = 1, rings_turned_around = 0, land_polygons_before_split = 0, land_polygons_after_split = 0}
        warnings = 3
        errors = 1
        options = {inputfile = "/build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.opl", bbox_overlap = 0.0001, close_distance = 1, close_rings = true, create_index = true, debug = false, 
          max_points_in_polygon = 1000, split_large_polygons = true, output_polygons = output_polygon_type::land, output_database = "/build/osmcoastline-2.2.4/obj-x86_64-linux-gnu/test/invalid-complex-overlap.db", 
          overwrite_output = true, output_rings = false, output_lines = false, epsg = 4326, simplify = false, tolerance = 0, verbose = true, segmentfile = ""}
        vout = {m_start = 1608623782, m_verbose = true, m_newline = true}
        segments_fd = -1
        output_database = std::unique_ptr<OutputDatabase> = {get() = 0x55555562d710}
        coastline_rings = {m_list = std::__cxx11::list = {[0] = std::shared_ptr<CoastlineRing> (use count 1, weak count 0) = {get() = 0x7fffe8000bf0}, [1] = std::shared_ptr<CoastlineRing> (use count 1, weak count 0) = {
              get() = 0x5555559ed480}}, m_start_nodes = std::map with 0 elements, m_end_nodes = std::map with 0 elements, m_ways = 6, m_rings_from_single_way = 0, m_fixed_rings = 1, m_factory = {m_projection = {<No data fields>}, 
            m_impl = {m_linestring = std::unique_ptr<OGRLineString> = {get() = 0x0}, m_multipolygon = std::unique_ptr<OGRMultiPolygon> = {get() = 0x0}, m_polygon = std::unique_ptr<OGRPolygon> = {get() = 0x0}, 
              m_ring = std::unique_ptr<OGRLinearRing> = {get() = 0x0}}}}
        missing_locations = 0