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

+[PINDiskCache moveItemAtURLToTrash:] (PINDiskCache.m:451) Crashed at -[NSURL fileSystemRepresentation] #303

Open
Jason-Stan-Lee opened this issue Jan 20, 2021 · 5 comments

Comments

@Jason-Stan-Lee
Copy link

Jason-Stan-Lee commented Jan 20, 2021

The _sharedTrashURL generated with [[NSProcessInfo processInfo] globallyUniqueString]; contains %00%00%00%00 , lead to a crash.

Device: iPhone Xr
iOS 14.2 (18B92)

*** -[NSURL fileSystemRepresentation]: conversion failed for file:///private/var/mobile/Containers/Data/Application/40AC63D8-3BD7-458B-BAC6-6396A78BD715/tmp/FE7F1C30-38EE-47ED-BB37-8FE73EA7873A-64416-000010D9F50E%00%00%00%00/7F3D3218-6F96-4724-9853-19D242240A2F-64416-000010D9F50F2CDB

0 CoreFoundation | ___exceptionPreprocess + 220
-- | --
1 libobjc.A.dylib | objc_exception_throw + 60
2 Foundation | -[NSURL(NSURL) fileSystemRepresentation] + 668
3 Foundation | -[NSFilesystemItemMoveOperation main] + 124
4 Foundation | ___NSOPERATION_IS_INVOKING_MAIN__ + 24
5 Foundation | -[NSOperation start] + 808
6 Foundation | -[NSFileManager moveItemAtURL:toURL:options:error:] + 312
7 MyApp | +[PINDiskCache moveItemAtURLToTrash:] (PINDiskCache.m:451)
8 MyApp | -[PINDiskCache removeFileAndExecuteBlocksForKey:] (PINDiskCache.m:688)
9 MyApp | -[PINDiskCache trimDiskToSizeByDate:] (PINDiskCache.m:779)
10 MyApp | __49-[PINDiskCache trimToSizeByDateAsync:completion:]_block_invoke (PINDiskCache.m:974)
11 MyApp | __44-[PINOperationQueue scheduleNextOperations:]_block_invoke (PINOperationQueue.m:346)
12 libdispatch.dylib | __dispatch_call_block_and_release + 32
13 libdispatch.dylib | __dispatch_client_callout + 20
14 libdispatch.dylib | __dispatch_lane_serial_drain + 580

@garrettmoon
Copy link
Collaborator

@Jason-Stan-Lee Can you post an example project that reproduces this?

@Jason-Stan-Lee
Copy link
Author

@Jason-Stan-Lee Can you post an example project that reproduces this?

Nope. It was finded in my crash collector, but I never reproduce this case.

@garrettmoon
Copy link
Collaborator

@Jason-Stan-Lee is it something you're seeing occur a lot? Is there any particular version of iOS it occurs on?

@Jason-Stan-Lee
Copy link
Author

Jason-Stan-Lee commented Jan 22, 2021

@Jason-Stan-Lee is it something you're seeing occur a lot? Is there any particular version of iOS it occurs on?

@garrettmoon There are very few crashes, perhaps one over a million or a billion, the platforms which crashed are in following

iPhone Xr | 12.3 (16F156)
iPhone 11 Pro Max | 13.3.1 (17D50)
iPhone Xr | 13.1.3 (17A878)

I guess the globallyUniqueString is not very suitable for url path.

@garrettmoon
Copy link
Collaborator

Got it, thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants