iOS 17 Crash - UIGraphicsBeginImageContext() failed to allocate CGBitampContext
@jkmassel 已經在處理了。
開始於 2025年1月23日。
評估
這個 Issue 還沒有評估資料。
描述
We have encountered an issue in our application affecting users on iOS 17. Our users experience crashes due to the deprecated use of UIGraphicsBeginImageContextWithOptions in the HTMLAttachmentRenderer. As UIGraphicsBeginImageContext is deprecated in iOS 17, it sometimes throws errors under certain conditions:
Fatal Exception: NSInternalInconsistencyException
UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={-1, -1}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x83f20 __exceptionPreprocess
1 libobjc.A.dylib 0x172b8 objc_exception_throw
2 Foundation 0x6de934 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:]
3 UIKitCore 0xc2e34 _UIGraphicsBeginImageContextWithOptions
4 Pipedrive 0x852ab4 specialized HTMLAttachmentRenderer.textView(_:imageFor:with:) + 41 (HTMLAttachmentRenderer.swift:41)
5 Pipedrive 0x8aeca4 specialized TextView.storage(_:imageFor:with:) + 2158 (TextView.swift:2158)
6 Pipedrive 0x890748 protocol witness for RenderableAttachmentDelegate.attachment(_:imageForSize:) in conformance TextStorage + 584 (TextStorage.swift:584)
7 Pipedrive 0x852610 specialized HTMLAttachment.image(forBounds:textContainer:characterIndex:) + 92 (HTMLAttachment.swift:92)
8 Pipedrive 0x851a80 @objc HTMLAttachment.image(forBounds:textContainer:characterIndex:) (<compiler-generated>)
9 UIFoundation 0x84784 -[NSLayoutManager(NSPrivate) showAttachment:inRect:textContainer:characterIndex:]
10 UIFoundation 0x8173c -[NSLayoutManager(NSPrivate) _drawGlyphsForGlyphRange:atPoint:]
11 UIFoundation 0x2e830 -[NSTextStorage coordinateReading:]
12 UIKitCore 0x112f240 -[_UITextViewCanvasView drawTextInRect:]
13 UIKitCore 0x112ee44 -[_UITextCanvasView drawRect:]
14 UIKitCore 0xc2270 -[UIView(CALayerDelegate) drawLayer:inContext:]
15 UIKitCore 0x113055c -[_UITextTiledLayer drawInContext:]
16 QuartzCore 0xf92e0 CABackingStoreUpdate_
17 QuartzCore 0xf91d8 invocation function for block in CA::Layer::display_()
18 QuartzCore 0x808cc -[CALayer _display]
19 QuartzCore 0x7eefc CA::Layer::layout_and_display_if_needed(CA::Transaction*)
20 QuartzCore 0xd9fd8 CA::Context::commit_transaction(CA::Transaction*, double, double*)
21 QuartzCore 0x4eee0 CA::Transaction::commit()
22 QuartzCore 0x98c34 CA::Transaction::flush_as_runloop_observer(bool)
23 UIKitCore 0xb9ee8 _UIApplicationFlushCATransaction
24 UIKitCore 0xb7660 _UIUpdateSequenceRun
25 UIKitCore 0xb72a4 schedulerStepScheduledMainSection
26 UIKitCore 0xb8148 runloopSourceCallback
27 CoreFoundation 0x56834 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
28 CoreFoundation 0x567c8 __CFRunLoopDoSource0
29 CoreFoundation 0x54298 __CFRunLoopDoSources0
30 CoreFoundation 0x53484 __CFRunLoopRun
31 CoreFoundation 0x52cd8 CFRunLoopRunSpecific
32 GraphicsServices 0x11a8 GSEventRunModal
33 UIKitCore 0x40aae8 -[UIApplication _run]
34 UIKitCore 0x4bed98 UIApplicationMain
35 Pipedrive 0x78990 main + 19 (main.m:19)
36 ??? 0x1c37df154 (Missing)
Is there a way to avoid these types of errors, perhaps by replacing UIGraphicsBeginImageContext() with UIGraphicsImageRenderer?
- 主要語言
- Swift
- 星號
- 666
- 分支
- 154
- 平均合併
- 1 天 13 小時
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
wordpress-mobile/AztecEditor-iOS 的其他 Issue
-
Bug
難度 3/5 1-2 天 新手友好度 45/100
wordpress-mobile/AztecEditor-iOS#1417 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 45/100
wordpress-mobile/AztecEditor-iOS#1411 ·
-
難度 3/5 1-2 天 新手友好度 35/100
wordpress-mobile/AztecEditor-iOS#1399 ·
-
難度 3/5 1-2 天 新手友好度 35/100
wordpress-mobile/AztecEditor-iOS#1398 · 1 則留言 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
wordpress-mobile/AztecEditor-iOS#1397 ·
查看 wordpress-mobile/AztecEditor-iOS 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
Piwigo/Piwigo-Mobile#669 ·
-
area:shell good first issue order:6 status:ready type:bug
難度 2/5 1-3 小時 新手友好度 84/100
krystianslowik/arkt#564 ·
維護者通常 1 天內回覆
-
🎉 Add PandaPal未關閉
難度 1/5 1 小時以內 新手友好度 62/100
jaywcjlove/awesome-mac#4192 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 68/100
-
@-mention suggestions don't match a display name typed without its spaces (Element Web does)可能已有人在做 @dwong716 今天認領。 未關閉T-Defect
難度 2/5 1-3 小時 新手友好度 78/100
element-hq/element-x-ios#6457 ·
維護者通常 1 天內回覆