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

[iOS]iOS17闪退,WXComponent+Display.m objc_loadWeakRetained #3341

Open
peerlessheidi opened this issue Mar 6, 2024 · 4 comments
Open

Comments

@peerlessheidi
Copy link

iOS17上有个闪退:
0x106f411e8 <+52>: tbz w0, #0x0, 0x106f411f4 ; <+64> at WXComponent+Display.m:146:39
0x106f411ec <+56>: mov x20, #0x0
0x106f411f0 <+60>: b 0x106f41280 ; <+204> at WXComponent+Display.m:164:5
0x106f411f4 <+64>: add x0, x19, #0x20
0x106f411f8 <+68>: bl 0x1071ecd28 ; symbol stub for: objc_loadWeakRetained
0x106f411fc <+72>: mov x19, x0
0x106f41200 <+76>: cbz x0, 0x106f41278 ; <+196> at WXComponent+Display.m
0x106f41204 <+80>: fcmp d11, #0.0
0x106f41208 <+84>: fmov d0, #1.00000000
0x106f4120c <+88>: fcsel d11, d11, d0, ne
0x106f41210 <+92>: fcmp d10, #0.0
0x106f41214 <+96>: fcsel d10, d10, d0, ne
0x106f41218 <+100>: mov x0, x19
0x106f4121c <+104>: fmov d0, d11
0x106f41220 <+108>: fmov d1, d10
0x106f41224 <+112>: bl 0x1071f9ae0 ; objc_msgSend$_bitmapOpaqueWithSize:
0x106f41228 <+116>: fmov d2, xzr
0x106f4122c <+120>: fmov d0, d11
0x106f41230 <+124>: fmov d1, d10
0x106f41234 <+128>: bl 0x1071eb2dc ; symbol stub for: UIGraphicsBeginImageContextWithOptions
-> 0x106f41238 <+132>: mov x0, x19
0x106f4123c <+136>: fmov d0, d9
0x106f41240 <+140>: fmov d1, d8
0x106f41244 <+144>: fmov d2, d11
0x106f41248 <+148>: fmov d3, d10
0x106f4124c <+152>: bl 0x10721f200 ; objc_msgSend$drawRect:
0x106f41250 <+156>: mov x29, x29
0x106f41254 <+160>: bl 0x1071ecdc4 ; symbol stub for: objc_retainAutoreleasedReturnValue
0x106f41258 <+164>: mov x20, x0
0x106f4125c <+168>: cbnz x0, 0x106f41270 ; <+188> at WXComponent+Display.m:157:13
0x106f41260 <+172>: bl 0x1071eb300 ; symbol stub for: UIGraphicsGetImageFromCurrentImageContext
0x106f41264 <+176>: mov x29, x29
0x106f41268 <+180>: bl 0x1071ecdc4 ; symbol stub for: objc_retainAutoreleasedReturnValue
0x106f4126c <+184>: mov x20, x0
0x106f41270 <+188>: bl 0x1071eb2e8 ; symbol stub for: UIGraphicsEndImageContext
0x106f41274 <+192>: b 0x106f4127c ; <+200> at WXComponent+Display.m
0x106f41278 <+196>: mov x20, #0x0
0x106f4127c <+200>: bl 0x106f44264 ; _OUTLINED_FUNCTION_18
0x106f41280 <+204>: mov x0, x20
0x106f41284 <+208>: ldp x29, x30, [sp, #0x30]
0x106f41288 <+212>: ldp x20, x19, [sp, #0x20]
0x106f4128c <+216>: ldp d9, d8, [sp, #0x10]
0x106f41290 <+220>: ldp d11, d10, [sp], #0x40
0x106f41294 <+224>: b 0x1071ecc2c ; symbol stub for: objc_autoreleaseReturnValue

升级到XCode15后,会闪退,后判断了size的width和height非零,iOS17之下就不闪退了:
CGFloat width = bounds.size.width ?: 1;
CGFloat height = bounds.size.height ?: 1;
CGSize size = CGSizeMake(width, height);
UIGraphicsBeginImageContextWithOptions(size, [self _bitmapOpaqueWithSize:size], 0.0);
但是iOS17上还会闪退
啥原因呢?

@topcloud-xx
Copy link

我是这么修改的。
image

@lovederh
Copy link

lovederh commented May 7, 2024

我是这么修改的。 image

可以, 不崩溃了, 感谢分享

@firekyrin
Copy link

firekyrin commented May 7, 2024 via email

@jobscolin
Copy link

我是这么修改的。 image

感谢广大网友帮忙解决遗留weex 项目的💩山问题

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

5 participants