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: "Task created in a session that has been invalidated" #490

Closed
manuroe opened this issue Aug 1, 2016 · 2 comments
Closed

Crash: "Task created in a session that has been invalidated" #490

manuroe opened this issue Aug 1, 2016 · 2 comments
Labels
P1 T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@manuroe
Copy link
Member

manuroe commented Aug 1, 2016

The issue has been reported several times in GA from devices running a beta version of iOS10.

4743950929877315537 - 2016-07-27 17:39:40 +0000
Task created in a session that has been invalidated
Application: Vector (im.vector.app)
Application version: 0.1.13 (r26)
Matrix SDK version: 0.6.11
Build: master #26
iPhone 10.0
(
    0   CoreFoundation                      0x00000001898af710 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000188ea8578 objc_exception_throw + 56
    2   CFNetwork                           0x0000000189ea7608 <redacted> + 144
    3   Vector                              0x000000010011a2bc Vector + 647868 -> __93-[AFURLSessionManager dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:]_block_invoke (in Vector) (AFURLSessionManager.m:766)
    4   Vector                              0x000000010011a258 Vector + 647768 -> url_session_manager_create_task_safely (in Vector) (AFURLSessionManager.m:50)
    5   Vector                              0x000000010011a14c Vector + 647500 -> -[AFURLSessionManager dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:] (in Vector) (AFURLSessionManager.m:769)
    6   Vector                              0x0000000100250cb8 Vector + 1920184 -> -[MXHTTPClient tryRequest:method:path:parameters:data:headers:timeout:uploadProgress:success:failure:] (in Vector) (MXHTTPClient.m:207)
    7   Vector                              0x0000000100252034 Vector + 1925172 -> __102-[MXHTTPClient tryRequest:method:path:parameters:data:headers:timeout:uploadProgress:success:failure:]_block_invoke183 (in Vector) (MXHTTPClient.m:351)
    8   libdispatch.dylib                   0x00000001892f9784 <redacted> + 16
    9   libdispatch.dylib                   0x000000018930644c <redacted> + 576
    10  libdispatch.dylib                   0x0000000189312800 <redacted> + 204
    11  libdispatch.dylib                   0x00000001892fb728 <redacted> + 820
    12  libdispatch.dylib                   0x00000001892fe184 _dispatch_main_queue_callback_4CF + 572
    13  CoreFoundation                      0x000000018985e0cc <redacted> + 12
    14  CoreFoundation                      0x000000018985bcb8 <redacted> + 1660
    15  CoreFoundation                      0x000000018978b8d8 CFRunLoopRunSpecific + 444
    16  GraphicsServices                    0x000000018b192198 GSEventRunModal + 180
    17  UIKit                               0x000000018f7357c8 <redacted> + 664
    18  UIKit                               0x000000018f730534 UIApplicationMain + 208
    19  Vector                              0x00000001000b526c Vector + 234092 -> main (in Vector) (main.m:30)
    20  libdyld.dylib                       0x000000018932c5b8 <redacted> + 4
)

A second version of the bug:

4743950827481108782 - 2016-07-27 10:52:47 +0000
Task created in a session that has been invalidated
Application: Vector (im.vector.app)
Application version: 0.1.13 (r26)
Matrix SDK version: 0.6.11
Build: master #26
iPhone 10.0
(
    0   CoreFoundation                      0x00000001898af710 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000188ea8578 objc_exception_throw + 56
    2   CFNetwork                           0x0000000189ea7608 <redacted> + 144
    3   Vector                              0x00000001001662bc Vector + 647868 -> __93-[AFURLSessionManager dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:]_block_invoke (in Vector) (AFURLSessionManager.m:766)
    4   Vector                              0x0000000100166258 Vector + 647768 -> url_session_manager_create_task_safely (in Vector) (AFURLSessionManager.m:50)
    5   Vector                              0x000000010016614c Vector + 647500 -> -[AFURLSessionManager dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:] (in Vector) (AFURLSessionManager.m:769)
    6   Vector                              0x000000010029ccb8 Vector + 1920184 -> -[MXHTTPClient tryRequest:method:path:parameters:data:headers:timeout:uploadProgress:success:failure:] (in Vector) (MXHTTPClient.m:207)
    7   Vector                              0x000000010029c760 Vector + 1918816 -> -[MXHTTPClient requestWithMethod:path:parameters:data:headers:timeout:uploadProgress:success:failure:] (in Vector) (MXHTTPClient.m:162)
    8   Vector                              0x000000010029c614 Vector + 1918484 -> -[MXHTTPClient requestWithMethod:path:parameters:timeout:success:failure:] (in Vector) (MXHTTPClient.m:147)
    9   Vector                              0x000000010029c540 Vector + 1918272 -> -[MXHTTPClient requestWithMethod:path:parameters:success:failure:] (in Vector) (MXHTTPClient.m:137)
    10  Vector                              0x00000001002c1ec8 Vector + 2072264 -> -[MXRestClient setPusherWithPushkey:kind:appId:appDisplayName:deviceDisplayName:profileTag:lang:data:append:success:failure:] (in Vector) (MXRestClient.m:533)
    11  Vector                              0x00000001001e41b4 Vector + 1163700 -> -[MXKAccount enablePusher:success:failure:] (in Vector) (MXKAccount.m:806)
    12  Vector                              0x00000001001e38f4 Vector + 1161460 -> -[MXKAccount refreshPusher] (in Vector) (MXKAccount.m:723)
    13  Vector                              0x00000001001e36a0 Vector + 1160864 -> -[MXKAccount resume] (in Vector) (MXKAccount.m:680)
    14  Vector                              0x00000001000d29b0 Vector + 43440 -> -[AppDelegate applicationDidBecomeActive:] (in Vector) (AppDelegate.m:457)
    15  UIKit                               0x000000018f74f354 <redacted> + 1116
    16  UIKit                               0x000000018f950aec <redacted> + 124
    17  FrontBoardServices                  0x000000018b3c173c <redacted> + 208
    18  Foundation                          0x000000018a2db830 <redacted> + 724
    19  BaseBoard                           0x000000018b33c0d4 <redacted> + 104
    20  FrontBoardServices                  0x000000018b3bb7fc <redacted> + 88
    21  FrontBoardServices                  0x000000018b3c1518 <redacted> + 280
    22  UIKit                               0x000000018f951478 <redacted> + 196
    23  UIKit                               0x000000018f9510d0 <redacted> + 888
    24  UIKit                               0x000000018fc69914 <redacted> + 464
    25  FrontBoardServices                  0x000000018b3aad10 <redacted> + 208
    26  FrontBoardServices                  0x000000018b3d8a00 <redacted> + 36
    27  FrontBoardServices                  0x000000018b3d886c <redacted> + 176
    28  FrontBoardServices                  0x000000018b3d8c14 <redacted> + 56
    29  CoreFoundation                      0x000000018985e418 <redacted> + 24
    30  CoreFoundation                      0x000000018985dd60 <redacted> + 524
    31  CoreFoundation                      0x000000018985b960 <redacted> + 804
    32  CoreFoundation                      0x000000018978b8d8 CFRunLoopRunSpecific + 444
    33  GraphicsServices                    0x000000018b192198 GSEventRunModal + 180
    34  UIKit                               0x000000018f7357c8 <redacted> + 664
    35  UIKit                               0x000000018f730534 UIApplicationMain + 208
    36  Vector                              0x000000010010126c Vector + 234092 -> main (in Vector) (main.m:30)
    37  libdyld.dylib                       0x000000018932c5b8 <redacted> + 4
)
@manuroe manuroe added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems P2 labels Aug 1, 2016
@manuroe
Copy link
Member Author

manuroe commented Aug 1, 2016

This is not a priority issue since only beta iOS10 seems to be affected.

manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 1, 2016
@manuroe manuroe changed the title Crash "Task created in a session that has been invalidated" Crash on iOS10 Beta: "Task created in a session that has been invalidated" Aug 2, 2016
@manuroe
Copy link
Member Author

manuroe commented Aug 4, 2016

Here is a crash log that happened on iOS9.3.3.

This log logs a crash at the previous session. Do not get confused.
We seem to crash because MXHTTPClient retries a request whereas it has been deallocated.

2016-08-03 16:54:57.627 Vector[2128:717610] [AppDelegate] didFinishLaunchingWithOptions: (null)
2016-08-03 16:54:57.716 Vector[2128:717610] [MXKAccountManager] openSession for @Manu:matrix.org account
2016-08-03 16:54:58.492 Vector[2128:717653] [MXFileStore] diskUsage: 10 MB
2016-08-03 16:54:58.497 Vector[2128:717653] [MXFileStore] Warning: The previous saving was interrupted. MXFileStore has been reset to prevent file corruption.
2016-08-03 16:54:58.498 Vector[2128:717653] [MXFileStore] Delete all data
2016-08-03 16:54:59.087 Vector[2128:717610] [MXKRecentListVC] restore recentsSearchBar frame: 600.000000 0.000000
2016-08-03 16:54:59.087 Vector[2128:717610] [MXKRecentListVC] restore recentsTableView frame: 600.000000 600.000000
2016-08-03 16:54:59.192 Vector[2128:717610] [MXSession] Total time to mount SDK data from MXStore: 914ms
2016-08-03 16:54:59.203 Vector[2128:717610] [MXKAccountManager] the user allowed remote notification
2016-08-03 16:54:59.302 Vector[2128:717610] [AppDelegate] applicationDidEnterBackground
2016-08-03 16:54:59.370 Vector[2128:717610] [AppDelegate] refreshApplicationIconBadgeNumber: 0
2016-08-03 16:54:59.444 Vector[2128:717610] [AppDelegate] Got APNS token! (<7c4ed995 015f4447> ...)
2016-08-03 16:55:02.791 Vector[2128:717610] [MXCallManager] refreshTURNServer: TTL:86400 URIs: (
    "turn:turn.matrix.org:3478?transport=udp",
    "turn:turn.matrix.org:3478?transport=tcp",
    "turns:turn-ssl.matrix.org:443?transport=tcp"
)
2016-08-03 16:56:10.282 Vector[2128:718320] [MXHTTPClient] cancel
2016-08-03 16:56:10.307 Vector[2128:717610] [AppDelegate] applicationWillEnterForeground
2016-08-03 16:56:10.359 Vector[2128:717610] [MXHTTPClient] Request 0x13f6a6350 failed for path: /_matrix/client/r0/profile/@Manu:matrix.org/avatar_url?access_token=MDAxOGxvY2F0aW9uIG1hdHJpeC5vcmcKMDAxM2lkZW50aWZpZXIga2V5CjAwMTBjaWQgZ2VuID0gMQowMDIzY2lkIHVzZXJfaWQgPSBATWFudTptYXRyaXgub3JnCjAwMTZjaWQgdHlwZSA9IGFjY2VzcwowMDFkY2lkIHRpbWUgPCAxNDcwMDU4NTU0Mjg5CjAwMmZzaWduYXR1cmUgsySH0AsSKjuEyBWKFU-uMLmZ42-353D51rgciwrj0wYK - HTTP code: none
2016-08-03 16:56:10.360 Vector[2128:717610] [MXHTTPClient] error: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://matrix.org/_matrix/client/r0/profile/@Manu:matrix.org/avatar_url?access_token=MDAxOGxvY2F0aW9uIG1hdHJpeC5vcmcKMDAxM2lkZW50aWZpZXIga2V5CjAwMTBjaWQgZ2VuID0gMQowMDIzY2lkIHVzZXJfaWQgPSBATWFudTptYXRyaXgub3JnCjAwMTZjaWQgdHlwZSA9IGFjY2VzcwowMDFkY2lkIHRpbWUgPCAxNDcwMDU4NTU0Mjg5CjAwMmZzaWduYXR1cmUgsySH0AsSKjuEyBWKFU-uMLmZ42-353D51rgciwrj0wYK, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://matrix.org/_matrix/client/r0/profile/@Manu:matrix.org/avatar_url?access_token=MDAxOGxvY2F0aW9uIG1hdHJpeC5vcmcKMDAxM2lkZW50aWZpZXIga2V5CjAwMTBjaWQgZ2VuID0gMQowMDIzY2lkIHVzZXJfaWQgPSBATWFudTptYXRyaXgub3JnCjAwMTZjaWQgdHlwZSA9IGFjY2VzcwowMDFkY2lkIHRpbWUgPCAxNDcwMDU4NTU0Mjg5CjAwMmZzaWduYXR1cmUgsySH0AsSKjuEyBWKFU-uMLmZ42-353D51rgciwrj0wYK}
2016-08-03 16:56:10.364 Vector[2128:718321] [MXHTTPClient] ERROR: SessionDidBecomeInvalid: <__NSURLSessionLocal: 0x13dfb1b40>: (null)
2016-08-03 16:56:10.368 Vector[2128:717610] [MXHTTPClient] request 0x13f6a6350. Network reachability: 1
2016-08-03 16:56:10.369 Vector[2128:717610] Can't endBackgroundTask: no background task exists with identifier 8, or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
2016-08-03 16:56:11.213 Vector[2128:717610] [AppDelegate] applicationDidBecomeActive
2016-08-03 16:56:11.217 Vector[2128:717610] [AppDelegate] Send crash log to Google Analytics:
4743953424966482148 - 2016-08-03 14:54:16 +0000
Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/63CCAF5C-4903-41DE-8AAD-564A3C369C0D/Vector.app> (loaded)' with name 'MediaAlbumContentCollectionViewCell'
Application: Vector (im.vector.app)
Application version: 0.1.14 (r0)
Matrix SDK version: 0.6.12
Build: (no build info)
iPhone 9.3.3

Main thread: YES
(
    0   CoreFoundation                      0x0000000183feadc8 <redacted> + 148
    1   libobjc.A.dylib                     0x000000018364ff80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000183feacf8 <redacted> + 0
    3   UIKit                               0x000000018961f3a4 <redacted> + 480
    4   UIKit                               0x0000000189621b24 <redacted> + 224
    5   Vector                              0x00000001000e182c -[MediaAlbumContentCollectionViewCell initWithFrame:] + 320
    6   UIKit                               0x0000000189993488 <redacted> + 892
    7   UIKit                               0x00000001891afd48 <redacted> + 180
    8   Vector                              0x00000001000608c4 -[MediaAlbumContentViewController collectionView:cellForItemAtIndexPath:] + 164
    9   UIKit                               0x000000018998b3a8 <redacted> + 432
    10  UIKit                               0x00000001891adadc <redacted> + 4628
    11  UIKit                               0x00000001891a8808 <redacted> + 228
    12  UIKit                               0x00000001891441e4 <redacted> + 656
    13  QuartzCore                          0x0000000186ad698c <redacted> + 148
    14  QuartzCore                          0x0000000186ad15c8 <redacted> + 292
    15  QuartzCore                          0x0000000186ad1488 <redacted> + 32
    16  QuartzCore                          0x0000000186ad0ab8 <redacted> + 252
    17  QuartzCore                          0x0000000186ad0818 <redacted> + 500
    18  UIKit                               0x000000018913a5f8 <redacted> + 180
    19  CoreFoundation                      0x0000000183fa0728 <redacted> + 32
    20  CoreFoundation                      0x0000000183f9e4cc <redacted> + 372
    21  CoreFoundation                      0x0000000183f9e8fc <redacted> + 928
    22  CoreFoundation                      0x0000000183ec8c50 CFRunLoopRunSpecific + 384
    23  GraphicsServices                    0x00000001857b0088 GSEventRunModal + 180
    24  UIKit                               0x00000001891b2088 UIApplicationMain + 204
    25  Vector                              0x000000010005e054 main + 184
    26  libdyld.dylib                       0x0000000183a668b8 <redacted> + 4
)
2016-08-03 16:56:11.291 Vector[2128:717610] [MXKAccountManager] the user allowed remote notification
2016-08-03 16:56:18.038 Vector[2128:717610] [MXHTTPClient] Retry request 0x13f6a6350. Try #2/3. Age: 75244ms. Max retries time: 180000ms
2016-08-03 16:56:18.039 Vector[2128:717610] Attempted to create a task in a session that has been invalidated

@manuroe manuroe added P1 and removed P2 labels Aug 4, 2016
@manuroe manuroe changed the title Crash on iOS10 Beta: "Task created in a session that has been invalidated" Crash: "Task created in a session that has been invalidated" Aug 4, 2016
manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Aug 4, 2016
@manuroe manuroe closed this as completed Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

1 participant