Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#809 closed defect (worksforme)

Test failure with MinimumClearanceLine with geos 3.6.1

Reported by: goatbar Owned by: geos-devel@…
Priority: major Milestone: 3.6.3
Component: Default Version: 3.6.0
Severity: Unassigned Keywords: MinimumClearanceLine
Cc:

Description

I'm getting a failure that I've yet to understand with the source from 3.6.1. I'm in a custom linux env. Before I try going back to ubuntu 14.04 or a mac, anyone have an idea what is going on?

geos_unittest capi::GEOSMinimumClearance
===============================
  GEOS Test Suite Application
===============================
input: 0106000000010000000103000000010000001a00000035d42824992d5cc01b834e081dca404073b9c150872d5cc03465a71fd4c940400ec00644882d5cc03b8a73d4d1c94040376dc669882d5cc0bf9cd9aed0c940401363997e892d5cc002f4fbfecdc94040ca4e3fa88b2d5cc0a487a1d5c9c940408f1ce90c8c2d5cc0698995d1c8c94040fab836548c2d5cc0bd175fb4c7c940409f1f46088f2d5cc0962023a0c2c940407b15191d902d5cc068041bd7bfc940400397c79a912d5cc0287d21e4bcc940403201bf46922d5cc065e3c116bbc940409d9d0c8e922d5cc0060fd3beb9c940400ef7915b932d5cc09012bbb6b7c940404fe61f7d932d5cc0e4a08499b6c94040fc71fbe5932d5cc0ea9106b7b5c94040eaec6470942d5cc0c2323674b3c94040601dc70f952d5cc043588d25acc94040aea06989952d5cc03ecf9f36aac94040307f85cc952d5cc0e5eb32fca7c94040dd0a6135962d5cc01b615111a7c9404048a7ae7c962d5cc00a2aaa7ea5c94040f4328ae5962d5cc05eb87361a4c94040c49448a2972d5cc04d81cccea2c940407c80eecb992d5cc06745d4449fc9404035d42824992d5cc01b834e081dca4040
expected: LINESTRING (-112.712119 33.575919, -112.712127 33.575885)
NOTICE: ParseException: Invalid HEX char

capi::GEOSMinimumClearance: [4=F]input: POLYGON EMPTY
expected: LINESTRING EMPTY
.

---> group: capi::GEOSMinimumClearance, test: test<4>
     problem: assertion failed
     failed assertion: "input must not be null: GEOSGeomFromHEX_buf"

My tweaked test setup:

        void testClearance(const std::string & wkx_input,
                           const std::string & wkx_expected,
                           double clearance) {

            std::cerr << "input: " << wkx_input << "\n";
            std::cerr << "expected: " << wkx_expected << "\n";
            GEOSGeometry* input = NULL;
            GEOSGeometry* expected_result = NULL;
            if (wkx_input[0] == '0') {
                input = GEOSGeomFromHEX_buf((const unsigned char*) wkx_input.c_str(), wkx_input.length());
                ensure("input must not be null: GEOSGeomFromHEX_buf", input != NULL);
            } else {
                input = GEOSGeomFromWKT(wkx_input.c_str());
                ensure("input must not be null: GEOSGeomFromWKT", input != NULL);
            }

            if (wkx_expected[0] == '0')
                expected_result = GEOSGeomFromHEX_buf((const unsigned char*) wkx_expected.c_str(), wkx_expected.length());
            else
                expected_result = GEOSGeomFromWKT(wkx_expected.c_str());

            double d;
            int error = GEOSMinimumClearance(input, &d);

            ensure(!error);
            if (clearance == std::numeric_limits<double>::infinity()) {
                ensure(d == clearance);
            } else {
                ensure_equals("clearance", d, clearance, 1e-12);
            }

            GEOSGeometry* result = GEOSMinimumClearanceLine(input);
            ensure(result != NULL);
            ensure_equals(1, GEOSEquals(result, expected_result));

            GEOSGeom_destroy(input);
            GEOSGeom_destroy(expected_result);
            GEOSGeom_destroy(result);
        }

Poking around with gdal built against 3.5.0:

geom = ogr.CreateGeometryFromWkb("""\x01\x06\x00\x00\x00\x01\x00\x00\x00\x01\x03\x00\x00\x00\x01\x00\x00\x00\x1a\x00\x00\x00\x35\xd4\x28\x24\x99\x2d\x5c\xc0\x1b\x83\x4e\x08\x1d\xca\x40\x40\x73\xb9\xc1\x50\x87\x2d\x5c\xc0\x34\x65\xa7\x1f\xd4\xc9\x40\x40\x0e\xc0\x06\x44\x88\x2d\x5c\xc0\x3b\x8a\x73\xd4\xd1\xc9\x40\x40\x37\x6d\xc6\x69\x88\x2d\x5c\xc0\xbf\x9c\xd9\xae\xd0\xc9\x40\x40\x13\x63\x99\x7e\x89\x2d\x5c\xc0\x02\xf4\xfb\xfe\xcd\xc9\x40\x40\xca\x4e\x3f\xa8\x8b\x2d\x5c\xc0\xa4\x87\xa1\xd5\xc9\xc9\x40\x40\x8f\x1c\xe9\x0c\x8c\x2d\x5c\xc0\x69\x89\x95\xd1\xc8\xc9\x40\x40\xfa\xb8\x36\x54\x8c\x2d\x5c\xc0\xbd\x17\x5f\xb4\xc7\xc9\x40\x40\x9f\x1f\x46\x08\x8f\x2d\x5c\xc0\x96\x20\x23\xa0\xc2\xc9\x40\x40\x7b\x15\x19\x1d\x90\x2d\x5c\xc0\x68\x04\x1b\xd7\xbf\xc9\x40\x40\x03\x97\xc7\x9a\x91\x2d\x5c\xc0\x28\x7d\x21\xe4\xbc\xc9\x40\x40\x32\x01\xbf\x46\x92\x2d\x5c\xc0\x65\xe3\xc1\x16\xbb\xc9\x40\x40\x9d\x9d\x0c\x8e\x92\x2d\x5c\xc0\x06\x0f\xd3\xbe\xb9\xc9\x40\x40\x0e\xf7\x91\x5b\x93\x2d\x5c\xc0\x90\x12\xbb\xb6\xb7\xc9\x40\x40\x4f\xe6\x1f\x7d\x93\x2d\x5c\xc0\xe4\xa0\x84\x99\xb6\xc9\x40\x40\xfc\x71\xfb\xe5\x93\x2d\x5c\xc0\xea\x91\x06\xb7\xb5\xc9\x40\x40\xea\xec\x64\x70\x94\x2d\x5c\xc0\xc2\x32\x36\x74\xb3\xc9\x40\x40\x60\x1d\xc7\x0f\x95\x2d\x5c\xc0\x43\x58\x8d\x25\xac\xc9\x40\x40\xae\xa0\x69\x89\x95\x2d\x5c\xc0\x3e\xcf\x9f\x36\xaa\xc9\x40\x40\x30\x7f\x85\xcc\x95\x2d\x5c\xc0\xe5\xeb\x32\xfc\xa7\xc9\x40\x40\xdd\x0a\x61\x35\x96\x2d\x5c\xc0\x1b\x61\x51\x11\xa7\xc9\x40\x40\x48\xa7\xae\x7c\x96\x2d\x5c\xc0\x0a\x2a\xaa\x7e\xa5\xc9\x40\x40\xf4\x32\x8a\xe5\x96\x2d\x5c\xc0\x5e\xb8\x73\x61\xa4\xc9\x40\x40\xc4\x94\x48\xa2\x97\x2d\x5c\xc0\x4d\x81\xcc\xce\xa2\xc9\x40\x40\x7c\x80\xee\xcb\x99\x2d\x5c\xc0\x67\x45\xd4\x44\x9f\xc9\x40\x40\x35\xd4\x28\x24\x99\x2d\x5c\xc0\x1b\x83\x4e\x08\x1d\xca\x40\x40""")

geom.ExportToWkt()
Out[4]: 'MULTIPOLYGON (((-112.712472 33.579011,-112.711384 33.576786,-112.711442 33.576716,-112.711451 33.576681,-112.711517 33.576599,-112.711649 33.576472,-112.711673 33.576441,-112.71169 33.576407,-112.711855 33.576252,-112.711921 33.576167,-112.712012 33.576077,-112.712053 33.576022,-112.71207 33.575981,-112.712119 33.575919,-112.712127 33.575885,-112.712152 33.575858,-112.712185 33.575789,-112.712223 33.575566,-112.712252 33.575507,-112.712268 33.575439,-112.712293 33.575411,-112.71231 33.575363,-112.712335 33.575329,-112.71238 33.575281,-112.712512 33.575173,-112.712472 33.579011)))'

Change History (7)

comment:1 by goatbar, 7 years ago

Still investigating. Not surprising, I'm getting a failure on WKB reading.

geos_unittest geos::io::WKBReader
===============================
  GEOS Test Suite Application
===============================

geos::io::WKBReader: [1=X][2=X][3=X][4=X][5=X][6=X][7=X][8=F][9=X]

---> group: geos::io::WKBReader, test: test<1>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<2>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<3>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<4>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<5>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<6>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<7>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

---> group: geos::io::WKBReader, test: test<8>
     problem: assertion failed
     failed assertion: "Values are not equal: expected 'ParseException: Premature end of HEX string' actual 'ParseException: Invalid HEX char'"

---> group: geos::io::WKBReader, test: test<9>
     problem: unexpected exception
     exception typeid: N4geos2io14ParseExceptionE
     message: "ParseException: Invalid HEX char"

tests summary: exceptions:8 failures:1 ok:0

comment:2 by strk, 7 years ago

try taking those hex strings outside of the source code and feed them to another hex reader. Maybe the sources got corrupted somehow ?

comment:3 by strk, 7 years ago

Milestone: 3.6.13.6.2

Ticket retargeted after milestone closed

comment:4 by strk, 7 years ago

Milestone: 3.6.23.6.3

Ticket retargeted after milestone closed

comment:5 by robe, 6 years ago

Milestone: 3.6.33.6.4

goatbar still an issue?

comment:6 by goatbar, 6 years ago

Resolution: worksforme
Status: newclosed

Tested with default build, msan and asan. All work for me. Thanks for the ping on the bug.

comment:7 by robe, 6 years ago

Milestone: 3.6.43.6.3

Switching back to 3.6.3 as I presume it was fixed then. Feel free to switch to 3.7.0 or 3.6.4 if that is incorrect.

Note: See TracTickets for help on using tickets.