About cpu_resource_fatal

PLATFORM AND VERSION

iOS Development environment: Xcode 15.0, macOS 14.4.1, Objective-C

Run-time configuration: iOS 17.2.1,

DESCRIPTION OF PROBLEM

What is the general approach to analyzing cpu_resource_fatal.ips? Is there a standard way to analyze it? (Instruments are not available in this analysis, because this is only occurs on the customer's iPhone.)

Also, can this file be symbolicate?

Attachment file is a sample ips file.

{"app_name":"FjSoftPhone","timestamp":"2024-06-21 15:03:21.00 +0900","app_version":"1.8.2","slice_uuid":"674C4E6B-A64F-3910-A1C4-FDC3DFC8D7E1","adam_id":1486284968,"build_version":"2405291953","bundleID":"com.fujitsu.FjSoftPhoneC","duration_ms":"9021","share_with_app_devs":0,"is_first_party":0,"bug_type":"206","os_version":"iPhone OS 16.1.1 (20B101)","incident_id":"77543A8A-691A-486E-87FA-E06DEDAED977","name":"FjSoftPhone","roots_installed":0}Date/Time:        2024-06-21 15:03:11.970 +0900End time:         2024-06-21 15:03:20.992 +0900OS Version:       iPhone OS 16.1.1 (Build 20B101)Architecture:     arm64eReport Version:   40Incident Identifier: 77543A8A-691A-486E-87FA-E06DEDAED977Data Source:      MicrostackshotsShared Cache:     268D68C1-E401-317D-B247-F885B5CF7A57 slid base address 0x1ac030000, slide 0x2c030000Command:          FjSoftPhonePath:             /private/var/containers/Bundle/Application/8950123C-ADCF-4727-BA4B-5D1746A4FA29/FjSoftPhone.app/FjSoftPhoneIdentifier:       com.fujitsu.FjSoftPhoneCVersion:          1.8.2 (2405291953)Adam ID:          1486284968Is First Party:   NoBeta Identifier:  E11360B2-7E60-4820-8F87-66DC203BB754Resource Coalition ID: 460Architecture:     arm64PID:              670Event:            cpu usageAction taken:     Process killedCPU:              9 seconds cpu time over 9 seconds (100% cpu average), exceeding limit of 60% cpu over 15 secondsCPU limit:        9sLimit duration:   15sCPU used:         9sCPU duration:     9sDuration:         9.02sDuration Sampled: 3.67sSteps:            3Hardware model:   iPhone14,6Active cpus:      6HW page size:     16384VM page size:     16384Advisory levels:  Battery -> 1, User -> 3, ThermalPressure -> 0, Combined -> 1Free disk space:  42.70 GB/59.51 GB, low space threshold 150 MBVnodes Available: 33.28% (3328/10000)Preferred User Language: ja-JPCountry Code:     JPKeyboards:        en_JP QWERTY, ja_JP-Romaji QWERTY-JapaneseOS Cryptex File Extents: 4Heaviest stack for the target process:  3  ??? (libsystem_pthread.dylib + 2980) [0x1ffe23ba4]  3  ??? (libsystem_pthread.dylib + 5836) [0x1ffe246cc]  2  ??? (FjSoftPhone + 2223612) [0x104eb2dfc]  1  ??? (FjSoftPhone + 2199612) [0x104ead03c]  1  ??? (FjSoftPhone + 1699428) [0x104e32e64]  1  ??? (FjSoftPhone + 3985244) [0x105060f5c]  1  ??? (FjSoftPhone + 3945448) [0x1050573e8]  1  ??? (FjSoftPhone + 4064376) [0x105074478]  1  ??? (FjSoftPhone + 4068300) [0x1050753cc]  1  ??? (FjSoftPhone + 4058652) [0x105072e1c]  1  ??? (FjSoftPhone + 2503372) [0x104ef72cc]  1  ??? (FjSoftPhone + 2503696) [0x104ef7410]  1  ??? (FjSoftPhone + 2507812) [0x104ef8424]  1  ??? (libsystem_kernel.dylib + 6516) [0x1ef9c2974]Powerstats for:   FjSoftPhone [670]UUID:             674C4E6B-A64F-3910-A1C4-FDC3DFC8D7E1Path:             /private/var/containers/Bundle/Application/8950123C-ADCF-4727-BA4B-5D1746A4FA29/FjSoftPhone.app/FjSoftPhoneIdentifier:       com.fujitsu.FjSoftPhoneCVersion:          1.8.2 (2405291953)Adam ID:          1486284968Is First Party:   NoBeta Identifier:  E11360B2-7E60-4820-8F87-66DC203BB754Resource Coalition ID: 460Architecture:     arm64Footprint:        37.77 MBStart time:       2024-06-21 15:03:15.774 +0900End time:         2024-06-21 15:03:19.441 +0900Num samples:      3 (100%)Primary state:    3 samples Non-Frontmost App, Non-Suppressed, User mode, Effective Thread QoS Default, Requested Thread QoS Default, Override Thread QoS UnspecifiedUser Activity:    3 samples Idle, 0 samples ActivePower Source:     3 samples on Battery, 0 samples on AC  3  ??? (libsystem_pthread.dylib + 2980) [0x1ffe23ba4]    3  ??? (libsystem_pthread.dylib + 5836) [0x1ffe246cc]      2  ??? (FjSoftPhone + 2223612) [0x104eb2dfc]        1  ??? (FjSoftPhone + 2199612) [0x104ead03c]          1  ??? (FjSoftPhone + 1699428) [0x104e32e64]            1  ??? (FjSoftPhone + 3985244) [0x105060f5c]              1  ??? (FjSoftPhone + 3945448) [0x1050573e8]                1  ??? (FjSoftPhone + 4064376) [0x105074478]                  1  ??? (FjSoftPhone + 4068300) [0x1050753cc]                    1  ??? (FjSoftPhone + 4058652) [0x105072e1c]                      1  ??? (FjSoftPhone + 2503372) [0x104ef72cc]                        1  ??? (FjSoftPhone + 2503696) [0x104ef7410]                          1  ??? (FjSoftPhone + 2507812) [0x104ef8424]                            1  ??? (libsystem_kernel.dylib + 6516) [0x1ef9c2974]        1  ??? (FjSoftPhone + 2199576) [0x104ead018]          1  ??? (libsystem_malloc.dylib + 27172) [0x1c11c5a24]            1  ??? (libsystem_platform.dylib + 3212) [0x1ffd8ec8c]      1  ??? (FjSoftPhone + 2222488) [0x104eb2998]  Binary Images:           0x104c94000 -                ???  com.fujitsu.FjSoftPhoneC 1.8.2 (2405291953) <674C4E6B-A64F-3910-A1C4-FDC3DFC8D7E1>  /private/var/containers/Bundle/Application/8950123C-ADCF-4727-BA4B-5D1746A4FA29/FjSoftPhone.app/FjSoftPhone           0x1c11bf000 -        0x1c11e2ff7  libsystem_malloc.dylib                      <39FB1F8C-48EF-3DD0-8D74-FF55E8D07C60>  /usr/lib/system/libsystem_malloc.dylib           0x1ef9c1000 -        0x1ef9f7ffb  libsystem_kernel.dylib                      <FF27FC8F-90BA-3332-AB7A-C5BC2D9CA7B1>  /usr/lib/system/libsystem_kernel.dylib           0x1ffd8e000 -        0x1ffd94ff3  libsystem_platform.dylib                    <29A26364-ACEF-38C2-8B0D-DB0DFCA0BB65>  /usr/lib/system/libsystem_platform.dylib           0x1ffe23000 -        0x1ffe2efff  libsystem_pthread.dylib                     <1AA3A4B6-F9E7-3056-8C8B-4E4DD81312A4>  /usr/lib/system/libsystem_pthread.dylib
Answered by DTS Engineer in 793610022

What is the general approach to analyzing cpu_resource_fatal.ips?

In terms of how the log is structured and how it can be interpreted, my response to this thread on "wakeups" is a good summary of what's actually in the data. The cause is obviously different, but the collection method and data format are exactly the same.

Is there a standard way to analyze it?

Yes and no. Going through the process above can tell you want the stack shows, but how useful/helpful it will be is hard to predict. The reality is that the kernel is sampling a tiny portion of your overall runtime and there isn't anyway to know exactly what's "missing".

One point to make on the termination reason itself:

9 seconds cpu time over 9 seconds (100% cpu average), exceeding limit of 60% cpu over 15 second

Any responsible background app needs to keep in mind that it's operating in a shared in environment and that it needs to contrains it's activities to account for that, particularly high priority categories like "voip". The limits the system has defined should NOT be treated as the acceptable limit you can/should grow toward, but as a hard limit that your app shouldn't be getting anywhere near. A background app hitting "60% CPU over 15s" (and you hit 100%) is NOT well behaved.

The first thing you should actually look at here is what you're "normal" usage load actually looks like and how close to those thresholds you actually are. While it's likely that there are specific factors that pushed you over the limit, those factors don't really matter very much if your app regularly "hovers" at 50%+ load.

Also, can this file be symbolicate?

Sure. This is covered in detail in "Adding identifiable symbol names to a crash report", just make sure you scroll past the initial sections on xcode and get to command line symbolication.

Pulling an example from your log, here is one of the stack frames and the library load entry:

      2  ??? (FjSoftPhone + 2223612) [0x104eb2dfc]
... 
     0x104c94000 -                ???  com.fujitsu.FjSoftPhoneC 1.8.2 (2405291953) <674C4E6B-A64F-3910-A1C4-FDC3DFC8D7E1>  /private/var/containers/Bundle/Application/8950123C-ADCF-4727-BA4B-5D1746A4FA29/FjSoftPhone.app/FjSoftPhone           

The atos command line format is:

% atos -arch arm64 -o <symbol file path> -l <library load address> <execution address>

Which would make the frame above:

% atos -arch arm64 -o <symbol file path> -l 0x104c94000 0x104eb2dfc

or (if atos wants a 64 bit execution address)

% atos -arch arm64 -o <symbol file path> -l 0x104c94000 0x0000000104eb2dfc

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

What is the general approach to analyzing cpu_resource_fatal.ips?

In terms of how the log is structured and how it can be interpreted, my response to this thread on "wakeups" is a good summary of what's actually in the data. The cause is obviously different, but the collection method and data format are exactly the same.

Is there a standard way to analyze it?

Yes and no. Going through the process above can tell you want the stack shows, but how useful/helpful it will be is hard to predict. The reality is that the kernel is sampling a tiny portion of your overall runtime and there isn't anyway to know exactly what's "missing".

One point to make on the termination reason itself:

9 seconds cpu time over 9 seconds (100% cpu average), exceeding limit of 60% cpu over 15 second

Any responsible background app needs to keep in mind that it's operating in a shared in environment and that it needs to contrains it's activities to account for that, particularly high priority categories like "voip". The limits the system has defined should NOT be treated as the acceptable limit you can/should grow toward, but as a hard limit that your app shouldn't be getting anywhere near. A background app hitting "60% CPU over 15s" (and you hit 100%) is NOT well behaved.

The first thing you should actually look at here is what you're "normal" usage load actually looks like and how close to those thresholds you actually are. While it's likely that there are specific factors that pushed you over the limit, those factors don't really matter very much if your app regularly "hovers" at 50%+ load.

Also, can this file be symbolicate?

Sure. This is covered in detail in "Adding identifiable symbol names to a crash report", just make sure you scroll past the initial sections on xcode and get to command line symbolication.

Pulling an example from your log, here is one of the stack frames and the library load entry:

      2  ??? (FjSoftPhone + 2223612) [0x104eb2dfc]
... 
     0x104c94000 -                ???  com.fujitsu.FjSoftPhoneC 1.8.2 (2405291953) <674C4E6B-A64F-3910-A1C4-FDC3DFC8D7E1>  /private/var/containers/Bundle/Application/8950123C-ADCF-4727-BA4B-5D1746A4FA29/FjSoftPhone.app/FjSoftPhone           

The atos command line format is:

% atos -arch arm64 -o <symbol file path> -l <library load address> <execution address>

Which would make the frame above:

% atos -arch arm64 -o <symbol file path> -l 0x104c94000 0x104eb2dfc

or (if atos wants a 64 bit execution address)

% atos -arch arm64 -o <symbol file path> -l 0x104c94000 0x0000000104eb2dfc

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

About cpu_resource_fatal
 
 
Q