Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Segfault in unit test: QueryFeatureExtensionsSuperclusterChildren #15881

Closed
springmeyer opened this issue Nov 1, 2019 · 3 comments
Closed

Segfault in unit test: QueryFeatureExtensionsSuperclusterChildren #15881

springmeyer opened this issue Nov 1, 2019 · 3 comments
Labels
Core The cross-platform C++ core, aka mbgl crash

Comments

@springmeyer
Copy link
Contributor

springmeyer commented Nov 1, 2019

When running make run-test on OS X I'm seeing a segfault.

Platform: Mac OS X 10.15.1
Mapbox SDK version: HEAD@5b38cfe

▶ xcodebuild -version
Xcode 11.0
Build version 11A420a

I reduced the segfault to:

build/macos/Debug/mbgl-test --gtest_catch_exceptions=0 --gtest_filter='*QueryFeatureExtensionsSuperclusterChildren*'

Happens every time.

Running with lldb gives:

▶ lldb -- build/macos/Debug/mbgl-test --gtest_catch_exceptions=0 --gtest_filter='*QueryFeatureExtensionsSuperclusterChildren*'
(lldb) target create "build/macos/Debug/mbgl-test"
Current executable set to 'build/macos/Debug/mbgl-test' (x86_64).
(lldb) settings set -- target.run-args  "--gtest_catch_exceptions=0" "--gtest_filter=*QueryFeatureExtensionsSuperclusterChildren*"
(lldb) r
Process 13983 launched: '/Users/danespringmeyer/projects/mapbox-gl-native/build/macos/Debug/mbgl-test' (x86_64)
Note: Google Test filter = *QueryFeatureExtensionsSuperclusterChildren*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Query
[ RUN      ] Query.QueryFeatureExtensionsSuperclusterChildren
2019-11-01 12:58:53.290892-0700 mbgl-test[13983:667462] [INFO] {}[General]: GPU Identifier: Intel(R) Iris(TM) Plus Graphics 650
Process 13983 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010009b94a mbgl-test`std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value> > >::__hash_table(this=0x000000010bb02120, __u=0x000000010a024b50) at __hash_table:1496:91
   1493	{
   1494	    if (size() > 0)
   1495	    {
-> 1496	        __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
   1497	            __p1_.first().__ptr();
   1498	        __u.__p1_.first().__next_ = nullptr;
   1499	        __u.size() = 0;

The backtrace is:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x000000010009b94a mbgl-test`std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value> > >::__hash_table(this=0x000000010bb02120, __u=0x000000010a024b50) at __hash_table:1496:91
    frame #1: 0x000000010009b82d mbgl-test`std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value> > >::__hash_table(this=0x000000010bb02120, __u=0x000000010a024b50) at __hash_table:1493:1
    frame #2: 0x000000010009b7f0 mbgl-test`std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, mapbox::feature::value> > >::unordered_map(this=0x000000010bb02120 size=11, __u=size=11) at unordered_map:1453:7
    frame #3: 0x000000010009b78d mbgl-test`std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, mapbox::feature::value> > >::unordered_map(this=0x000000010bb02120 size=11, __u=size=11) at unordered_map:1454:1
    frame #4: 0x00000001000aa517 mbgl-test`mapbox::feature::feature<double>::feature(this=0x000000010bb02100, (null)=0x000000010a024b30) at feature.hpp:96:8
    frame #5: 0x00000001000c2e9d mbgl-test`mapbox::feature::feature<double>::feature(this=0x000000010bb02100, (null)=0x000000010a024b30) at feature.hpp:96:8
    frame #6: 0x00000001000c2e71 mbgl-test`void std::__1::allocator<mapbox::feature::feature<double> >::construct<mapbox::feature::feature<double>, mapbox::feature::feature<double> >(this=0x00007ffeefbfb3d8, __p=0x000000010bb02100, __args=0x000000010a024b30) at memory:1826:31
    frame #7: 0x00000001000c2e20 mbgl-test`void std::__1::allocator_traits<std::__1::allocator<mapbox::feature::feature<double> > >::__construct<mapbox::feature::feature<double>, mapbox::feature::feature<double> >((null)=std::__1::true_type @ 0x00007ffeefbfb198, __a=0x00007ffeefbfb3d8, __p=0x000000010bb02100, __args=0x000000010a024b30) at memory:1718:18
    frame #8: 0x00000001000c2db0 mbgl-test`void std::__1::allocator_traits<std::__1::allocator<mapbox::feature::feature<double> > >::construct<mapbox::feature::feature<double>, mapbox::feature::feature<double> >(__a=0x00007ffeefbfb3d8, __p=0x000000010bb02100, __args=0x000000010a024b30) at memory:1561:14
    frame #9: 0x00000001000c2c16 mbgl-test`void std::__1::allocator_traits<std::__1::allocator<mapbox::feature::feature<double> > >::__construct_backward<mapbox::feature::feature<double>*>(__a=0x00007ffeefbfb3d8, __begin1=0x000000010a020a00, __end1=0x000000010a024b30, __end2=0x00007ffeefbfb2a8) at memory:1680:17
    frame #10: 0x00000001000c259b mbgl-test`std::__1::vector<mapbox::feature::feature<double>, std::__1::allocator<mapbox::feature::feature<double> > >::__swap_out_circular_buffer(this=0x00007ffeefbfb3c8 size=0, __v=0x00007ffeefbfb2a0) at vector:938:5
    frame #11: 0x000000010072916c mbgl-test`void std::__1::vector<mapbox::feature::feature<double>, std::__1::allocator<mapbox::feature::feature<double> > >::__push_back_slow_path<mapbox::feature::feature<double> >(this=0x00007ffeefbfb3c8 size=0, __x=0x00007ffeefbfb528) at vector:1622:5
    frame #12: 0x000000010163ff6a mbgl-test`std::__1::vector<mapbox::feature::feature<double>, std::__1::allocator<mapbox::feature::feature<double> > >::push_back(this=0x00007ffeefbfb3c8 size=0, __x=0x00007ffeefbfb528) at vector:1659:9
    frame #13: 0x000000010163fc97 mbgl-test`mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > mapbox::geojson::convert<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > >(json=0x00007ffeefbfb8e0) at geojson_impl.hpp:215:24
    frame #14: 0x000000010164027c mbgl-test`mapbox::geojson::convert(json=0x00007ffeefbfb8e0) at geojson_impl.hpp:251:12
    frame #15: 0x00000001004caaf5 mbgl-test`mbgl::style::conversion::ConversionTraits<rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::CrtAllocator> const*>::toGeoJSON(value=0x00007ffeefbfb8e0, error=0x00007ffeefbfba30) at rapidjson_conversion.hpp:109:20
    frame #16: 0x00000001004caa9b mbgl-test`mbgl::style::conversion::Convertible::VTable* mbgl::style::conversion::Convertible::vtableForType<rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::CrtAllocator> const*>(this=0x00007ffeefbfb850, s=0x00007ffeefbfb850, err=0x00007ffeefbfba30)::'lambda'(std::__1::aligned_storage<8ul, 8ul>::type const&, mbgl::style::conversion::Error&)::operator()(std::__1::aligned_storage<8ul, 8ul>::type const&, mbgl::style::conversion::Error&) const at conversion_impl.hpp:286:24
    frame #17: 0x00000001004caa64 mbgl-test`mbgl::style::conversion::Convertible::VTable* mbgl::style::conversion::Convertible::vtableForType<rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::CrtAllocator> const*>(s=0x00007ffeefbfb850, err=0x00007ffeefbfba30)::'lambda'(std::__1::aligned_storage<8ul, 8ul>::type const&, mbgl::style::conversion::Error&)::__invoke(std::__1::aligned_storage<8ul, 8ul>::type const&, mbgl::style::conversion::Error&) at conversion_impl.hpp:285:13
    frame #18: 0x00000001010303fb mbgl-test`mbgl::style::conversion::toGeoJSON(v=0x00007ffeefbfb848, error=0x00007ffeefbfba30) at conversion_impl.hpp:187:16
    frame #19: 0x0000000101030368 mbgl-test`mbgl::style::conversion::Converter<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> >, void>::operator(this=0x00007ffeefbfb7d8, value=0x00007ffeefbfb848, error=0x00007ffeefbfba30)(mbgl::style::conversion::Convertible const&, mbgl::style::conversion::Error&) const at geojson.cpp:10:12
    frame #20: 0x000000010139d6d8 mbgl-test`std::experimental::optional<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > > mbgl::style::conversion::convert<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > >(value=0x00007ffeefbfb848, error=0x00007ffeefbfba30) at conversion_impl.hpp:298:12
    frame #21: 0x000000010139d126 mbgl-test`std::experimental::optional<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > > mbgl::style::conversion::convert<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > >(value=0x00007ffeefbfb8e0, error=0x00007ffeefbfba30) at rapidjson_conversion.hpp:119:12
    frame #22: 0x000000010139cc4e mbgl-test`std::experimental::optional<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > > mbgl::style::conversion::convertJSON<mapbox::util::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature<double>, mapbox::feature::feature_collection<double, std::__1::vector> > >(json="{\n  \"type\": \"FeatureCollection\",\n  \"features\": [\n    {\n      \"type\": \"Feature\",\n      \"properties\": {\n        \"scalerank\": 2,\n        \"name\": \"Niagara Falls\",\n        \"comment\": null,\n        \"name_alt\": null,\n        \"lat_y\": 43.087653,\n        \"long_x\": -79.044073,\n        \"region\": \"North America\",\n        \"subregion\": null,\n        \"featureclass\": \"waterfall\"\n      },\n      \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [-79.04411780507252, 43.08771393436908]\n      }\n    },\n    {\n      \"type\": \"Feature\",\n      \"properties\": {\n        \"scalerank\": 2,\n        \"name\": \"Salto Angel\",\n        \"comment\": null,\n        \"name_alt\": \"Angel Falls\",\n        \"lat_y\": 5.686836,\n        \"long_x\": -62.061848,\n        \"region\": \"South America\",\n        \"subregion\": null,\n        \"featureclass\": \"waterfall\"\n      },\n      \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [-62.06181800038502, 5.686896063275327]\n      }\n    },\n    {\n      \"type\": \"Feature\",\n      \"properties\": {\n        \"scalerank"..., error=0x00007ffeefbfba30) at json.hpp:22:12
    frame #23: 0x000000010139c772 mbgl-test`mbgl::style::GeoJSONSource::loadDescription(this=0x0000000108762148, res=Response @ 0x00007ffeefbfbbb0)::$_0::operator()(mbgl::Response) const at geojson_source.cpp:65:41
    frame #24: 0x000000010139c4f5 mbgl-test`decltype(__f=0x0000000108762148, __args=0x00007ffeefbfbd68)::$_0&>(fp)(std::__1::forward<mbgl::Response>(fp0))) std::__1::__invoke<mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0&, mbgl::Response>(mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0&, mbgl::Response&&) at type_traits:4361:1
    frame #25: 0x000000010139c472 mbgl-test`void std::__1::__invoke_void_return_wrapper<void>::__call<mbgl::style::GeoJSONSource::loadDescription(__args=0x0000000108762148, __args=0x00007ffeefbfbd68)::$_0&, mbgl::Response>(mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0&, mbgl::Response&&) at __functional_base:349:9
    frame #26: 0x000000010139c422 mbgl-test`std::__1::__function::__alloc_func<mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0, std::__1::allocator<mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0>, void (mbgl::Response)>::operator(this=0x0000000108762148, __arg=0x00007ffeefbfbd68)(mbgl::Response&&) at functional:1527:16
    frame #27: 0x000000010139b1d1 mbgl-test`std::__1::__function::__func<mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0, std::__1::allocator<mbgl::style::GeoJSONSource::loadDescription(mbgl::FileSource&)::$_0>, void (mbgl::Response)>::operator(this=0x0000000108762140, __arg=0x00007ffeefbfbd68)(mbgl::Response&&) at functional:1651:12
    frame #28: 0x000000010017a815 mbgl-test`std::__1::__function::__value_func<void (mbgl::Response)>::operator(this=0x0000000108762140, __args=0x00007ffeefbfbd68)(mbgl::Response&&) const at functional:1799:16
    frame #29: 0x000000010017a478 mbgl-test`std::__1::function<void (mbgl::Response)>::operator(this=0x0000000108762140, __arg=<unavailable>)(mbgl::Response) const at functional:2347:12
    frame #30: 0x0000000100292eac mbgl-test`mbgl::StubFileSource::StubFileSource(this=0x0000000109205858)::$_0::operator()() const at stub_file_source.cpp:44:17
    frame #31: 0x0000000100292ccd mbgl-test`decltype(__f=0x0000000109205858)::$_0&>(fp)()) std::__1::__invoke<mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0&>(mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0&) at type_traits:4361:1
    frame #32: 0x0000000100292c7d mbgl-test`void std::__1::__invoke_void_return_wrapper<void>::__call<mbgl::StubFileSource::StubFileSource(__args=0x0000000109205858)::$_0&>(mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0&) at __functional_base:349:9
    frame #33: 0x0000000100292c4d mbgl-test`std::__1::__function::__alloc_func<mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0, std::__1::allocator<mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0>, void ()>::operator(this=0x0000000109205858)() at functional:1527:16
    frame #34: 0x0000000100291a19 mbgl-test`std::__1::__function::__func<mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0, std::__1::allocator<mbgl::StubFileSource::StubFileSource(mbgl::StubFileSource::ResponseType)::$_0>, void ()>::operator(this=0x0000000109205850)() at functional:1651:12
    frame #35: 0x0000000100013615 mbgl-test`std::__1::__function::__value_func<void ()>::operator(this=0x0000000109205850)() const at functional:1799:16
    frame #36: 0x00000001000135d5 mbgl-test`std::__1::function<void ()>::operator(this=0x0000000109205850)() const at functional:2347:12
    frame #37: 0x000000010176573c mbgl-test`mbgl::util::Timer::Impl::perform((null)=0x000000010920ac30, info=0x0000000109205850) at timer.cpp:39:9
    frame #38: 0x00007fff31c61704 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    frame #39: 0x00007fff31c612be CoreFoundation`__CFRunLoopDoTimer + 859
    frame #40: 0x00007fff31c60cde CoreFoundation`__CFRunLoopDoTimers + 317
    frame #41: 0x00007fff31c41b0d CoreFoundation`__CFRunLoopRun + 2213
    frame #42: 0x00007fff31c40fe3 CoreFoundation`CFRunLoopRunSpecific + 499
    frame #43: 0x000000010175b289 mbgl-test`mbgl::util::RunLoop::runOnce(this=0x00007ffeefbfe998) at run_loop.cpp:41:5
    frame #44: 0x00000001000d5323 mbgl-test`(anonymous namespace)::getTopClusterFeature(test=0x00007ffeefbfe998)::QueryTest&) at query.test.cpp:64:15
    frame #45: 0x00000001000d3209 mbgl-test`Query_QueryFeatureExtensionsSuperclusterChildren_Test::TestBody(this=0x0000000109200d30) at query.test.cpp:192:30
    frame #46: 0x000000010094fc7b mbgl-test`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(object=0x0000000109200d30, method=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="the test body")(), char const*) at gtest.cc:2458:12
    frame #47: 0x000000010094f9a6 mbgl-test`testing::Test::Run(this=0x0000000109200d30) at gtest.cc:2474:5
    frame #48: 0x0000000100950a70 mbgl-test`testing::TestInfo::Run(this=0x0000000108709fe0) at gtest.cc:2656:11
    frame #49: 0x000000010095191f mbgl-test`testing::TestCase::Run(this=0x00000001087092b0) at gtest.cc:2774:28
    frame #50: 0x0000000100959938 mbgl-test`testing::internal::UnitTestImpl::RunAllTests(this=0x0000000109000450) at gtest.cc:4649:43
    frame #51: 0x0000000100959620 mbgl-test`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x0000000109000450, method=60 96 95 00 01 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(), char const*) at gtest.cc:2458:12
    frame #52: 0x00000001009592e0 mbgl-test`testing::UnitTest::Run(this=0x000000010193fd00) at gtest.cc:4257:10
    frame #53: 0x0000000100298311 mbgl-test`RUN_ALL_TESTS() at gtest.h:2233:46
    frame #54: 0x0000000100297c99 mbgl-test`mbgl::runTests(argc=1, argv=0x00007ffeefbff670) at test.cpp:24:12
    frame #55: 0x000000010000cbfc mbgl-test`main(argc=3, argv=0x00007ffeefbff670) at main.cpp:19:12
    frame #56: 0x00007fff6911b2e5 libdyld.dylib`start + 1

In a second run I get a slightly different backtrace:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x000000010009c6bc mbgl-test`std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, void*>*>::__hash(this=0x7322202020202020) const at __hash_table:88:55
    frame #1: 0x000000010009c49a mbgl-test`std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value> > >::__hash_table(this=0x000000010bafc188, __u=0x000000010a8559b8) at __hash_table:1496:64
    frame #2: 0x000000010009c3bd mbgl-test`std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value> > >::__hash_table(this=0x000000010bafc188, __u=0x000000010a8559b8) at __hash_table:1493:1
    frame #3: 0x000000010009c380 mbgl-test`std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, mapbox::feature::value> > >::unordered_map(this=0x000000010bafc188 size=4294967295, __u=size=4294967295) at unordered_map:1453:7
    frame #4: 0x000000010009c31d mbgl-test`std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mapbox::feature::value, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, mapbox::feature::value> > >::unordered_map(this=0x000000010bafc188 size=4294967295, __u=size=4294967295) at unordered_map:1454:1
    frame #5: 0x00000001000ab0a7 mbgl-test`mapbox::feature::feature<double>::feature(this=0x000000010bafc168, (null)=0x000000010a855998) at feature.hpp:96:8
    frame #6: 0x00000001000c3a2d mbgl-test`mapbox::feature::feature<double>::feature(this=0x000000010bafc168, (null)=0x000000010a855998) at feature.hpp:96:8

Expected behavior

The tests don't segfault.

Actual behavior

They segfault.

@springmeyer
Copy link
Contributor Author

I'm also seeing crashes in test/text/local_glyph_rasterizer.test.cpp. If I comment out all the tests in both test/text/local_glyph_rasterizer.test.cpp and test/api/query.test.cpp I get 100% passing tests. Is anyone else able to replicate this problem? /cc @mapbox/gl-core

@pozdnyakov pozdnyakov self-assigned this Nov 6, 2019
@alexshalamov
Copy link
Contributor

@springmeyer @pozdnyakov I cannot reproduce crash. We can try upgrading one of our laptops to Catalina and see if crash is reproduceable.

Platform: macOS 10.14.6
XCode: 11.2

@springmeyer
Copy link
Contributor Author

@alexshalamov thanks for testing. I also cannot reproduce now if I build and run the tests in a new clone:

git clone [email protected]:mapbox/mapbox-gl-native mbgl-clean
cd mbgl-clean
build/macos/Debug/mbgl-test --gtest_catch_exceptions=0

That gives:

[----------] Global test environment tear-down
[==========] 757 tests from 101 test cases ran. (48862 ms total)
[  PASSED  ] 757 tests.

  YOU HAVE 3 DISABLED TESTS

And no crashes now.

So, perhaps this had something to due with stale results after upgrade to 10.15. If I see it again I'll re-open but for now this seems spurious.

@pozdnyakov pozdnyakov removed their assignment Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl crash
Projects
None yet
Development

No branches or pull requests

4 participants