Skip to content

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

Open

Description

@Jason-Stan-Lee

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

Activity

  1. garrettmoon commented on Jan 20, 2021

    @garrettmoon
    Collaborator

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

  2. Jason-Stan-Lee commented on Jan 21, 2021

    @Jason-Stan-Lee
    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.

  3. garrettmoon commented on Jan 21, 2021

    @garrettmoon
    Collaborator

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

  4. Jason-Stan-Lee commented on Jan 22, 2021

    @Jason-Stan-Lee
    Author

    @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.

  5. garrettmoon commented on Jan 22, 2021

    @garrettmoon
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions