mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Misusage of protozero #197

Closed springmeyer closed 8 years ago

springmeyer commented 8 years ago

Seeing:

tests: ../deps/protozero/include/protozero/pbf_reader.hpp:876: bool protozero::pbf_reader::next(): Assertion `((m_tag > 0 && m_tag < 19000) || (m_tag > 19999 && m_tag <= ((1 << 29) - 1))) && "tag out of range"' failed.

We were not hitting this before https://github.com/mapbox/mapnik-vector-tile/commit/3481fb2783163e09100c34b09f14398f4b835c70 because Debug builds were not working properly. The release flags from mapnik-config were sneaking in and disabling asserts.

springmeyer commented 8 years ago

By disabling the catch.hpp signal handler (https://gist.github.com/springmeyer/0913a311919fd4e95e6651475fe4f508) I can see the problem is in the test_utils::round_trip code:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff9795a002 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff902c15c5 pthread_kill + 90
2   libsystem_c.dylib               0x00007fff8a7376e7 abort + 129
3   libsystem_c.dylib               0x00007fff8a6fedf8 __assert_rtn + 321
4   tests                           0x00000001094a05de protozero::pbf_reader::next() + 734 (pbf_reader.hpp:876)
5   tests                           0x0000000109a962f8 test_utils::round_trip(mapnik::geometry::geometry<double> const&, double, mapnik::vector_tile_impl::polygon_fill_type, bool) + 9656 (round_trip.cpp:74)
6   tests                           0x00000001096f273b ____C_A_T_C_H____T_E_S_T____10() + 7579 (remove_repeated_point.cpp:17)
7   tests                           0x0000000109776024 Catch::FreeFunctionTestCase::invoke() const + 68 (catch.hpp:5825)
8   tests                           0x0000000109741adc Catch::TestCase::invoke() const + 140 (catch.hpp:6730)
9   tests                           0x0000000109856dd4 Catch::RunContext::invokeActiveTestCase() + 276 (catch.hpp:5424)
10  tests                           0x000000010984d283 Catch::RunContext::runCurrentTest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 2467 (catch.hpp:5395)
11  tests                           0x000000010982a8d1 Catch::RunContext::runTest(Catch::TestCase const&) + 1569 (catch.hpp:5234)
12  tests                           0x00000001097fece7 Catch::Runner::runTests() + 7431 (catch.hpp:5553)
13  tests                           0x00000001097d5492 Catch::Session::run() + 946 (catch.hpp:5684)
14  tests                           0x000000010976d5c0 Catch::Session::run(int, char* const*) + 80 (catch.hpp:5664)
15  tests                           0x000000010976d3d8 main + 920 (test_main.cpp:19)
16  libdyld.dylib                   0x00007fff95b185ad start + 1