CoreGraphics CGPDFPagePurgeResources

The crashes CoreGraphics. CGPDFPagePurgeResources in IOS 16 beta version when the app becomes in the foreground for the second time while the same scenario works fine in ios 15 and before

the same scenario works fine in ios 15 and before

As a general rule such compatibility problems are bugworthy. Please post your bug number, just for the record.

As to what you can do in the meantime, it’s hard to say. Please post an example crash report for this. See Posting a Crash Report for advice on how to do that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi @Shady_atef is there any pdf file process on the screen when the crash occurs?

@ymeksur Yes it is a UIWebview that displays and PDF file.

I do face the same issue, here is the stracktrace from the crash. We experience it only on iOS 16 when attempting to open a PDF file in UIWebView.

Dispatch queue: com.apple.coreanimation.imageprovider.concurrent (11)#0	(null) in os_unfair_lock_lock ()
#1	(null) in CGPDFPagePurgeResources ()
#2	(null) in CGContextDrawPDFPageWithDrawingCallbacks ()
#3	(null) in CGContextDrawPDFPageWithProgressCallback ()
#4	(null) in -[UIPDFPageContentDelegate drawLayer:inContext:] ()
#5	(null) in tiled_layer_render(_CAImageProvider*, unsigned int, unsigned int, unsigned int, unsigned int, void*) ()
#6	(null) in CAImageProviderThread(unsigned int*, bool) ()
#7	(null) in _dispatch_client_callout ()
#8	(null) in _dispatch_continuation_pop ()
#9	(null) in _dispatch_async_redirect_invoke ()
#10	(null) in _dispatch_root_queue_drain ()
#11	(null) in _dispatch_worker_thread2 ()
#12	(null) in _pthread_wqthread ()
#13	(null) in start_wqthread ()

same issue. When I open a pdf file with uiwebview, the app crashes.

Can someone please post a full crash report for this. See Posting a Crash Report for advice on how to do that.

Also, you realise that UIWebView is deprecated right? And has been deprecated since the iOS 12 SDK? While it shouldn’t crash like this, it’s way past time for you to have moved over to WKWebView.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I’m sorry but I need the full crash report, not just the crashing thread’s backtrace.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I have the same issue as KimSC. Either on scrolling or a long press, the App crashes.

Crashed: com.apple.coreanimation.imageprovider.concurrent
0  libsystem_platform.dylib       0x23bc os_unfair_lock_lock + 12
1  CoreGraphics                   0xf2540 CGPDFPagePurgeResources + 36
2  CoreGraphics                   0xcc008 CGContextDrawPDFPageWithDrawingCallbacks + 860
3  CoreGraphics                   0xf2a98 CGContextDrawPDFPageWithProgressCallback + 36
4  CorePDF                        0x6e554 -[UIPDFPageContentDelegate drawLayer:inContext:] + 364

Here I'll let a full crash report where on thread 16 you can see the crash at the os_unfair_lock_lock.

Thanks!

Thanks for the crash report.

Unfortunately it didn’t yield anything super interesting. It’s clear that UIWebView is in the process of rendering a PDF and has hit some sort of concurrency bug (you know you have concurrency problems when your mutex code crashes)-: My advice:

  • Definitely file a bug about this. While UIWebView is deprecated, it should crash. Please post your bug number, just for the record.

  • Think about accelerating your UIWebView to WKWebView transition. You’re going to have to do that at some point anyway, so maybe now is the right time.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi! I have a somewhat similar issue. Users with iOS16 are experiencing crashes when trying to view a PDF file on a UIWebView (CoreGraphics CGPDFPagePurgeResources), right after loading the request. I filed a report on Feedback Assistant (FB11602834).

Tried to migrate to WKWebView but started to receive compiler errors like "WKWebView before iOS 11.0 (NSCoding support was broken in previous versions)" and straight up Xcode error like "executable path is directory Xcode"

Hi! I have a somewhat similar issue after updating to iOS 16. Earlier versions are working fine

The same here, I started receiving tons of crash reports from iOS 16.*+ devices. It breaks everything

Crashed: Thread
EXC_BAD_ACCESS 0x000000009e4b0510
0  libsystem_platform.dylib  os_unfair_lock_lock + 12
1  CoreGraphics              CGContextDrawPDFPageWithDrawingCallbacks + 860
2  CoreGraphics              CGContextDrawPDFPageWithProgressCallback + 36
3  CorePDF                   -[UIPDFPageContentDelegate drawLayer:inContext:] + 364
4  QuartzCore                tiled_layer_render(_CAImageProvider*, unsigned int, unsigned int, unsigned int, unsigned int, void*) + 1368
5  QuartzCore                CAImageProviderThread(unsigned int*, bool) + 996
6  libdispatch.dylib         _dispatch_client_callout + 20
7  libdispatch.dylib         _dispatch_continuation_pop + 504
8  libdispatch.dylib         _dispatch_async_redirect_invoke + 584
9  libdispatch.dylib         _dispatch_root_queue_drain + 396
10 libdispatch.dylib         _dispatch_worker_thread2 + 164
11 libsystem_pthread.dylib   _pthread_wqthread + 228

Still broken in 16.0.3... ugh...

It looks like this bug was solved in 16.1, but is there a workaround for 16.0? Since there are a lot of users using this versions yet.

CoreGraphics CGPDFPagePurgeResources
 
 
Q