Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash EXC_BAD_ACCESS after MapView is destroyed #2296

Open
romanandreyvich opened this issue Feb 26, 2025 · 0 comments
Open

Crash EXC_BAD_ACCESS after MapView is destroyed #2296

romanandreyvich opened this issue Feb 26, 2025 · 0 comments
Labels
bug 🪲 Something is broken!

Comments

@romanandreyvich
Copy link

Environment

  • Xcode version: 15.1
  • iOS version: 18.2.1, 18.3.1, 18.1.1
  • Devices affected: any
  • Maps SDK Version: 11.9.2

Observed behavior and steps to reproduce

Hi, I have a map in my app, after user logs out the map should be destroyed. Sometimes I receive crashlytics reports with EXC_BAD_ACCESS KERN_INVALID_ADDRESS

Stack trace:

          Crashed: com.apple.main-thread
0  MapboxCoreMaps                 0x71a900 mbgl::style::Style::Impl::notifyStyleLoadingStatusIfNeeded() + 148
1  MapboxCoreMaps                 0x7174dc mbgl::style::Style::Impl::onSpriteLoaded(std::__1::vector<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>, std::__1::allocator<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>>>) + 1052
2  MapboxCoreMaps                 0x4f187c mbgl::SpriteLoader::onSpriteLoaded(bool&, std::__1::vector<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>, std::__1::allocator<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>>>, bool) + 200
3  MapboxCoreMaps                 0x4f1448 mbgl::SpriteLoader::onIconSetLoaded(std::__1::vector<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>, std::__1::allocator<mapbox::common::type_wrappers::NonNullableSharedPointer<mbgl::icon_set::Icon const, std::__1::shared_ptr>>>, bool) + 64
4  MapboxCoreMaps                 0x4e94ac std::__1::__function::__func<std::__1::function<void ()> mapbox::common::bindTaskAndReply<mbgl::IconSetLoader::emitSpriteLoaded()::$_2, mbgl::IconSetLoader::emitSpriteLoaded()::$_4>(mbgl::IconSetLoader::emitSpriteLoaded()::$_2 const&, mbgl::IconSetLoader::emitSpriteLoaded()::$_4 const&)::'lambda'()::operator()() const::'lambda'(), std::__1::allocator<std::__1::function<void ()> mapbox::common::bindTaskAndReply<mbgl::IconSetLoader::emitSpriteLoaded()::$_2, mbgl::IconSetLoader::emitSpriteLoaded()::$_4>(mbgl::IconSetLoader::emitSpriteLoaded()::$_2 const&, mbgl::IconSetLoader::emitSpriteLoaded()::$_4 const&)::'lambda'()::operator()() const::'lambda'()>, void ()>::operator()() + 256
5  MapboxCommon                   0x160474 mapbox::common::platform::taskScope() + 1428
6  CoreFoundation                 0x73f4c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
7  CoreFoundation                 0x73ee0 __CFRunLoopDoSource0 + 176
8  CoreFoundation                 0x76b40 __CFRunLoopDoSources0 + 244
9  CoreFoundation                 0x75d3c __CFRunLoopRun + 840
10 CoreFoundation                 0xc8284 CFRunLoopRunSpecific + 588
11 GraphicsServices               0x14c0 GSEventRunModal + 164
12 UIKitCore                      0x3ee674 -[UIApplication _run] + 816
13 UIKitCore                      0x14e88 UIApplicationMain + 340
14 App                            0x704cc8 main + 24 (AppDelegate.swift:24)
15 ???                            0x1adc89de8 (Missing)

I guess it might happen in few seconds after logout (after map was destroyed) or after log in back (after new map instance created)

I can't reproduce it myself, I've checked deinit method of MapView - all good (called after logout as expected), also I've checked that there are not old instances of MapView in memory graph

This stack trace and error message isn't really helpful, I have no idea what might be wrong with this.
Are there any ideas?

@romanandreyvich romanandreyvich added the bug 🪲 Something is broken! label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken!
Projects
None yet
Development

No branches or pull requests

1 participant