Whoa very interesting.
I have 6 of such threads and they all seem to be at the MPMediaItemArtwork.image(at:) call for different table cells. They are like this:
thread #9, queue = 'com.apple.root.user-initiated-qos.cooperative'
frame #0: 0x00000002106bf5e0 libsystem_kernel.dylib`__ulock_wait + 8
frame #1: 0x000000010307abdc libdispatch.dylib`_dlock_wait + 56
frame #2: 0x000000010307a990 libdispatch.dylib`_dispatch_thread_event_wait_slow + 56
frame #3: 0x000000010308bc54 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 384
frame #4: 0x000000010308b594 libdispatch.dylib`_dispatch_sync_f_slow + 180
frame #5: 0x00000001f6ee6940 MusicLibrary`-[ML3ArtworkConfiguration supportedSizesForMediaType:artworkType:] + 248
frame #6: 0x00000001e37c64ec MediaPlayer`-[MPArtworkConfiguration supportedSizesForMediaType:artworkType:] + 68
frame #7: 0x00000001e3704290 MediaPlayer`-[MPMediaLibraryArtwork validSizes] + 120
frame #8: 0x00000001e379c814 MediaPlayer`-[MPMediaLibraryArtworkDataSource _existingRepresentationForArtworkCatalog:fromCacheOnly:] + 208
frame #9: 0x00000001e379c9c0 MediaPlayer`-[MPMediaLibraryArtworkDataSource existingRepresentationForArtworkCatalog:] + 48
frame #10: 0x00000001e363ac50 MediaPlayer`-[MPArtworkCatalog bestImageFromDisk] + 40
frame #11: 0x00000001e368e6a8 MediaPlayer`__70-[MPConcreteMediaItemArtwork initWithArtworkCatalog:allowsNetworking:]_block_invoke + 296
(...)
That ulock_wait at the top seems to suggest there is a concurrency issue with this API, right? Or I might be using the wrong kind of queue!
I will definitely watch that session. Thanks for the insight!!!!
Post
Replies
Boosts
Views
Activity
Kind of. I can run it in the simulator but the music library is not available in the simulator, so I mock some library items. In this scenario the bit that uses MPMediaItemArtwork is not run at all.
I'm not seeing issues with Tasks there.
Nope, it works fine there.
New report:
Started failing again
Made minimal app with a Task and works fine
Problematic app: I saw that Tasks initially work but eventually stop working. I pinned it down to the use of this API:
https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork/1621736-image
Attempting to get a UIImage out of a MPMediaItemArtwork object is enough to break it (!!!)
Again, not all devices and possibly not all OS versions, even not every time I launch the app on the same device. But when it fails systematically, I comment out the above API usage and the issue is gone.
Is this something you can investigate further?
It is working now :-/
I've seen the issue before and eventually it fixed itself, I presumed from updating to a new OS beta.
Now I see it works, it's the same app, same device and same OS version. I will report back if I see the issue again and do the minimal app test, thanks for replying!
Well this may well be a bug in the beta release so I just sent feedback to Apple.
Hey. One year later, I'm curious about what you ended up doing.
What I understand from DMG's answer regarding the master object with an NSOrderedSet, it seems to be exactly what iCloud sync WON'T allow, thus requiring some sort of manual ordering, perhaps keeping an index yourself somewhere. This is what I think I have to do now for my project :-/
Same here. Runs from Xcode but crashes instantly from TestFlight. I found that message in the logs, I have no way to get a crash log, either via TestFlight feedback or Xcode Organizer.
The only difference in this build from previous ones that didn't have this issue is that I added an Intents extension for Siri support.
Not crashing in Xcode 12 beta