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

Crash: KERN_INVALID_ADDRESS around mbgl::RenderLineLayer #12432

Closed
friedbunny opened this issue Jul 18, 2018 · 5 comments
Closed

Crash: KERN_INVALID_ADDRESS around mbgl::RenderLineLayer #12432

friedbunny opened this issue Jul 18, 2018 · 5 comments
Assignees
Labels
Core The cross-platform C++ core, aka mbgl crash rendering

Comments

@friedbunny
Copy link
Contributor

Platform: iOS 11.4.1
Mapbox SDK version: 4.2.0-beta.1

Studio Preview 1.3.10 (47) experienced this crash with the Terminal style (mapbox://styles/mapbox/cj62n87yx3mvi2rp93sfp2w9z).

Appears to be very similar to #12266.

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

#0. Crashed: com.apple.main-thread
0  Mapbox                         0x102ec60ac mbgl::IndexedTuple<mbgl::TypeList<mbgl::InterpolationUniform<mbgl::attributes::a_opacity>, mbgl::InterpolationUniform<mbgl::attributes::a_color>, mbgl::InterpolationUniform<mbgl::attributes::a_width>, mbgl::InterpolationUniform<mbgl::attributes::a_gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::a_offset<1ul> >, mbgl::InterpolationUniform<mbgl::attributes::a_blur>, mbgl::InterpolationUniform<mbgl::attributes::a_floorwidth>, mbgl::uniforms::u_opacity, mbgl::uniforms::u_color, mbgl::uniforms::u_width, mbgl::uniforms::u_gapwidth, mbgl::uniforms::u_offset, mbgl::uniforms::u_blur, mbgl::uniforms::u_floorwidth>, mbgl::TypeList<mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_opacity>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_color>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_width>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_gapwidth>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_offset<1ul> >, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_blur>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_floorwidth>, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_opacity, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_color, mbgl::Color>, mbgl::gl::UniformValue<mbgl::uniforms::u_width, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_gapwidth, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_offset, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_blur, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_floorwidth, float> > > mbgl::PaintPropertyBinders<mbgl::TypeList<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::LineFloorwidth> >::uniformValues<mbgl::style::Properties<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineTranslate, mbgl::style::LineTranslateAnchor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::style::LineDasharray, mbgl::style::LinePattern, mbgl::LineFloorwidth>::PossiblyEvaluated>(float, mbgl::style::Properties<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineTranslate, mbgl::style::LineTranslateAnchor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::style::LineDasharray, mbgl::style::LinePattern, mbgl::LineFloorwidth>::PossiblyEvaluated const&) const + 691964
1  Mapbox                         0x102ec25a8 mbgl::RenderLineLayer::render(mbgl::PaintParameters&, mbgl::RenderSource*) + 676856
2  Mapbox                         0x102ee9df8 mbgl::Renderer::Impl::render(mbgl::UpdateParameters const&) + 838728
3  Mapbox                         0x102d959b8 MGLRenderFrontend::render() (MGLRendererFrontend.h:53)
4  Mapbox                         0x102d9595c -[MGLMapView glkView:drawInRect:] (MGLMapView.mm:960)
5  GLKit                          0x191a4b970 -[GLKView _display:] + 216
6  Mapbox                         0x102d96164 -[MGLMapView updateFromDisplayLink] (MGLMapView.mm:1091)
7  QuartzCore                     0x188454f4c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 820
8  IOKit                          0x18464b48c IODispatchCalloutFromCFMessage + 492
9  CoreFoundation                 0x184370b20 __CFMachPortPerform + 188
10 CoreFoundation                 0x18438bae8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
11 CoreFoundation                 0x18438b230 __CFRunLoopDoSource1 + 440
12 CoreFoundation                 0x184388c80 __CFRunLoopRun + 2456
13 CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
14 GraphicsServices               0x18628e020 GSEventRunModal + 100
15 UIKit                          0x18e2c8758 UIApplicationMain + 236
16 StudioPreview                  0x10291cf64 main (OfflineStorage.swift:13)
17 libdyld.dylib                  0x183d39fc0 start + 4
Full stack trace.
#0. Crashed: com.apple.main-thread
0  Mapbox                         0x102ec60ac mbgl::IndexedTuple<mbgl::TypeList<mbgl::InterpolationUniform<mbgl::attributes::a_opacity>, mbgl::InterpolationUniform<mbgl::attributes::a_color>, mbgl::InterpolationUniform<mbgl::attributes::a_width>, mbgl::InterpolationUniform<mbgl::attributes::a_gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::a_offset<1ul> >, mbgl::InterpolationUniform<mbgl::attributes::a_blur>, mbgl::InterpolationUniform<mbgl::attributes::a_floorwidth>, mbgl::uniforms::u_opacity, mbgl::uniforms::u_color, mbgl::uniforms::u_width, mbgl::uniforms::u_gapwidth, mbgl::uniforms::u_offset, mbgl::uniforms::u_blur, mbgl::uniforms::u_floorwidth>, mbgl::TypeList<mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_opacity>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_color>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_width>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_gapwidth>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_offset<1ul> >, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_blur>, float>, mbgl::gl::UniformValue<mbgl::InterpolationUniform<mbgl::attributes::a_floorwidth>, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_opacity, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_color, mbgl::Color>, mbgl::gl::UniformValue<mbgl::uniforms::u_width, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_gapwidth, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_offset, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_blur, float>, mbgl::gl::UniformValue<mbgl::uniforms::u_floorwidth, float> > > mbgl::PaintPropertyBinders<mbgl::TypeList<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::LineFloorwidth> >::uniformValues<mbgl::style::Properties<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineTranslate, mbgl::style::LineTranslateAnchor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::style::LineDasharray, mbgl::style::LinePattern, mbgl::LineFloorwidth>::PossiblyEvaluated>(float, mbgl::style::Properties<mbgl::style::LineOpacity, mbgl::style::LineColor, mbgl::style::LineTranslate, mbgl::style::LineTranslateAnchor, mbgl::style::LineWidth, mbgl::style::LineGapWidth, mbgl::style::LineOffset, mbgl::style::LineBlur, mbgl::style::LineDasharray, mbgl::style::LinePattern, mbgl::LineFloorwidth>::PossiblyEvaluated const&) const + 691964
1  Mapbox                         0x102ec25a8 mbgl::RenderLineLayer::render(mbgl::PaintParameters&, mbgl::RenderSource*) + 676856
2  Mapbox                         0x102ee9df8 mbgl::Renderer::Impl::render(mbgl::UpdateParameters const&) + 838728
3  Mapbox                         0x102d959b8 MGLRenderFrontend::render() (MGLRendererFrontend.h:53)
4  Mapbox                         0x102d9595c -[MGLMapView glkView:drawInRect:] (MGLMapView.mm:960)
5  GLKit                          0x191a4b970 -[GLKView _display:] + 216
6  Mapbox                         0x102d96164 -[MGLMapView updateFromDisplayLink] (MGLMapView.mm:1091)
7  QuartzCore                     0x188454f4c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 820
8  IOKit                          0x18464b48c IODispatchCalloutFromCFMessage + 492
9  CoreFoundation                 0x184370b20 __CFMachPortPerform + 188
10 CoreFoundation                 0x18438bae8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
11 CoreFoundation                 0x18438b230 __CFRunLoopDoSource1 + 440
12 CoreFoundation                 0x184388c80 __CFRunLoopRun + 2456
13 CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
14 GraphicsServices               0x18628e020 GSEventRunModal + 100
15 UIKit                          0x18e2c8758 UIApplicationMain + 236
16 StudioPreview                  0x10291cf64 main (OfflineStorage.swift:13)
17 libdyld.dylib                  0x183d39fc0 start + 4

#1. Thread
0  libsystem_kernel.dylib         0x183e69d78 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1840080a0 _pthread_wqthread + 1420
2  libsystem_pthread.dylib        0x184007b08 start_wqthread + 4

#2. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x183e47de8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183e47c60 mach_msg + 72
2  CoreFoundation                 0x18438ae40 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x184388908 __CFRunLoopRun + 1568
4  CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
5  Foundation                     0x184d1d674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6  Foundation                     0x184d1d51c -[NSRunLoop(NSRunLoop) runUntilDate:] + 148
7  UIKit                          0x18dfad768 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x184e2defc __NSThread__start__ + 1040
9  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
10 libsystem_pthread.dylib        0x184009110 _pthread_body + 290
11 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#3. com.mapbox.mbgl.AssetFileSource
0  libsystem_kernel.dylib         0x183e47de8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183e47c60 mach_msg + 72
2  CoreFoundation                 0x18438ae40 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x184388908 __CFRunLoopRun + 1568
4  CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
5  CoreFoundation                 0x1842f8b28 CFRunLoopRun + 116
6  Mapbox                         0x103011764 mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()::operator()() + 2049460
7  Mapbox                         0x103011634 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()> >(void*, void*) + 2049156
8  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
9  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
10 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#4. com.mapbox.mbgl.DefaultFileSource
0  libsystem_kernel.dylib         0x183e47de8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183e47c60 mach_msg + 72
2  CoreFoundation                 0x18438ae40 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x184388908 __CFRunLoopRun + 1568
4  CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
5  CoreFoundation                 0x1842f8b28 CFRunLoopRun + 116
6  Mapbox                         0x103016a50 mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()::operator()() + 2070688
7  Mapbox                         0x103016908 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 2070360
8  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
9  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
10 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#5. com.mapbox.mbgl.LocalFileSource
0  libsystem_kernel.dylib         0x183e47de8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183e47c60 mach_msg + 72
2  CoreFoundation                 0x18438ae40 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x184388908 __CFRunLoopRun + 1568
4  CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
5  CoreFoundation                 0x1842f8b28 CFRunLoopRun + 116
6  Mapbox                         0x10301af8c mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()::operator()() + 2088412
7  Mapbox                         0x10301ae88 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*, void*) + 2088152
8  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
9  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
10 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#6. com.twitter.crashlytics.ios.MachExceptionServer
0  StudioPreview                  0x102967b28 CLSProcessRecordAllThreads (CLSProcess.c:376)
1  StudioPreview                  0x102967fe8 CLSProcessRecordAllThreads (CLSProcess.c:407)
2  StudioPreview                  0x10295782c CLSHandler (CLSHandler.m:26)
3  StudioPreview                  0x102952c1c CLSMachExceptionServer (CLSMachException.c:446)
4  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
5  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
6  libsystem_pthread.dylib        0x184007b10 thread_start + 4

#7. com.mapbox.mbgl.Worker 1
0  Mapbox                         0x102ff74f0 mbgl::GeometryCollection mapbox::vector_tile::feature::getGeometries<mbgl::GeometryCollection>(float) const + 1942336
1  Mapbox                         0x102ff70f0 mbgl::VectorTileFeature::getGeometries() const + 1941312
2  Mapbox                         0x102febe30 mbgl::GeometryTileWorker::parse() + 1895552
3  Mapbox                         0x102feca0c mbgl::GeometryTileWorker::setLayers(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long) + 1898588
4  Mapbox                         0x102fd34f0 void mbgl::MessageImpl<mbgl::GeometryTileWorker, void (mbgl::GeometryTileWorker::*)(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long), std::__1::tuple<std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long> >::invoke<0ul, 1ul>(std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 1794880
5  Mapbox                         0x102e28fa8 mbgl::Mailbox::receive() + 48632
6  Mapbox                         0x102e2913c mbgl::Mailbox::maybeReceive(std::__1::weak_ptr<mbgl::Mailbox>) + 49036
7  Mapbox                         0x102e25b7c std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*, void*) + 35276
8  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
9  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
10 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#8. com.mapbox.mbgl.Worker 2
0  Mapbox                         0x102ff7eb0 mapbox::vector_tile::feature::feature(protozero::data_view const&, mapbox::vector_tile::layer const&) + 1944832
1  Mapbox                         0x102ff7844 mbgl::VectorTileLayer::getFeature(unsigned long) const + 1943188
2  Mapbox                         0x102febde8 mbgl::GeometryTileWorker::parse() + 1895480
3  Mapbox                         0x102feca0c mbgl::GeometryTileWorker::setLayers(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long) + 1898588
4  Mapbox                         0x102fd34f0 void mbgl::MessageImpl<mbgl::GeometryTileWorker, void (mbgl::GeometryTileWorker::*)(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long), std::__1::tuple<std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long> >::invoke<0ul, 1ul>(std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 1794880
5  Mapbox                         0x102e28fa8 mbgl::Mailbox::receive() + 48632
6  Mapbox                         0x102e2913c mbgl::Mailbox::maybeReceive(std::__1::weak_ptr<mbgl::Mailbox>) + 49036
7  Mapbox                         0x102e25b7c std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*, void*) + 35276
8  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
9  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
10 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#9. com.mapbox.mbgl.Worker 3
0  libsystem_malloc.dylib         0x183eb1b0c _nano_malloc_check_clear + 216
1  libsystem_malloc.dylib         0x183eb1ad0 _nano_malloc_check_clear + 156
2  libsystem_malloc.dylib         0x183eb09a0 nano_malloc + 44
3  libsystem_malloc.dylib         0x183e9f5dc malloc_zone_malloc + 160
4  libsystem_malloc.dylib         0x183ea20b0 malloc + 32
5  libc++abi.dylib                0x1835719ac operator new(unsigned long) + 44
6  Mapbox                         0x102e44ec0 std::__1::__split_buffer<mapbox::geometry::point<short>, std::__1::allocator<mapbox::geometry::point<short> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<mapbox::geometry::point<short> >&) + 163088
7  Mapbox                         0x102fea9c8 void std::__1::vector<mapbox::geometry::point<short>, std::__1::allocator<mapbox::geometry::point<short> > >::__emplace_back_slow_path<short, short>(short&&, short&&) + 1890328
8  Mapbox                         0x102ff7574 mbgl::GeometryCollection mapbox::vector_tile::feature::getGeometries<mbgl::GeometryCollection>(float) const + 1942468
9  Mapbox                         0x102ff70f0 mbgl::VectorTileFeature::getGeometries() const + 1941312
10 Mapbox                         0x102febe30 mbgl::GeometryTileWorker::parse() + 1895552
11 Mapbox                         0x102feca0c mbgl::GeometryTileWorker::setLayers(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long) + 1898588
12 Mapbox                         0x102fd34f0 void mbgl::MessageImpl<mbgl::GeometryTileWorker, void (mbgl::GeometryTileWorker::*)(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long), std::__1::tuple<std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long> >::invoke<0ul, 1ul>(std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 1794880
13 Mapbox                         0x102e28fa8 mbgl::Mailbox::receive() + 48632
14 Mapbox                         0x102e2913c mbgl::Mailbox::maybeReceive(std::__1::weak_ptr<mbgl::Mailbox>) + 49036
15 Mapbox                         0x102e25b7c std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*, void*) + 35276
16 libsystem_pthread.dylib        0x184009220 _pthread_body + 272
17 libsystem_pthread.dylib        0x184009110 _pthread_body + 290
18 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#10. com.mapbox.mbgl.Worker 4
0  Mapbox                         0x102ff6914 mapbox::vector_tile::feature::getValue(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 1939300
1  Mapbox                         0x102f3dafc mbgl::style::expression::featurePropertyAsExpressionValue(mbgl::style::expression::EvaluationContext, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 1182028
2  Mapbox                         0x102f6302c mbgl::style::expression::initializeDefinitions()::$_87::__invoke(mbgl::style::expression::EvaluationContext const&, mbgl::style::expression::Varargs<mbgl::style::expression::Value> const&) + 1334908
3  Mapbox                         0x102f62b90 mbgl::style::expression::detail::Signature<mbgl::style::expression::Result<bool> (mbgl::style::expression::EvaluationContext const&, mbgl::style::expression::Varargs<mbgl::style::expression::Value> const&), void>::apply(mbgl::style::expression::EvaluationContext const&, std::__1::vector<std::__1::unique_ptr<mbgl::style::expression::Expression, std::__1::default_delete<mbgl::style::expression::Expression> >, std::__1::allocator<std::__1::unique_ptr<mbgl::style::expression::Expression, std::__1::default_delete<mbgl::style::expression::Expression> > > > const&) const + 1333728
4  Mapbox                         0x102f801ac mbgl::style::Filter::operator()(mbgl::style::expression::EvaluationContext const&) const + 1454076
5  Mapbox                         0x102febe18 mbgl::GeometryTileWorker::parse() + 1895528
6  Mapbox                         0x102feca0c mbgl::GeometryTileWorker::setLayers(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long) + 1898588
7  Mapbox                         0x102fd34f0 void mbgl::MessageImpl<mbgl::GeometryTileWorker, void (mbgl::GeometryTileWorker::*)(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long), std::__1::tuple<std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > >, unsigned long long> >::invoke<0ul, 1ul>(std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 1794880
8  Mapbox                         0x102e28fa8 mbgl::Mailbox::receive() + 48632
9  Mapbox                         0x102e2913c mbgl::Mailbox::maybeReceive(std::__1::weak_ptr<mbgl::Mailbox>) + 49036
10 Mapbox                         0x102e25b7c std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*, void*) + 35276
11 libsystem_pthread.dylib        0x184009220 _pthread_body + 272
12 libsystem_pthread.dylib        0x184009110 _pthread_body + 290
13 libsystem_pthread.dylib        0x184007b10 thread_start + 4

#11. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x183e47de8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183e47c60 mach_msg + 72
2  CoreFoundation                 0x18438ae40 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x184388908 __CFRunLoopRun + 1568
4  CoreFoundation                 0x1842a8da8 CFRunLoopRunSpecific + 552
5  CFNetwork                      0x184bb66e0 -[__CoreSchedulingSetRunnable runForever] + 220
6  Foundation                     0x184e2defc __NSThread__start__ + 1040
7  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
8  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
9  libsystem_pthread.dylib        0x184007b10 thread_start + 4

#12. Thread
0  libsystem_kernel.dylib         0x183e690e8 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x18400bc90 _pthread_cond_wait$VARIANT$mp + 644
2  libc++.1.dylib                 0x18351f25c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  JavaScriptCore                 0x18ba3145c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 104
4  JavaScriptCore                 0x18ba31070 bmalloc::Scavenger::threadRunLoop() + 164
5  JavaScriptCore                 0x18ba30e18 bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::StaticMutex>&) + 10
6  JavaScriptCore                 0x18ba31234 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::Scavenger*), bmalloc::Scavenger*> >(void*) + 44
7  libsystem_pthread.dylib        0x184009220 _pthread_body + 272
8  libsystem_pthread.dylib        0x184009110 _pthread_body + 290
9  libsystem_pthread.dylib        0x184007b10 thread_start + 4

 
/cc @jfirebaugh @kkaefer

@friedbunny friedbunny added crash Core The cross-platform C++ core, aka mbgl labels Jul 18, 2018
@jfirebaugh
Copy link
Contributor

Is there some way to replicate this easily? I didn't see any crashes with this style in the macOS app, and the iOS app does not have a simple way to load a custom style.

@friedbunny
Copy link
Contributor Author

friedbunny commented Jul 20, 2018

There’s no reproduction that I’m aware of and loading the style isn’t enough to crash — it’s just metadata that may/may not be relevant (though 2/2 reported crashes were on this style). Apologies for not making that more clear.

@jfirebaugh
Copy link
Contributor

Ok; closing for now as this likely isn't actionable without more information or a replication scenario.

@friedbunny
Copy link
Contributor Author

friedbunny commented Jul 20, 2018

I was able to reproduce this — run iosapp from the fb-12432-reproduction branch and tap the style name in the navigation bar to switch styles. This will trigger the following assertion (or the above crash, depending on if you’re building Debug or Release).

Flipping the order of the two styles can cause a slightly different crash with FillBucket — see
#12266 (comment).

Assertion failed: (dynamic_cast<LineBucket*>(tile.tile.getBucket(*baseImpl))), function render, file /mapbox-gl-native/src/mbgl/renderer/layers/render_line_layer.cpp, line 61.

assert(dynamic_cast<LineBucket*>(tile.tile.getBucket(*baseImpl)));

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000010ef8fb66 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x000000010efc9080 libsystem_pthread.dylib`pthread_kill + 333
    frame #2: 0x000000010ebeac97 libsystem_c.dylib`abort + 127
    frame #3: 0x000000010ebb3c03 libsystem_c.dylib`__assert_rtn + 320
  * frame #4: 0x00000001071be720 Mapbox`mbgl::RenderLineLayer::render(this=0x00007fc149084000, parameters=0x00007ffee9291aa0, (null)=0x00007fc148a07230) at render_line_layer.cpp:61
    frame #5: 0x00000001072d348a Mapbox`mbgl::Renderer::Impl::render(this=0x00007fc146501070, updateParameters=0x00007fc14643e0d8) at renderer_impl.cpp:585
    frame #6: 0x00000001072bb968 Mapbox`mbgl::Renderer::render(this=0x000060000001bc50, updateParameters=0x00007fc14643e0d8) at renderer.cpp:33
    frame #7: 0x0000000106db3b54 Mapbox`MGLRenderFrontend::render(this=0x000060000007cd40) at MGLRendererFrontend.h:52
    frame #8: 0x0000000106db3a2e Mapbox`::-[MGLMapView glkView:drawInRect:](self=0x00007fc146841600, _cmd="glkView:drawInRect:", view=0x00007fc146606e80, rect=(origin = (x = 0, y = 0), size = (width = 1366, height = 1024))) at MGLMapView.mm:958
    frame #9: 0x000000010d6e2f3a GLKit`-[GLKView _display:] + 310
    frame #10: 0x0000000106db5020 Mapbox`::-[MGLMapView updateFromDisplayLink](self=0x00007fc146841600, _cmd="updateFromDisplayLink") at MGLMapView.mm:1091
    frame #11: 0x000000010dc00850 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 834
    frame #12: 0x000000010dd42a12 QuartzCore`display_timer_callback(__CFMachPort*, void*, long, void*) + 248
    frame #13: 0x0000000109b664b9 CoreFoundation`__CFMachPortPerform + 169
    frame #14: 0x0000000109b663f9 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    frame #15: 0x0000000109b66361 CoreFoundation`__CFRunLoopDoSource1 + 465
    frame #16: 0x0000000109b5df64 CoreFoundation`__CFRunLoopRun + 2532
    frame #17: 0x0000000109b5d30b CoreFoundation`CFRunLoopRunSpecific + 635
    frame #18: 0x000000011015fa73 GraphicsServices`GSEventRunModal + 62
    frame #19: 0x000000010a82e057 UIKit`UIApplicationMain + 159
    frame #20: 0x000000010696633f Mapbox GL`main(argc=1, argv=0x00007ffee9299298) at main.m:8
    frame #21: 0x000000010eb18955 libdyld.dylib`start + 1
    frame #22: 0x000000010eb18955 libdyld.dylib`start + 1

@jfirebaugh
Copy link
Contributor

What's happening here is there's a water layer that's a fill layer in one style and a line layer in the other style, and the assert is telling us that it's expecting a line bucket but the fill bucket from the old style is still there.

  • This will only happen in MapMode::Continuous; in static rendering we skip any re-rendering until the new buckets have replaced the old ones. (This means we can't test this with a render test.)
  • Not sure yet whether it's better to turn the assertion into a conditional guard, or try to preemptively clear out the buckets when we detect a layer changing type. The style diffing code already treats this as a layer remove+add, rather than a layer change, but that's not enough to prevent the buckets being reused.

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 rendering
Projects
None yet
Development

No branches or pull requests

2 participants