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

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. #514

Closed
dddppp opened this issue Oct 28, 2015 · 4 comments

Comments

@dddppp
Copy link

dddppp commented Oct 28, 2015

Hello,

I am running the iOS Charts library extensively on an App and I get the following message:

"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 0x0000000182884f74 + 148
1 libobjc.A.dylib 0x000000019747bf80 objc_exception_throw + 56
2 CoreFoundation 0x0000000182884ea4 + 0
3 Foundation 0x000000018389e5d8 + 88
4 Foundation 0x0000000183720a1c + 36
5 UIKit 0x0000000187edf93c + 64
6 UIKit 0x00000001886060ac + 156
7 UIKit 0x0000000188605da0 + 252
8 UIKit 0x00000001886060d8 + 200
9 UIKit 0x0000000187ee0820 + 100
10 UIKit 0x0000000187edf94c + 80
11 UIKit 0x0000000187ee0454 + 244
12 UIKit 0x000000018860677c + 268
13 UIKit 0x00000001880ddfb0 + 176
14 UIKit 0x0000000187dd701c + 688
15 QuartzCore 0x00000001875ddf14 + 148
16 QuartzCore 0x00000001875d8b20 + 292
17 QuartzCore 0x00000001875d89e0 + 32
18 QuartzCore 0x00000001875d807c + 252
19 QuartzCore 0x00000001875d7dd0 + 516
20 QuartzCore 0x0000000187606f48 + 236
21 libsystem_pthread.dylib 0x0000000197e8a1e8 + 584
22 libsystem_pthread.dylib 0x0000000197e89d60 + 136
23 libsystem_pthread.dylib 0x0000000197e89544 pthread_mutex_lock + 0
24 libsystem_pthread.dylib 0x0000000197e89028 start_wqthread + 4
)"

I have zombie objects enabled as well as an "All Exceptions" breakpoint, no sign that is from my code so I assume is from iOS Charts.

To fix this we need to modify the iso-charts library so it modifies the UI elements using dispatch on the main queue, see here:

http://stackoverflow.com/questions/28302019/getting-a-this-application-is-modifying-the-autolayout-engine-error

@pmairoldi
Copy link
Collaborator

You application is doing something not on the main thread. As far as I know there is no autolayout code in this library.

@liuxuan30
Copy link
Member

@petester42 +1, it's your code problem, not this library

If you think so, give the symbol-ed stack trace, not this wild address trace, so we have better ideas and reopen this issue

@bocalexandru
Copy link

bocalexandru commented Oct 27, 2016

I receive the same error, only here it references the Charts:

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 0x0000000182252dc8 + 148
1 libobjc.A.dylib 0x00000001818b7f80 objc_exception_throw + 56
2 CoreFoundation 0x0000000182252cf8 + 0
3 Foundation 0x0000000182d03b2c + 88
4 Foundation 0x0000000182b84c3c + 36
5 UIKit 0x00000001873a2bc4 + 532
6 UIKit 0x00000001873b0678 + 1784
7 Charts 0x0000000100bbaff8 TFC6Charts26ChartXAxisRendererBarChart10drawLabelsfT7contextCSo9CGContext3posV12CoreGraphics7CGFloat6anchorVSC7CGPoint_T + 8104
8 Charts 0x0000000100baf8fc TFC6Charts18ChartXAxisRenderer16renderAxisLabelsfT7contextCSo9CGContext_T + 1720
9 Charts 0x0000000100b09ac8 TFC6Charts20BarLineChartViewBase8drawRectfVSC6CGRectT + 9548
10 Charts 0x0000000100b09fb8 TToFC6Charts20BarLineChartViewBase8drawRectfVSC6CGRectT + 120
11 UIKit 0x0000000187432678 + 368
12 QuartzCore 0x0000000184d66228 + 260
13 QuartzCore 0x0000000184d508ac + 2432
14 QuartzCore 0x0000000184e68360 + 52
15 QuartzCore 0x0000000184d4fa88 + 1368
16 QuartzCore 0x0000000184d317a8 + 228
17 QuartzCore 0x0000000184d31494 + 44
18 QuartzCore 0x0000000184d30ab8 + 252
19 QuartzCore 0x0000000184d30818 + 500
20 QuartzCore 0x0000000184d5fbcc + 236
21 libsystem_pthread.dylib 0x0000000181eb61e0 + 584
22 libsystem_pthread.dylib 0x0000000181eb5d58 + 136
23 libsystem_pthread.dylib 0x0000000181eb553c pthread_mutex_lock + 0
24 libsystem_pthread.dylib 0x0000000181eb5020 start_wqthread + 4
)

I have checked and double checked all the calls to the library to not call from any other thread thah the main one!

@pmairoldi
Copy link
Collaborator

Our library contains no auto layout code. The problem is on your end. You are probably modifying the constraints of the view that contains the chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants