bytedance / Bytedance-UnionAD

MIT License
170 stars 54 forks source link

[BUG] -[UIView(PAGUgenWidget) ugenLayoutSubviews] background thread crash #202

Open liuxiaoxinxin opened 4 months ago

liuxiaoxinxin commented 4 months ago

Describe the bug | 问题描述

PAGUgenWidget.m 在后台线程调用 layoutsubviews 导致崩溃

Environmental information | 环境信息

To Reproduce | 如何复现

occasionally appear 偶现

Screenshots | 截图

Backtrace | 相关堆栈

Fatal Exception: NSInternalInconsistencyException Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0xec678 (缺少 UUID 5a6c1f41bf7032f6a1d65b894dd21362)
1  libobjc.A.dylib                0x2bc80 objc_exception_throw
2  CoreAutoLayout                 0x56c8 (缺少 UUID 345fbfb5342b3f12a6ba6765e90b8d24)
3  CoreAutoLayout                 0xbadc (缺少 UUID 345fbfb5342b3f12a6ba6765e90b8d24)
4  CoreAutoLayout                 0xb7f0 (缺少 UUID 345fbfb5342b3f12a6ba6765e90b8d24)
5  CoreAutoLayout                 0xb57c (缺少 UUID 345fbfb5342b3f12a6ba6765e90b8d24)
6  UIKitCore                      0x344a8 (缺少 UUID 2d5384466e403c108a5f559c938077a0)
7  MYAPP                      0xbdd184 -[UIView(PAGUgenWidget) ugenLayoutSubviews] + 47 (PAGUgenWidget.m:47)
8  UIKitCore                      0x32c04 (缺少 UUID 2d5384466e403c108a5f559c938077a0)
9  QuartzCore                     0x667ec (缺少 UUID 5c3ee3d91aaa3052a6c7b957b454ad71)
10 QuartzCore                     0x66374 (缺少 UUID 5c3ee3d91aaa3052a6c7b957b454ad71)
11 QuartzCore                     0x6c860 (缺少 UUID 5c3ee3d91aaa3052a6c7b957b454ad71)
12 QuartzCore                     0x65b80 (缺少 UUID 5c3ee3d91aaa3052a6c7b957b454ad71)
13 QuartzCore                     0x65828 (缺少 UUID 5c3ee3d91aaa3052a6c7b957b454ad71)
14 CoreFoundation                 0x357bc (缺少 UUID 5a6c1f41bf7032f6a1d65b894dd21362)
15 CoreFoundation                 0x341c4 (缺少 UUID 5a6c1f41bf7032f6a1d65b894dd21362)
16 CoreFoundation                 0x338e0 (缺少 UUID 5a6c1f41bf7032f6a1d65b894dd21362)
17 CoreFoundation                 0x333f8 (缺少 UUID 5a6c1f41bf7032f6a1d65b894dd21362)
18 Flutter                        0x2f90cc (缺少 UUID 3adbf2891ee63561a26df1652313df7e)
19 Flutter                        0x2f8acc (缺少 UUID 3adbf2891ee63561a26df1652313df7e)
20 libsystem_pthread.dylib        0x24d4 (缺少 UUID 8f9c865b29f5346badd5fde40e008c66)
21 libsystem_pthread.dylib        0x1a10 (缺少 UUID 8f9c865b29f5346badd5fde40e008c66)
goodsprite commented 3 months ago

Hi. In our case it was Pangle sdk bug.

skytoup commented 3 months ago

Hi. In our case it was Pangle sdk bug.

https://github.com/bytedance/Bytedance-UnionAD/blob/70474109bd0eac4bb91968c0a18a030632d45a7f/Ads-Global/Ads-Global.podspec#L30

Isn't this your SDK?

PAGAdSDK.xcframework

+[UIView(PAGUgenWidget) load]
-[UIView ugenLayoutSubviews]
zhangfurun commented 2 months ago

同样也出现了, 循环调用

zhangfurun commented 2 months ago

经过查找, 发现 5.7.0.6.0 这个版本开始出现问题, 5.6.0.9.0这个没问题