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

Removing offline pack while downloading triggers race condition #5508

Closed

Description

@dapetcu21

Sometimes, [MGLOfflinePack offlineRegionStatusDidChange:] still gets called after an offline pack is removed with [MGLOfflineStorage removePack:withCompletionHandler:] while it's downloading,

Platform: iOS
Mapbox SDK version: 3.2.0

Steps to trigger behavior

  1. Add an offline pack
  2. [pack resume]
  3. Remove the offline pack while it's still downloading

Expected behavior

Pack should be removed

Actual behavior

Sometimes, due to a race condition, it crashes:

2016-06-29 14:32:53.695 WSDC[51282:4139302] *** Assertion failure in -[MGLOfflinePack offlineRegionStatusDidChange:], /Users/boundsj/workspace/mapbox-gl-native/platform/darwin/src/MGLOfflinePack.mm:142
2016-06-29 14:32:53.698 WSDC[51282:4139302] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot change update progress of an invalid offline pack.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001123c9d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001112b1deb objc_exception_throw + 48
    2   CoreFoundation                      0x00000001123c9bea +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x0000000110efbd5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   Mapbox                              0x00000001153440c1 -[MGLOfflinePack offlineRegionStatusDidChange:] + 193
    5   Mapbox                              0x00000001153445b2 ___ZN25MBGLOfflineRegionObserver13statusChangedEN4mbgl19OfflineRegionStatusE_block_invoke + 130
    6   libdispatch.dylib                   0x00000001155fdd9d _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x000000011561e3eb _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00000001156061ef _dispatch_main_queue_callback_4CF + 1738
    9   CoreFoundation                      0x00000001123230f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    10  CoreFoundation                      0x00000001122e4b99 __CFRunLoopRun + 2073
    11  CoreFoundation                      0x00000001122e40f8 CFRunLoopRunSpecific + 488
    12  GraphicsServices                    0x0000000115d10ad2 GSEventRunModal + 161
    13  UIKit                               0x0000000113c70f09 UIApplicationMain + 171
    14  WSDC                                0x000000010fe3f65f main + 111
    15  libdyld.dylib                       0x000000011565292d start + 1
    16  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Activity

  1. added
    iOS
    on Jun 29, 2016
  2. lilykaiser commented on Nov 17, 2017

    @lilykaiser

    Closing due to ticket age. If this is still a problem, please re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions