Critical Bug in Screen Time Frameworks – User's Phone Rendered Unusable

Hello Apple Developer Community,

We're experiencing a critical issue with the Screen Time frameworks, and it's affecting one of our users severely. I'm hoping someone here can provide guidance or a potential solution.

Details:

  • Our app offers a feature using the ManagedSettings shield that lets users block all apps based on a set schedule.
  • After the scheduled block ends, the apps are expected to become accessible again.
  • In one case, a user reported that the apps did not unblock after the schedule ended.
  • Upon trying to manually end the session from within our app, the app only displays a blank white screen.
  • The user attempted to disable Screen Time access for our app via the iOS settings, but the apps remained blocked.
  • Even after completely disabling Screen Time from the settings or restarting the phone, the apps stayed blocked.

Interestingly, I attempted to replicate the issue on my end by toggling Screen Time settings and restarting, but everything worked as expected and I could not reproduce the problem.

This issue, though seemingly isolated, has rendered a user's phone virtually unusable, and highlights a potential high-impact bug within the Screen Time framework. It feels necessary for there to be a "master off-switch" or a fail-safe mechanism in these scenarios.

Any insights, solutions, or workarounds would be deeply appreciated. It's crucial for us to support our user and resolve this promptly.

Thank you in advance!

Attached is a crash report from the user. Looks like the app is terminated by the system because it's not able launch to in the allotted time allowed by the system. The stack trace includes FamilyControls waiting for a reply from an XPC connection. FamilyControls is the framework that gives the app access to screen time. So it looks like the app is not able to get Screen Time access, and is never able to launch.

{"app_name":"Screentox","timestamp":"2023-09-25 14:55:04.00 -0400","app_version":"0.16.9","slice_uuid":"5057c7ee-9215-3fca-873a-4796b8254ee4","adam_id":"1644737181","build_version":"1","platform":2,"bundleID":"com.getpresentapp.Present","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"iPhone OS 17.0.1 (21A340)","roots_installed":0,"name":"Screentox","incident_id":"6C0573D4-F450-4A78-B38E-C7E6CF50ADAD"}
{
  "uptime" : 86,
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "iPhone14,3",
  "coalitionID" : 633,
  "osVersion" : {
    "isEmbedded" : true,
    "train" : "iPhone OS 17.0.1",
    "releaseType" : "User",
    "build" : "21A340"
  },
  "captureTime" : "2023-09-25 14:55:04.0676 -0400",
  "codeSigningMonitor" : 2,
  "incident" : "6C0573D4-F450-4A78-B38E-C7E6CF50ADAD",
  "pid" : 424,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2023-09-25 14:54:44.0389 -0400",
  "procStartAbsTime" : 1599932040,
  "procExitAbsTime" : 2080578169,
  "procName" : "Screentox",
  "procPath" : "\/private\/var\/containers\/Bundle\/Application\/43D2455A-475E-493F-A572-C6FACF0C970F\/Screentox.app\/Screentox",
  "bundleInfo" : {"CFBundleShortVersionString":"0.16.9","CFBundleVersion":"1","CFBundleIdentifier":"com.getpresentapp.Present","DTAppStoreToolsBuild":"15A240a"},
  "storeInfo" : {"storeCohortMetadata":"10|date=1695652200000&sf=143441&pgtp=Search&pgid=7baa5550-d1c8-4cdb-81be-94b3ddbdf4c9&prpg=SearchLanding_SearchLanding&ctxt=Search&issrch=1&imptyp=card&kind=iosSoftware&lngid=1","itemID":"1644737181","deviceIdentifierForVendor":"9FD53F9A-5483-416F-A10F-7D67688004AE","softwareVersionExternalIdentifier":"860040016","thirdParty":true,"applicationVariant":"1:iPhone14,3:16"},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "com.getpresentapp.Present",
  "crashReporterKey" : "80a1fd48b3726682cb61f1a1601274c8db219668",
  "wasUnlockedSinceBoot" : 1,
  "isLocked" : 0,
  "codeSigningID" : "com.getpresentapp.Present",
  "codeSigningTeamID" : "5P6PK95TTP",
  "codeSigningFlags" : 570450689,
  "codeSigningValidationCategory" : 4,
  "codeSigningTrustLevel" : 5,
  "instructionByteStream" : {"beforePC":"ARAA1MADX9aQBYCSARAA1MADX9awBYCSARAA1MADX9bQBYCSARAA1A==","atPC":"wANf1vAFgJIBEADUwANf1hAGgJIBEADUwANf1jAGgJIBEADUwANf1g=="},
  "basebandVersion" : "3.06.01",
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGKILL"},
  "termination" : {"code":2343432205,"flags":6,"namespace":"FRONTBOARD","reasons":[":424 exhausted real (wall clock) time allowance of 20.00 seconds","ProcessVisibility: Foreground","ProcessState: Running","WatchdogEvent: process-launch","WatchdogVisibility: Foreground","WatchdogCPUStatistics: (","\"Elapsed total CPU time (seconds): 88.660 (user 65.380, system 23.280), 74% CPU\",","\"Elapsed application CPU time (seconds): 0.050, 0% CPU\"",") reportType:CrashLog maxTerminationResistance:Interactive>"]},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":6036,"threadState":{"x":[{"value":268451845},{"value":17297326606},{"value":0},{"value":6403},{"value":0},{"value":12107512807424},{"value":16384},{"value":0},{"value":18446744073709550527},{"value":2819},{"value":0},{"value":1},{"value":2819},{"value":2819},{"value":1049137},{"value":1},{"value":18446744073709551569},{"value":8721666624,"symbolLocation":0,"symbol":"OBJC_CLASS_$_OS_dispatch_mach_msg"},{"value":0},{"value":0},{"value":16384},{"value":12107512807424},{"value":0},{"value":6403},{"value":6166210112},{"value":0},{"value":17297326606},{"value":17297326606},{"value":117457422}],"flavor":"ARM_THREAD_STATE64","lr":{"value":8541962096},"cpsr":{"value":4096},"fp":{"value":6166209776},"sp":{"value":6166209696},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":8541962712,"matchesCrashFrame":1},"far":{"value":8809672592}},"queue":"com.apple.main-thread","frames":[{"imageOffset":4568,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":1},{"imageOffset":3952,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":1},{"imageOffset":3720,"symbol":"mach_msg_overwrite","symbolLocation":436,"imageIndex":1},{"imageOffset":3272,"symbol":"mach_msg","symbolLocation":24,"imageIndex":1},{"imageOffset":126720,"symbol":"_dispatch_mach_send_and_wait_for_reply","symbolLocation":540,"imageIndex":2},{"imageOffset":127648,"symbol":"dispatch_mach_send_with_result_and_wait_for_reply","symbolLocation":60,"imageIndex":2},{"imageOffset":67280,"symbol":"xpc_connection_send_message_with_reply_sync","symbolLocation":264,"imageIndex":3},{"imageOffset":235200,"symbol":"__NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__","symbolLocation":16,"imageIndex":4},{"imageOffset":136124,"symbol":"-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]","symbolLocation":2160,"imageIndex":4},{"imageOffset":313036,"symbol":"-[NSXPCConnection _sendSelector:withProxy:arg1:]","symbolLocation":116,"imageIndex":4},{"imageOffset":312836,"symbol":"_NSXPCDistantObjectSimpleMessageSend1","symbolLocation":60,"imageIndex":4},{"imageOffset":243112,"imageIndex":5},{"imageOffset":239688,"imageIndex":5},{"imageOffset":17152,"symbol":"_dispatch_client_callout","symbolLocation":20,"imageIndex":2},{"imageOffset":23356,"symbol":"_dispatch_once_callout","symbolLocation":32,"imageIndex":2},{"imageOffset":240208,"imageIndex":5},{"imageOffset":1434536,"imageIndex":0},{"imageOffset":14459940,"imageIndex":6},{"imageOffset":29204,"imageIndex":0},{"imageOffset":23876,"symbol":"start","symbolLocation":2104,"imageIndex":7}]},{"id":6166,"frames":[{"imageOffset":6652,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":9}],"threadState":{"x":[{"value":6166786048},{"value":4099},{"value":6166249472},{"value":0},{"value":409604},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":4096},"fp":{"value":0},"sp":{"value":6166786048},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":9118738940},"far":{"value":4354850816}}}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4300652544,
    "size" : 7798784,
    "uuid" : "5057c7ee-9215-3fca-873a-4796b8254ee4",
    "path" : "\/private\/var\/containers\/Bundle\/Application\/43D2455A-475E-493F-A572-C6FACF0C970F\/Screentox.app\/Screentox",
    "name" : "Screentox"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 8541958144,
    "size" : 233472,
    "uuid" : "86430e99-b055-36ef-b35e-a547a63dc03f",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7488466944,
    "size" : 290816,
    "uuid" : "149ff9cd-3e92-321d-b92f-ef58717c70b6",
    "path" : "\/usr\/lib\/system\/libdispatch.dylib",
    "name" : "libdispatch.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 9119006720,
    "size" : 282624,
    "uuid" : "8e13493a-ac3e-3eef-8b3e-102a3d715b23",
    "path" : "\/usr\/lib\/system\/libxpc.dylib",
    "name" : "libxpc.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7337934848,
    "size" : 11972608,
    "uuid" : "60f744f4-1345-325e-8970-d37bb5a1a31d",
    "path" : "\/System\/Library\/Frameworks\/Foundation.framework\/Foundation",
    "name" : "Foundation"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 9091244032,
    "size" : 319475,
    "uuid" : "3064b22e-d47e-379c-960c-f39982bb1982",
    "path" : "\/System\/Library\/Frameworks\/FamilyControls.framework\/FamilyControls",
    "name" : "FamilyControls"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7418814464,
    "size" : 32358400,
    "uuid" : "7bbaf705-22f7-3edc-9a76-4c8c1730188c",
    "path" : "\/System\/Library\/Frameworks\/SwiftUI.framework\/SwiftUI",
    "name" : "SwiftUI"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7934025728,
    "size" : 553120,
    "uuid" : "c8bdb7d4-5c57-3429-b5bf-707b7cc0f494",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 9118732288,
    "size" : 49140,
    "uuid" : "2ef84a69-8212-3e06-ac6d-f9a9e43d87f6",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  }
],
  "sharedCache" : {
  "base" : 7224131584,
  "size" : 3482124288,
  "uuid" : "2e1c6412-5934-36e5-80ec-727b6db37e24"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=1.4G resident=0K(0%) swapped_out_or_unallocated=1.4G(100%)\nWritable regions: Total=559.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=559.2M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           557.2M       22 \nMALLOC guard page                   64K        4 \nSMOOTH                               24        2 \nSTACK GUARD                         32K        2 \nStack                             1552K        2 \n__AUTH                            4101K      423 \n__AUTH_CONST                      43.2M      927 \n__CTF                               824        1 \n__DATA                            27.8M      921 \n__DATA_CONST                      52.2M      937 \n__DATA_DIRTY                      10.4M      860 \n__FONT_DATA                          4K        1 \n__INFO_FILTER                         8        1 \n__LINKEDIT                       372.7M        2 \n__OBJC_RO                         84.9M        1 \n__OBJC_RW                         2675K        1 \n__TEXT                             1.0G      950 \ndyld private memory                272K        1 \nmapped file                         64K        1 \nshared memory                       48K        2 \n===========                     =======  ======= \nTOTAL                              2.2G     5063 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "17257d3ebe4051f6caea93d6974888e2918a0689",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "64b21a7351cbb02ce3442e4e",
      "factorPackIds" : {
        "REMINDERS_GROCERY" : "64d6bf89aa6c2933834d3f9d"
      },
      "deploymentId" : 240000018
    },
    {
      "rolloutId" : "61675b89201f677a9a4cbd65",
      "factorPackIds" : {
        "HEALTH_FEATURE_AVAILABILITY" : "64d1632fd6c8a31e338fc4da"
      },
      "deploymentId" : 240000064
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "7f50a35b-089c-4332-8f20-36c931506af3",
      "experimentId" : "64a84dae90d82611a0bd7d3d",
      "deploymentId" : 400000010
    },
    {
      "treatmentId" : "595d38ea-3211-4d6d-a267-6e13fa65c7de",
      "experimentId" : "641b7ffb89b42413772b9435",
      "deploymentId" : 400000003
    }
  ]
}
}

Given how critical it is for your user, I would advise you to use a DTS ticket. And provide much more code to support so that they can investigate.

Here's the stack trace:

Incident Identifier: 6C0573D4-F450-4A78-B38E-C7E6CF50ADAD
CrashReporter Key: 80a1fd48b3726682cb61f1a1601274c8db219668
Hardware Model: iPhone14,3
Process: Screentox [424]
Path: /private/var/containers/Bundle/Application/43D2455A-475E-493F-A572-C6FACF0C970F/Screentox.app/Screentox
Identifier: com.getpresentapp.Present
Version: 0.16.9 (1)
AppStoreTools: 15A240a
AppVariant: 1:iPhone14,3:16
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.getpresentapp.Present [633]
Date/Time: 2023-09-25 14:55:04.0676 -0400
Launch Time: 2023-09-25 14:54:44.0389 -0400
OS Version: iPhone OS 17.0.1 (21A340)
Release Type: User
Baseband Version: 3.06.01
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:process-launch watchdog transgression: app<com.getpresentapp.Present(ACC88C7D-C780-43BD-8673-FD53A5E00BEA)>:424 exhausted real (wall clock) time allowance of 20.00 seconds
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: process-launch
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 88.660 (user 65.380, system 23.280), 74% CPU",
"Elapsed application CPU time (seconds): 0.050, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x1fd2401d8 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1fd23ff70 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x1fd23fe88 mach_msg_overwrite + 436
3 libsystem_kernel.dylib 0x1fd23fcc8 mach_msg + 24
4 libdispatch.dylib 0x1be5adf00 _dispatch_mach_send_and_wait_for_reply + 540
5 libdispatch.dylib 0x1be5ae2a0 dispatch_mach_send_with_result_and_wait_for_reply + 60
6 libxpc.dylib 0x21f8a06d0 xpc_connection_send_message_with_reply_sync + 264
7 Foundation 0x1b56396c0 __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16
8 Foundation 0x1b56213bc -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2160
9 Foundation 0x1b564c6cc -[NSXPCConnection _sendSelector:withProxy:arg1:] + 116
10 Foundation 0x1b564c604 _NSXPCDistantObjectSimpleMessageSend1 + 60
11 FamilyControls 0x21de515a8 0x21de16000 + 243112
12 FamilyControls 0x21de50848 0x21de16000 + 239688
13 libdispatch.dylib 0x1be593300 _dispatch_client_callout + 20
14 libdispatch.dylib 0x1be594b3c _dispatch_once_callout + 32
15 FamilyControls 0x21de50a50 0x21de16000 + 240208
16 Screentox 0x1006ca3a8 0x10056c000 + 1434536
17 SwiftUI 0x1bb0ec424 0x1ba322000 + 14459940
18 Screentox 0x100573214 0x10056c000 + 29204
19 dyld 0x1d8e7fd44 start + 2104
Thread 1:
0 libsystem_pthread.dylib 0x21f84e9fc start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000010004005 x1: 0x000000040700420e x2: 0x0000000000000000 x3: 0x0000000000001903
x4: 0x0000000000000000 x5: 0x00000b0300000000 x6: 0x0000000000004000 x7: 0x0000000000000000
x8: 0xfffffffffffffbbf x9: 0x0000000000000b03 x10: 0x0000000000000000 x11: 0x0000000000000001
x12: 0x0000000000000b03 x13: 0x0000000000000b03 x14: 0x0000000000100231 x15: 0x0000000000000001
x16: 0xffffffffffffffd1 x17: 0x0000000207da1240 x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x0000000000004000 x21: 0x00000b0300000000 x22: 0x0000000000000000 x23: 0x0000000000001903
x24: 0x000000016f88e640 x25: 0x0000000000000000 x26: 0x000000040700420e x27: 0x000000040700420e
x28: 0x000000000700420e fp: 0x000000016f88e4f0 lr: 0x00000001fd23ff70
sp: 0x000000016f88e4a0 pc: 0x00000001fd2401d8 cpsr: 0x00001000
far: 0x000000020d18ef90 esr: 0x56000080 Address size fault
Binary Images:
0x10056c000 - 0x100cdbfff Screentox arm64 <5057c7ee92153fca873a4796b8254ee4> /private/var/containers/Bundle/Application/43D2455A-475E-493F-A572-C6FACF0C970F/Screentox.app/Screentox
0x1fd23f000 - 0x1fd277fff libsystem_kernel.dylib arm64e <86430e99b05536efb35ea547a63dc03f> /usr/lib/system/libsystem_kernel.dylib
0x1be58f000 - 0x1be5d5fff libdispatch.dylib arm64e <149ff9cd3e92321db92fef58717c70b6> /usr/lib/system/libdispatch.dylib
0x21f890000 - 0x21f8d4fff libxpc.dylib arm64e <8e13493aac3e3eef8b3e102a3d715b23> /usr/lib/system/libxpc.dylib
0x1b5600000 - 0x1b616afff Foundation arm64e <60f744f41345325e8970d37bb5a1a31d> /System/Library/Frameworks/Foundation.framework/Foundation
0x21de16000 - 0x21de63ff2 FamilyControls arm64e <3064b22ed47e379c960cf39982bb1982> /System/Library/Frameworks/FamilyControls.framework/FamilyControls
0x1ba322000 - 0x1bc1fdfff SwiftUI arm64e <7bbaf70522f73edc9a764c8c1730188c> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
0x1d8e7a000 - 0x1d8f0109f dyld arm64e <c8bdb7d45c573429b5bf707b7cc0f494> /usr/lib/dyld
0x0 - 0xffffffffffffffff ??? unknown-arch <00000000000000000000000000000000> ???
0x21f84d000 - 0x21f858ff3 libsystem_pthread.dylib arm64e <2ef84a6982123e06ac6df9a9e43d87f6> /usr/lib/system/libsystem_pthread.dylib

Which version of iOS ? (see this thread : https://developer.apple.com/forums/thread/690574)

Do you make network call in at app startup ?

Hi Charles,

I would recommend you start with a bug report via Feedback Assistant. It sounds like you have a line of communication with this user, so I'd suggest you perform the additional steps:

  1. Have the user run your app and try to remove the shielding. (That is, recreate the issue.)

  2. If necessary have the user record the date and time of the attempt. (If there's a crash or other log that includes a timestamp, at the time of the attempt, that will work,, or just have the user write down the current date and time as accurately as possible.)

  3. Have the user capture a sysdiagnose from their device and send it to you.

  4. Upload the sysdiagnose (along with the timestamp) to your bug report.

  5. Post the feedback number (FBxxxxxxxxx) here.

If you also want to open a TSI incident as Claude suggested, that would be fine too, but the initial steps would be to create the bug report with sysdiagnose anyway.

Hello, We also got multiple reports of this issue from our users, and we found a workaround:

  • Ask the user to reinstall the app,
  • Grant screentime permissions
  • Start shielding the apps that are stucked
  • Stop shielding them

It seems to allow the app to unblock from user devices.

In our experience, this issue seems to be related to an issue we reported were the Screentime authorisation is hanging, and just accessing the authorisation center is blocking everything. Even the screentime section in settings is not accessible.

Here the bug report : https://feedbackassistant.apple.com/feedback/11833456 opened about a year ago. We got some devices were this issue is present all the time, this issue seems to propagate through icloud, and also causing mal function in DeviceActivity extension based views.

We are glad this got Apple attention because it seems to be major issue that make our users very mad.

Regards

Hi Charles,

What is the feedback number of your bug report? The sysdiagnose is a crucial component for investigation of what's gone wrong.

I've had this similar issue and made a bug report with a sample project replicating the same issue. FB13492170

Critical Bug in Screen Time Frameworks – User's Phone Rendered Unusable
 
 
Q