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

Assertion failure querying features in annotation tile — mbgl::FeatureIndex::addFeature() #5159

Closed
1ec5 opened this issue May 26, 2016 · 0 comments · Fixed by #5163
Closed
Assignees
Labels
Core The cross-platform C++ core, aka mbgl crash
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 26, 2016

Querying rendered features in a tile that also has annotations, trips an assertion that each indexed feature’s source layer can be found by name. mbgl::AnnotationTileLayers are mapped to names like com.mapbox.annotations.points but calling getName() on them yields the empty string. This is the stack trace just before the assertion failure, where the mbgl::AnnotationTile fails to find the layer by name:

#0  0x0000000100170774 in mbgl::AnnotationTile::getLayer(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const at /path/to/mapbox-gl-native-2/src/mbgl/annotation/annotation_tile.cpp:29
#1  0x000000010018f2c6 in mbgl::FeatureIndex::addFeature(std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> >, 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, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> > > > >&, mbgl::IndexedSubfeature const&, mbgl::GeometryCollection const&, std::experimental::fundamentals_v1::optional<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, mbgl::GeometryTile const&, mbgl::CanonicalTileID const&, mbgl::Style const&, float, float) const at /path/to/mapbox-gl-native-2/src/mbgl/geometry/feature_index.cpp:105
#2  0x000000010018f0b2 in mbgl::FeatureIndex::query(std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> >, 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, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> > > > >&, mbgl::GeometryCollection const&, float, double, double, std::experimental::fundamentals_v1::optional<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, mbgl::GeometryTile const&, mbgl::CanonicalTileID const&, mbgl::Style const&) const at /path/to/mapbox-gl-native-2/src/mbgl/geometry/feature_index.cpp:85
#3  0x000000010044ce0d in mbgl::VectorTileData::queryRenderedFeatures(std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> >, 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, std::__1::vector<mbgl::Feature, std::__1::allocator<mbgl::Feature> > > > >&, mbgl::GeometryCoordinates const&, mbgl::TransformState const&, std::experimental::fundamentals_v1::optional<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&) at /path/to/mapbox-gl-native-2/src/mbgl/tile/vector_tile_data.cpp:202
#4  0x000000010030e9d7 in mbgl::Source::queryRenderedFeatures(mbgl::StyleQueryParameters const&) const at /path/to/mapbox-gl-native-2/src/mbgl/source/source.cpp:367
#5  0x000000010036bcea in mbgl::Style::queryRenderedFeatures(mbgl::StyleQueryParameters const&) const at /path/to/mapbox-gl-native-2/src/mbgl/style/style.cpp:324
#6  0x00000001002511d0 in mbgl::Map::queryRenderedFeatures(mapbox::geometry::point<double> const&, std::experimental::fundamentals_v1::optional<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&) at /path/to/mapbox-gl-native-2/src/mbgl/map/map.cpp:739

I have a fix in hand.

/cc @jfirebaugh

@1ec5 1ec5 added crash Core The cross-platform C++ core, aka mbgl labels May 26, 2016
@1ec5 1ec5 added this to the ios-v3.3.0 milestone May 26, 2016
@1ec5 1ec5 self-assigned this May 26, 2016
1ec5 added a commit that referenced this issue May 26, 2016
1ec5 added a commit that referenced this issue May 26, 2016
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

Successfully merging a pull request may close this issue.

1 participant