printdotio / printio-ios-sdk

SDK that enables the printing of any photo, from any source, onto any product!
Other
20 stars 11 forks source link

Crash - auto layout called on background thread #506

Closed jordansorensen closed 8 years ago

jordansorensen commented 8 years ago

Somewhere print.io is making auto layout updates on a background thread, and that occasionally causes crashes. When ordering photo prints, I select a size (4x6), and the "Loading..." screen appears. The app then crashes before the "Processing x of y images" screen appears with the following stack:

2016-01-26 10:49:11.690 app[1257:426511] PrintIO: PMImageDownloader download finished
2016-01-26 10:49:11.692 app[1257:426511] PrintIO: -[PIOBaseViewController adjustNavBarForiOSVersionWithBackgroundColor:]
2016-01-26 10:49:11.709 app[1257:426511] PrintIO: start porcessing images
2016-01-26 10:49:11.777 app[1257:429576] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x0000000181cf9918 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000181367f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000181cf9848 <redacted> + 0
    3   Foundation                          0x00000001827972d4 <redacted> + 88
    4   Foundation                          0x000000018261947c <redacted> + 36
    5   UIKit                               0x00000001869e6194 <redacted> + 532
    6   UIKit                               0x00000001869f3b80 <redacted> + 1784
    7   app                             0x0000000100573bd4 extractOBJdata + 33912
    8   app                             0x0000000100571594 extractOBJdata + 24120
    9   app                             0x0000000100449108 payeeName + 26488
    10  libdispatch.dylib                   0x0000000101179bf0 _dispatch_call_block_and_release + 24
    11  libdispatch.dylib                   0x0000000101179bb0 _dispatch_client_callout + 16
    12  libdispatch.dylib                   0x0000000101188e10 _dispatch_root_queue_drain + 2344
    13  libdispatch.dylib                   0x00000001011884d8 _dispatch_worker_thread3 + 132
    14  libsystem_pthread.dylib             0x0000000181961470 _pthread_wqthread + 1092
    15  libsystem_pthread.dylib             0x0000000181961020 start_wqthread + 4
)
2016-01-26 10:49:11.779 app[1257:429576] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x0000000181cf9918 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000181367f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000181cf9848 <redacted> + 0
    3   Foundation                          0x00000001827972d4 <redacted> + 88
    4   Foundation                          0x000000018261d99c <redacted> + 56
    5   Foundation                          0x000000018261955c <redacted> + 260
    6   UIKit                               0x00000001869e6194 <redacted> + 532
    7   UIKit                               0x00000001869f3b80 <redacted> + 1784
    8   app                             0x0000000100573bd4 extractOBJdata + 33912
    9   app                             0x0000000100571594 extractOBJdata + 24120
    10  app                             0x0000000100449108 payeeName + 26488
    11  libdispatch.dylib                   0x0000000101179bf0 _dispatch_call_block_and_release + 24
    12  libdispatch.dylib                   0x0000000101179bb0 _dispatch_client_callout + 16
    13  libdispatch.dylib                   0x0000000101188e10 _dispatch_root_queue_drain + 2344
    14  libdispatch.dylib                   0x00000001011884d8 _dispatch_worker_thread3 + 132
    15  libsystem_pthread.dylib             0x0000000181961470 _pthread_wqthread + 1092
    16  libsystem_pthread.dylib             0x0000000181961020 start_wqthread + 4
)

This happens about 10% of the time - I ran 20 trials of trying to get to this screen, and in 2 instances it crashed with this particular stack trace. In addition, I've seen this stack trace in circumstances where the app didn't crash.

tobiasfrier commented 8 years ago

@jordansorensen Thanks for bring this to my attention.

@perisicboro Can you take a look at this tomorrow?

perisicboro commented 8 years ago

@tobiasfrier I will.

perisicboro commented 8 years ago

@jordansorensen This one is fixed, and it might be connected with https://github.com/printdotio/printio-ios-sdk/issues/507 Once we test it and verify fix, we will update sdk.

jordansorensen commented 8 years ago

Fantastic, thanks! Looking forward to the update.