App Crash due to UI update on main thread

#1

Hi,
I am having issues of app crash and even apple rejected our app.

here are the logs and I found that is Shinobi API issue updating UI on main thread.

=====
Main Thread Checker: UI API called on a background thread: -[UIView init]
PID: 76197, TID: 1245329, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b5c73b6 -[SChartTitle init] + 54
5 KKR 0x000000010b5c9328 -[SChartAxis init] + 1176
6 KKR 0x000000010b5d90f9 -[SChartDateTimeAxis init] + 57
7 KKR 0x000000010b662456 -[SChartDiscontinuousDateTimeAxis init] + 54
8 KKR 0x000000010b5d5e3d -[SChartAxis stubCopyOfAxisForDataLoading] + 61
9 KKR 0x000000010b5db926 -[SChartDateTimeAxis stubCopyOfAxisForDataLoading] + 54
10 KKR 0x000000010b662646 -[SChartDiscontinuousDateTimeAxis stubCopyOfAxisForDataLoading] + 54
11 KKR 0x000000010b63cf87 -[ShinobiChart loadNewChartSeriesEntries] + 1079
12 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
13 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
15 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_serial_drain + 791
16 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
17 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
18 libsystem_pthread.dylib 0x0000000115dc760b _pthread_wqthread + 409
19 libsystem_pthread.dylib 0x0000000115dc7405 start_wqthread + 13
2019-02-03 17:44:09.403501+0530 KKR[76197:1245329] [reports] Main Thread Checker: UI API called on a background thread: -[UIView init]
PID: 76197, TID: 1245329, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b5c73b6 -[SChartTitle init] + 54
5 KKR 0x000000010b5c9328 -[SChartAxis init] + 1176
6 KKR 0x000000010b5d90f9 -[SChartDateTimeAxis init] + 57
7 KKR 0x000000010b662456 -[SChartDiscontinuousDateTimeAxis init] + 54
8 KKR 0x000000010b5d5e3d -[SChartAxis stubCopyOfAxisForDataLoading] + 61
9 KKR 0x000000010b5db926 -[SChartDateTimeAxis stubCopyOfAxisForDataLoading] + 54
10 KKR 0x000000010b662646 -[SChartDiscontinuousDateTimeAxis stubCopyOfAxisForDataLoading] + 54
11 KKR 0x000000010b63cf87 -[ShinobiChart loadNewChartSeriesEntries] + 1079
12 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
13 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
15 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_serial_drain + 791
16 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
17 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
18 libsystem_pthread.dylib 0x0000000115dc760b _pthread_wqthread + 409
19 libsystem_pthread.dylib 0x0000000115dc7405 start_wqthread + 13
2019-02-03 17:44:09.508488+0530 KKR[76197:1245329] ShinobiCharts: The datasource for this chart has specified that there are 0 series
From: <SChartDataLoader: 0x60000271b250>

Main Thread Checker: UI API called on a background thread: -[UILabel initWithFrame:]
PID: 76197, TID: 1245328, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b5c744c -[SChartTitle initWithFrame:] + 92
5 UIKitCore 0x000000011d2d0df7 -[UIView init] + 44
6 KKR 0x000000010b5c73b6 -[SChartTitle init] + 54
7 KKR 0x000000010b5c9328 -[SChartAxis init] + 1176
8 KKR 0x000000010b5d90f9 -[SChartDateTimeAxis init] + 57
9 KKR 0x000000010b662456 -[SChartDiscontinuousDateTimeAxis init] + 54
10 KKR 0x000000010b5d5e3d -[SChartAxis stubCopyOfAxisForDataLoading] + 61
11 KKR 0x000000010b5db926 -[SChartDateTimeAxis stubCopyOfAxisForDataLoading] + 54
12 KKR 0x000000010b662646 -[SChartDiscontinuousDateTimeAxis stubCopyOfAxisForDataLoading] + 54
13 KKR 0x000000010b63cf87 -[ShinobiChart loadNewChartSeriesEntries] + 1079
14 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
15 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
16 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
17 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_serial_drain + 791
18 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
19 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
20 libsystem_pthread.dyli2019-02-03 17:44:09.523985+0530 KKR[76197:1245194] URL: https://api-stage.zsenia.com/services/rating/history/economy/average/null/null/null
b 0x0000000115dc760b _pthread_wqthread + 409
21 libsystem_pthread.dylib 0x0000000115dc7405 start_wqthread + 13

Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 76197, TID: 1245720, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b63cbcf -[ShinobiChart loadNewChartSeriesEntries] + 127
5 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
6 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
7 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
8 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_2019-02-03 17:44:09.550974+0530 KKR[76197:1245194] User authentication : Mf/9GYCVOnkA0jOXnzUe8c+SJjlDHNiufjW8R0Mg+2vDuJPkQrQebVyXgNJcBnf8zsa4yloWalk=
2019-02-03 17:44:09.550920+0530 KKR[76197:1245328] [reports] Main Thread Checker: UI API called on a background thread: -[UILabel initWithFrame:]
PID: 76197, TID: 1245328, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b5c744c -[SChartTitle initWithFrame:] + 92
5 UIKitCore 0x000000011d2d0df7 -[UIView init] + 44
6 KKR 0x000000010b5c73b6 -[SChartTitle init] + 54
7 KKR 0x000000010b5c9328 -[SChartAxis init] + 1176
8 KKR 0x000000010b5d90f9 -[SChartDateTimeAxis init] + 57
9 KKR 0x000000010b662456 -[SChartDiscontinuousDateTimeAxis init] + 54
10 KKR 0x000000010b5d5e3d -[SChartAxserial_drain + 791
9 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
10 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
11 libsystem_pthread.dylib 0x0000000115dc760b _pthread_wqthread + 409
12 libsystem_pthread.dylib 0x0000000115dc7is stubCopyOfAxisForDataLoading] + 61
11 KKR 0x000000010b5db926 -[SChartDateTimeAxis stubCopyOfAxisForDataLoading] + 54
12 KKR 0x000000010b662646 -[SChartDiscontinuousDateTimeAxis stubCopyOfAxisForDataLoading] + 54
13 KKR 0x000000010b63cf87 -[ShinobiChart loadNewChartSeriesEntries] + 1079
14 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
15 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
16 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
17 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_serial_drain + 791
18 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
19 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
20 libsystem_pthread.dylib 0x0000000115dc760b _pthread_wqthread + 409
21 libsystem_pthread.dylib 0x0000000115dc7405 start_wqthread + 13
405 start_wqthread + 13
2019-02-03 17:44:09.565378+0530 KKR[76197:1245720] [reports] Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 76197, TID: 1245720, Thread name: (none), Queue name: com.shinobicontrols.charts.loadingDataQueue, QoS: 0
Backtrace:
4 KKR 0x000000010b63cbcf -[ShinobiChart loadNewChartSeriesEntries] + 127
5 KKR 0x000000010b644a81 __30-[ShinobiChart layoutSubviews]_block_invoke540 + 193
6 libdispatch.dylib 0x00000001159d6595 _dispatch_call_block_and_release + 12
7 libdispatch.dylib 0x00000001159d7602 _dispatch_client_callout + 8
8 libdispatch.dylib 0x00000001159deb0b _dispatch_lane_serial_drain + 791
9 libdispatch.dylib 0x00000001159df784 _dispatch_lane_invoke + 428
10 libdispatch.dylib 0x00000001159e989a _dispatch_workloop_worker_thread + 733
11 libsystem_pthread.dylib 0x0000000115dc760b _pthread_wqthread + 409
12 libsystem_pthread.dylib 0x0000000115dc7405 start_wqthread + 13

0 Likes

#2

Hi @gufran,

Thanks for the crash report. Please could you provide us with some more information to help us investigate?

  1. Which version of shinobicharts are you using?
  2. Does your chart have loadDataInBackground set to true?
  3. Is your app doing anything in the background that affects the data on the chart?
  4. Are you calling -setIsEnteringBackground: on your chart when the app is backgrounded?

Thanks,

Alison

0 Likes