Skip to content

AAPS dev 3.3.3.0 froze #3984

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

Open
robertrub opened this issue May 16, 2025 · 38 comments
Open

AAPS dev 3.3.3.0 froze #3984

robertrub opened this issue May 16, 2025 · 38 comments

Comments

@robertrub
Copy link

This happened several times. I look at AAPS and find out that is has frozen during the night.
I thought that it was related to Play Protect but it froze again this morning (a bit before 7 AM) and Play protect is OFF.

As you can see, there was a "catch-up" in BGs when I force closed, cleared cache and restarted AAPS.

Screenshot_20250516_092543_AAPS.jpg

The logs after force close and restart.

AndroidAPS_LOG_1747379627382.log.zip

@TheNeskik
Copy link
Contributor

TheNeskik commented May 16, 2025

Got an other freeze to this night.

Since last time I enabled everything to log as I don't know what can cause those freeze.

Screenshot_20250516_063630_AAPS.jpg

AndroidAPS_LOG_1747370162514.log.zip

I just updated to latest dev this morning after the freeze, I will see if it happen again

Edit : BG was back after a short time.

@MilosKozak
Copy link
Contributor

MilosKozak commented May 17, 2025

This happened several times. I look at AAPS and find out that is has frozen during the night. I thought that it was related to Play Protect but it froze again this morning (a bit before 7 AM) and Play protect is OFF.

No reason is visible in logs

@WesSec
Copy link

WesSec commented May 17, 2025

Image

I experienced the same 2 times on (86fb), reboot of phone fixed it. Checked the logs and also no reason visible. It didnt crash, it just hung on the latest sate. (it showed last bg was 3 min ago, so upon checking first i didnt notice it was broken). I pulled latest commits and see if i can get a logcat dump when it happens again:

Extras:
Phone: Samsung S21FE, OneUI 6.1 (Android 14)

@TheNeskik
Copy link
Contributor

It happened on older commit (f737) but nothing in log. Can't replicate issue as it is random.

I'm on Android 15 (galaxy S23)

@robertrub
Copy link
Author

robertrub commented May 17, 2025

It didnt crash, it just hung on the latest state.

Same here. No crash, just froze. No reaction to taps etc.

Screenshot_20250515_124408_AAPS.jpg

@vanelsberg
Copy link
Contributor

vanelsberg commented May 17, 2025

Same here. No crash, just froze. No reaction to taps etc.

Only AAPS freezes - other apps and phone are then still responsive?

@TheNeskik
Copy link
Contributor

Only AAPS,
I'm using byoda and it still get BG as usually.
Phone can be use as usual

@Rabuffulin
Copy link

Rabuffulin commented May 20, 2025

o meu AAPS 3.3.2.0 também trava. O comportamento dele é parecido com o LOOP Aberto. A quantidade de hidratos informada não diminui e as correções não acontecem. O problema é aleatório. Essa noite ele não fez uma única correção e amanheci com a glicemia alta, com 60g de hidratos que foram do meu jantar de ontem. Estava ativa somente a basal programada. Quando fui na aba SMB e atualizei ele gerou uma correção e aplicou, mas se não tivesse feito isso permaneceria congelado. Agora tomei meu café da manhã e parece que está funcionando o LOOP Fechado, mas se isso ficar acontecendo eu pensei em fazer um downgrade de versão, porque na 3.3.1 isso não acontecia.

@vanelsberg
Copy link
Contributor

o meu AAPS 3.3.2.0 também trava.

English please?

@Rabuffulin
Copy link

My AAPS 3.3.2.0 also freezes. Its behavior is similar to Open Loop. The amount of carbs entered does not decrease, and corrections do not happen. The problem is random. Last night, it didn’t make a single correction, and I woke up with high blood sugar, with 60g of carbs remaining from my dinner yesterday. Only the programmed basal was active. When I went to the SMB tab and refreshed it, it generated a correction and applied it, but if I hadn’t done that, it would have remained frozen. Now I’ve had breakfast, and it looks like Closed Loop is working, but if this keeps happening, I’m considering downgrading the version because this didn’t happen in 3.3.1

@WesSec
Copy link

WesSec commented May 23, 2025

Latest dev (86fb) froze again last night, will pull logs and add to this comment in an hour. Weird behaviour is that I force closed AAPS and relaunched, but xdrip values are not being processed by AAPS (xdrip itself works fine, AAPS is functional except receiving BG), that might be a clue in the right direction

@robertrub
Copy link
Author

The same for me, xDrip had gotten all the BGs but they did NOT catch-up when AAPS was "force restarted".

One explanation is : AAPS didn't totally froze as it continued "listening" to arriving BGs but never registered or acted on them. When forced restart, it didn't say, last BG was hours ago, I need to catch-up but said, "ok, last BG was 2 min ago, waiting the next".

As it is NOT AAPS requesting BGs but xDrip sending them, and as xDrip sent normally all the past BGs, it just sends the next one when available.

The other (and more probable) explanation is : (This needs testing) Does, a forced closed AAPS catch-up BGs (when started 15+ minutes later) or not ?

Will test this today. My guess is that the BGs are missing in AAPS because xDrip had already sent them regularly and "doesn't care" if nobody was listening.

@WesSec
Copy link

WesSec commented May 23, 2025

xDrip had gotten all the BGs but they did NOT catch-up when AAPS was "force restarted".

This happened for me too, i went to the shower and when i got back (phone was in range all the time), AAPS started receiving BG's again. Here's my reconstruction

  • Freeze around 4:17
  • Discovered around 6:50 (got pop upAAPS froze, force closed it and restarted AAPS
    <no bg's being received AFTER restart>
  • BG's received since 07:08 (approx 20 min after restart)

Logcat logs mentioning AAPS (unfortunately crash is out of retention period)

froze_redacted_aaps_log.txt
logcat_filtered_aaps.txt

Image

@vanelsberg
Copy link
Contributor

vanelsberg commented May 23, 2025

Using BYODA and AAPS latest dev versions.
Not experiencing "freezes" and It seems to me problems reported most are with xDrip+

My 2cts:
(1) It seems to mee Google has been making Play Protect behaving more and more aggressive.
Since my phone received an OS update month ago, it started to "block" AAPS. I can unblock, but (Samsungs) phones security keeps reminding about it being a "security risk"

(2) What is reported in this issue looks similar to what I experienced with BYODA some weeks ago after my Samsung S22 Ultra (running A14) received an OS update where Play Protect suddenly started to behave even much more aggressive. Until then I never had a need to switch it off.

Shortly after, on updating AAPS, Play Protect threw a big pop-up. Ignored it and installed AAPS anyway. That night I experienced with AAPS which has a striking resemblance with the "freezing" reported here: No problem with BYODA/Dexcom which was receiving BG values as usual, but AAPS just stopped receiving BG values from BYODA and loop stopped. Could not find the problem so got through the night with just profile basals.

Next morning it took me at least an hour to solve the problem:

  • AAPS did not show any problems other than not receiving BG from BYODA.
  • Switching of Play Protect and any power savings still active did not solve.
    Still, my idea was this could have do with permissions, but all permissions seemed OK ?!?

Then I noticed under AAPS permissions, "additional permissions" it now showed the "Access Dexcom app".
Allowing/adding this permission solved the problem and AAPS immediately started receiving BG values!
Noticed that the Dexcom app (BYODA) now also shows itself under "App Additional permissions" which I find a bit odd?

@MilosKozak
I do have xDrip+ on the phone as a companion app, only receiving BG's from AAPS. For AAPS there is no such permission for xDrip+ under "App Additional permissions". Could it be AAPS needs to set some additional permissions similar to BYODA?

@ALL Did any of you try uninstalling xDrip, restarting the phone and then reinstalling latest xDrip+ (assuming this would reset permissions)?

@robertrub
Copy link
Author

Strange, I had that "App Additional permissions" line in AAPS permissions but when I checked right now, I can't see it.

It was there for some time now and had receive data from xDrip (os sth similar)

@TheNeskik
Copy link
Contributor

TheNeskik commented May 23, 2025

I'm using BYODA and i'm having same behavior randomly.
What i've made since my last freeze :

  • Updating AAPS
  • Reset permissions and giving all access again
  • Reinstall BYODA (to be sure and because last freeze was giving me trouble to get bg again in aaps (around 15 min after restart of aaps and then all bg were backfilled))
  • Check again if play protect is off (it was)

About Additionnal Persmissions it was a while since it is here (can't remember when I saw it) but it was already on for me.

Using :
Samsung S23 - Android 15
AAPS-dev- e266
Not using dynisf nor autoisf nor autosens.

Edit : No freeze since my report last week (or more)

@WesSec
Copy link

WesSec commented May 24, 2025

I'm in a freeze state right now, and am watching logcat for androidAPS, while the app hangs, i see a lot of these warnings pass by:

2025-05-24 17:55:54.157 28348-24686 SQLiteConnectionPool    info.nightscout.androidaps           W  The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 1368 (RxCachedThreadScheduler-277) with flags 0x2 for 1757.128 seconds.
                                                                                                    Connections: 0 active, 1 idle, 3 available.
2025-05-24 17:55:54.158 28348-28971 SQLiteConnectionPool    info.nightscout.androidaps           W  The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 181 (arch_disk_io_2) with flags 0x2 for 1757.129 seconds.
                                                                                                    Connections: 0 active, 1 idle, 3 available.
2025-05-24 17:55:54.159 28348-28988 SQLiteConnectionPool    info.nightscout.androidaps           W  The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 184 (arch_disk_io_3) with flags 0x2 for 1757.1171 seconds.
                                                                                                    Connections: 0 active, 1 idle, 3 available.
2025-05-24 17:55:55.019 28348-5570  SQLiteConnectionPool    info.nightscout.androidaps           W  The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 1510 (RxCachedThreadScheduler-290) with flags 0x2 for 1721.1881 seconds.
                                                                                                    Connections: 0 active, 1 idle, 3 available.
2025-05-24 17:55:56.952 28348-26280 SQLiteConnectionPool    info.nightscout.androidaps           W  The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 1381 (RxCachedThreadScheduler-278) with flags 0x2 for 1733.1411 seconds.
                                                                                                    Connections: 0 active, 1 idle, 3 available.

These are logs from before and at the freeze (happening at 17:26)

05-24 17:25:59.047  1850  7290 W JobScheduler: Job didn't exist in JobStore: 9a13618 {androidx.work.systemjobscheduler} #u0a335/2125467 @androidx.work.systemjobscheduler@info.nightscout.androidaps/androidx.work.impl.background.systemjob.SystemJobService
05-24 17:25:59.148  4318  4318 D PluginAODManager: onNotificationInfoUpdated() 0|info.nightscout.androidaps|4711|null|10335
05-24 17:25:59.244  4318  4318 D PluginAODManager: onNotificationInfoUpdated() 0|info.nightscout.androidaps|4711|null|10335
05-24 17:25:59.518   784   784 D io_stats: !@ Read_top(KB): loop46(5127) 256 cout.androidaps(28348) 168 loop12(913) 52
05-24 17:25:59.518   784   784 D io_stats: !@ Write_top(KB): cout.androidaps(28348) 1140 system_server(1850) 368 kworker/u16:4(28296) 172
05-24 17:26:18.314   784   784 D io_stats: !@ Write_top(KB): cout.androidaps(28348) 692 gearhead:shared(17478) 8
05-24 17:26:22.318   784   784 D io_stats: !@ Write_top(KB): kworker/u16:15(29596) 556 cout.androidaps(28348) 252 soft.appmanager(30653) 16
05-24 17:26:23.153 28348 28368 I cout.androidaps: Background concurrent copying GC freed 30MB AllocSpace bytes, 1(16KB) LOS objects, 25% free, 71MB/95MB, paused 120us,194us total 129.754ms
05-24 17:26:23.646 28348 28597 I NotificationManager: info.nightscout.androidaps: notify(4711, null, Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
05-24 17:26:23.660  4318 10179 D SecFgsManagerController: onForegroundStateChanged: [dialog:false]:[isForeground:true]:[packageName:info.nightscout.androidaps]:[token:android.os.BinderProxy@6ac0de2]:[userId:0]
05-24 17:26:23.662 28348 28348 D CORE    : [main]: [DummyService.onStartCommand():68]: Starting DummyService with ID 4711 notification Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)
05-24 17:26:23.664  4318  5766 D SecFgsManagerController: onForegroundStateChanged: [dialog:false]:[isForeground:true]:[packageName:info.nightscout.androidaps]:[token:android.os.BinderProxy@6ac0de2]:[userId:0]
05-24 17:26:23.866  1850  1850 D EdgeLightingManager: showForNotification : isInteractive=false, isHeadUp=true, color=0, canBypassDnd=false, sbn = StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.867  1850  1850 D EdgeLightingPolicyManager.NotificationGroup: Remove previous child data. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.867  1850  1850 I EdgeLightingManager: showForNotificationScreenOff Alert once notification. sbn: StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.878  1850  1850 D EdgeLightingManager: showForNotification : isInteractive=false, isHeadUp=true, color=0, canBypassDnd=false, sbn = StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.878  1850  1850 D EdgeLightingPolicyManager.NotificationGroup: Remove previous child data. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.878  1850  1850 I EdgeLightingManager: showForNotificationScreenOff Alert once notification. sbn: StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.884  1850  1850 D EdgeLightingManager: showForNotification : isInteractive=false, isHeadUp=true, color=0, canBypassDnd=false, sbn = StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.884  1850  1850 D EdgeLightingPolicyManager.NotificationGroup: Remove previous child data. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.884  1850  1850 I EdgeLightingManager: showForNotificationScreenOff Alert once notification. sbn: StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))
05-24 17:26:23.892  4318  4318 D Bubbles : onEntryUpdated : shouldBubbleUp=true ,key=0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.893  4762  7451 I HoneySpace.NotificationListener: onNotificationPosted info.nightscout.androidaps: 0|info.nightscout.androidaps|4711|null|10335: 0
05-24 17:26:23.893  4762  7451 I HoneySpace.BadgeDataSourceImpl: Get notification count. PK(p='info.nightscout.androidaps', u=UserHandle{0}) - forceBadgeCount: false, notification listener: 1, badge provider: 0
05-24 17:26:23.894  4762  9118 I HoneySpace.PackageEventOperator: [CustomApplistViewModel] badge count is updated. info.nightscout.androidaps/app.aaps.MainActivity#UserHandle{0}|149 : 1
05-24 17:26:23.894  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.896  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.905  4762  7451 I HoneySpace.NotificationListener: onNotificationPosted info.nightscout.androidaps: 0|info.nightscout.androidaps|4711|null|10335: 0
05-24 17:26:23.905  4762  7451 I HoneySpace.BadgeDataSourceImpl: Get notification count. PK(p='info.nightscout.androidaps', u=UserHandle{0}) - forceBadgeCount: false, notification listener: 1, badge provider: 0
05-24 17:26:23.905  4762  7451 I HoneySpace.NotificationListener: onNotificationPosted info.nightscout.androidaps: 0|info.nightscout.androidaps|4711|null|10335: 0
05-24 17:26:23.905  4762 10147 I HoneySpace.PackageEventOperator: [CustomApplistViewModel] badge count is updated. info.nightscout.androidaps/app.aaps.MainActivity#UserHandle{0}|149 : 1
05-24 17:26:23.906  4762  7451 I HoneySpace.BadgeDataSourceImpl: Get notification count. PK(p='info.nightscout.androidaps', u=UserHandle{0}) - forceBadgeCount: false, notification listener: 1, badge provider: 0
05-24 17:26:23.906  4762 10148 I HoneySpace.PackageEventOperator: [CustomApplistViewModel] badge count is updated. info.nightscout.androidaps/app.aaps.MainActivity#UserHandle{0}|149 : 1
05-24 17:26:23.909  4318  4318 D Bubbles : onEntryUpdated : shouldBubbleUp=true ,key=0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.910  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.910  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.911  4318  4318 D Bubbles : onEntryUpdated : shouldBubbleUp=true ,key=0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.911  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.912  4318  4318 D InterruptionStateProvider:  no Heads up : edgelighting enabled app. 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.918  4318  4318 I View    : setRequestedFrameRate frameRate=-2.0, this=StatusBarIconView(slot='info.nightscout.androidaps/0x1267' alpha=1.0 icon=StatusBarIcon(icon=Icon(typ=RESOURCE pkg=info.nightscout.androidaps id=0x7f0801a5) visible user=0 ) visibleState=ICON iconColor=#ffffffff staticDrawableColor=#ffffffff decorColor=#ffffffff animationStartColor=#0 currentSetColor=#ffffffff notification=StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))), caller=com.android.systemui.statusbar.StatusBarIconView.onAttachedToWindow:6 android.view.View.dispatchAttachedToWindow:24133 android.view.ViewGroup.addViewInner:5556 android.view.ViewGroup.addView:5332 android.view.ViewGroup.addView:5272 
05-24 17:26:23.924  4318  4318 I View    : setRequestedFrameRate frameRate=-2.0, this=StatusBarIconView(slot='info.nightscout.androidaps/0x1267' alpha=1.0 icon=StatusBarIcon(icon=Icon(typ=RESOURCE pkg=info.nightscout.androidaps id=0x7f0801a5) visible user=0 ) visibleState=ICON iconColor=#fffafaff staticDrawableColor=#ffb7caff decorColor=#ff1b6cf7 animationStartColor=#0 currentSetColor=#fffafaff notification=StatusBarNotification(pkg=info.nightscout.androidaps user=UserHandle{0} id=4711 tag=null key=0|info.nightscout.androidaps|4711|null|10335: Notification(channel=AndroidAPS-Ongoing shortcut=null contentView=null vibrate=null sound=null defaults=0 flags=ONGOING_EVENT|ONLY_ALERT_ONCE|NO_CLEAR|FOREGROUND_SERVICE color=0x00000000 category=status vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0))), caller=com.android.systemui.statusbar.StatusBarIconView.onAttachedToWindow:6 android.view.View.dispatchAttachedToWindow:24133 android.view.ViewGroup.addViewInner:5556 android.view.ViewGroup.addView:5332 android.view.ViewGroup.addView:5272 
05-24 17:26:23.935  4318  4318 D PluginAODManager: onNotificationInfoUpdated() 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:23.957  4318  4318 I AppIconSolution: start to load, pkg=info.nightscout.androidaps, bg=192-192, dr=126-126, forDefault=true, density=0
05-24 17:26:23.958  4318  4318 I AppIconSolution: getIconScale, pkg=info.nightscout.androidaps, size=126, iconScale=IconScale[alpha=5, scale=0.72, isCrop=false]
05-24 17:26:23.962  4318  4318 I AppIconSolution: default container[Contain], pkg=info.nightscout.androidaps, bg=162-162, dr=126-126, isNight = true
05-24 17:26:24.003  4318  4318 I AppIconSolution: start to load, pkg=info.nightscout.androidaps, bg=192-192, dr=126-126, forDefault=true, density=0
05-24 17:26:24.004  4318  4318 I AppIconSolution: getIconScale, pkg=info.nightscout.androidaps, size=126, iconScale=IconScale[alpha=5, scale=0.72, isCrop=false]
05-24 17:26:24.008  4318  4318 I AppIconSolution: default container[Contain], pkg=info.nightscout.androidaps, bg=162-162, dr=126-126, isNight = true
05-24 17:26:24.028  4318  4318 D PluginAODManager: onNotificationInfoUpdated() 0|info.nightscout.androidaps|4711|null|10335
05-24 17:26:24.054 28348 28368 I cout.androidaps: Background concurrent copying GC freed 34MB AllocSpace bytes, 1(20KB) LOS objects, 24% free, 72MB/96MB, paused 92us,139us total 151.947ms
05-24 17:26:25.092 28348 28368 I cout.androidaps: Background concurrent copying GC freed 30MB AllocSpace bytes, 0(0B) LOS objects, 25% free, 71MB/95MB, paused 1.716ms,230us total 166.652ms
05-24 17:26:26.664 28348 28368 I cout.androidaps: Background concurrent copying GC freed 29MB AllocSpace bytes, 0(0B) LOS objects, 25% free, 69MB/93MB, paused 1.666ms,227us total 147.306ms
05-24 17:26:31.495 28348 28368 I cout.androidaps: Background concurrent copying GC freed 26MB AllocSpace bytes, 174(3468KB) LOS objects, 25% free, 70MB/94MB, paused 89us,94us total 151.793ms
05-24 17:26:31.900  4502 12017 I BtGatt.GattService: clientConnect(info.nightscout.androidaps) - address = XX:XX:XX:XX:2F:63, addressType=0, isDirect=true transport=2, clientIf=9, opportunistic=false, phy=1
05-24 17:26:32.468 27891 12802 W FA-SVC  : Gms url request failed, app: info.nightscout.androidaps, CONFIG, m1.ll: Exception in CronetUrlRequest: net::ERR_CONNECTION_REFUSED, ErrorCode=7, InternalErrorCode=-102, Retryable=false
05-24 17:26:33.004   784   784 D io_stats: !@ Read_top(KB): cout.androidaps(28348) 4
05-24 17:26:33.004   784   784 D io_stats: !@ Write_top(KB): cout.androidaps(28348) 484 kworker/u16:12(28302) 304 kworker/u16:11(19590) 132
05-24 17:26:34.033  4502  5006 W BtGatt.GattService: pkgName : info.nightscout.androidaps
05-24 17:26:41.020   784   784 D io_stats: !@ Read_top(KB): ssgtzd(1459) 748 id.gms.unstable(11681) 40 cout.androidaps(28348) 12
05-24 17:26:41.020   784   784 D io_stats: !@ Write_top(KB): kworker/u16:14(12552) 640 cout.androidaps(28348) 132
05-24 17:26:41.031 28348 28971 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 181 (arch_disk_io_2) with flags 0x2 for 4.0 seconds.
05-24 17:26:41.031 28348 28968 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 180 (arch_disk_io_1) with flags 0x2 for 4.0 seconds.
05-24 17:26:41.032 28348 24686 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 1368 (RxCachedThreadScheduler-277) with flags 0x2 for 4.0020003 seconds.
05-24 17:26:41.032 28348 28721 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 157 (arch_disk_io_0) with flags 0x2 for 4.0010004 seconds.
05-24 17:26:41.042 28348 28988 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 184 (arch_disk_io_3) with flags 0x2 for 4.0 seconds.
05-24 17:26:45.032 28348 28971 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 181 (arch_disk_io_2) with flags 0x2 for 8.002001 seconds.
05-24 17:26:45.033 28348 28968 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 180 (arch_disk_io_1) with flags 0x2 for 8.001 seconds.
05-24 17:26:45.033 28348 24686 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 1368 (RxCachedThreadScheduler-277) with flags 0x2 for 8.004001 seconds.
05-24 17:26:45.033 28348 28721 W SQLiteConnectionPool: The connection pool for database '/data/user/0/info.nightscout.androidaps/databases/androidaps.db' has been unable to grant a connection to thread 157 (arch_disk_io_0) with flags 0x2 for 8.002001 seconds.

Pretty sure its related to the database connection failing for some reason

Update 26-05 22:00: Froze again, same SQLiteConnectionPool error. Completely disabled play protect after last weeks freeze. Will now fully reinstall both Xdrip and AAPS to see if that solves anything, Oneui 7, android 15, samsung s21FE

Update: Did a full reinstall, of xdrip and AAPS 3.3.3.0-dev (e2666), (i think we should really streamline the process of setting up permissions etc), when pulling all data from NS, i experienced a hang again and it was the same SQLiteConnectionPool error

(i'll update this post as i try to debug whats happening)

@MilosKozak
Copy link
Contributor

database overloading after full sync is resolved in dev

@robertrub
Copy link
Author

@MilosKozak I had not done any full sync ( but my phone only uploads to NS (api v3) when charging at night) but had the freezes too.

Didn't have any freezes for some days. Running dev built on 18/05.

@vanelsberg
Copy link
Contributor

vanelsberg commented May 26, 2025

Did a full reinstall, of xdrip and AAPS 3.3.3.0-dev (e2666)

That's older commit form May 15th without the fix. Try latest?

@WesSec
Copy link

WesSec commented May 26, 2025

That's older commit form May 15th without the fix. Try latest?

Yeah that was me not having my morning coffee yet, i pulled latest and am expieriencing instant freezes, this is what my logcat shows me:

Image

Update: After a database reset this seems to happen during a NS full sync, the Queue numbers stopped going down (now going down very very slowly) when these logcat messages appear (40k entries remaining)

Image
the calculation progress bar is very slow, eventually it finishes

AAPS export is being corrupted.

Update: Cleared database and synced NS(3) again:

Image
(this includes a hang and pop up from android)

temp workaround, not fully syncing NS (historical BG)

last update (for this debug session):

This is also my reproducable way: set everything up, without ns backsync (but with profile pull etc), everything works as expected, when i click full sync, ns sync goes through with a few "isn't responding" notifications because it's so busy with the NS entries, after the sync i get in a very slow state of the app with repeating "isnt responding" notifications, where logcat is wating for blocking GC Allocs. My suspicion now is that it's in the statistics calculation. Froze state can be reset by clearing the database and pulling everything from NS except historical BG data.

Image

@vanelsberg
Copy link
Contributor

vanelsberg commented May 26, 2025

Update:... just realized I have been merging PR3968:
@MilosKozak With that I do not experience any freezing.

Just installed current AAPS dev commit without merging PR3968 on my Nokia 5.4 test phone: it completely freezes (close app / wait pop-up) when trying a full NS sync.... When I then "close" AAPS, on reopen I can continue full sync successfully. Subsequent sync are experiencing som app freezing but eventually finish successfully also.

Also noted during full sync queue is not used (at least UI shows "queue: n.a")

So PR3968 fixes a problem that is in current dev?

@WesSec
Copy link

WesSec commented May 26, 2025

Solved my issue, in the database was a carbs entry with a duration of 216000000000 (default for unlimited). This caused the carbs.expand function to create loads of allocations, freezing my app:

Image

Solved by running a debug version and removing the duration field of that carb entry

@vanelsberg
Copy link
Contributor

vanelsberg commented May 26, 2025

Solved my issue, in the database was a carbs entry with a duration of 216000000000 (default for unlimited).

Good find!
Question is, how did it get there ;-)

@MilosKozak
Copy link
Contributor

Do you know how it happened?

@WesSec
Copy link

WesSec commented May 27, 2025

Solved my issue, in the database was a carbs entry with a duration of 216000000000 (default for unlimited).

Good find! Question is, how did it get there ;-)

Been able to reproduce the issue now

Image

My steps:

  • Clear database
  • Attempt full sync
  • Switch to action tab during sync
  • App freezes for me with following logcat messages:
    Image
  • Quit app as suggested by prompt
  • Start app again
  • This behavior likely corrupts/interrupts the database entry
    Proof that the mongo entry is okay:

Image

Solving this issue completely would likely require an overhaul of the database entry / sync mechanism to catch these occurrences, suggested fix in #4002 is a solution to prevent the app from freezing if it happens

Managed to grab the logcat entries during import:

05-27 08:47:22.420 27144 27207 I XDRIP   : [DefaultDispatcher-worker-3]: [DataSyncSelectorXdripImpl.processChangedCarbs():238]: Loading Carbs data Start: 2522 CA(id=2523, version=0, dateCreated=1748327791841, isValid=true, referenceId=null, ids=IDs(nightscoutSystemId=null, nightscoutId=15afcda2-34f1-5831-9932-9ab9cdf64276, pumpType=null, pumpSerial=null, temporaryId=null, pumpId=null, startId=null, endId=null), timestamp=1741621206000, utcOffset=3600000, duration=216000000000, amount=10.0, notes=) forID: 2523 
05-27 09:07:43.878 27144 27571 D NSCLIENT: [DefaultDispatcher-worker-7]: [NsIncomingDataProcessor.processTreatments():147]: Received NS treatment: NSCarbs(date=1741621206000, device=null, identifier=15afcda2-34f1-5831-9932-9ab9cdf64276, units=MG_DL, srvModified=1741624820156, srvCreated=1741624820156, utcOffset=60, subject=wessel, isReadOnly=false, isValid=true, eventType=CARBS_CORRECTION, notes=, pumpId=null, endId=null, pumpType=null, pumpSerial=null, app=null, carbs=10.0, duration=216000000000)
05-27 09:13:33.204 27144 27561 D NSCLIENT: [DefaultDispatcher-worker-6]: [NsIncomingDataProcessor.processTreatments():147]: Received NS treatment: NSCarbs(date=1741621206000, device=null, identifier=15afcda2-34f1-5831-9932-9ab9cdf64276, units=MG_DL, srvModified=1741624820156, srvCreated=1741624820156, utcOffset=60, subject=wessel, isReadOnly=false, isValid=true, eventType=CARBS_CORRECTION, notes=, pumpId=null, endId=null, pumpType=null, pumpSerial=null, app=null, carbs=10.0, duration=216000000000)

@WesSec
Copy link

WesSec commented May 27, 2025

I think i nailed it down to the exact issue @MilosKozak :

On 2025-03-10 (when i was running a dev built on 03-03), something caused a Carb correction with the duration of 3600000 entry in my nightscout database (too far back to trace what caused this exactly, but it's there)

The logic in ThreatmentMapper.kt:

val durationInMilliseconds = this.durationInMilliseconds ?: this.duration?.let { TimeUnit.MINUTES.toMillis(this.duration) } ?: 0L

(if i understand it correctly) Which will: set durationinMilliseconds to durationInMilliseconds, which does not extist in the incoming document, so it'll take the duration (3600000) and convert it to milliseconds, maxing out the value to 216000000000 (max database value)

Whenever i enter a new carb entry (dev branch), the duration gets set correctly to minutes, so it's likely a past issue which has been resolved already, but still lives in my nightscout database (again, was running build from 03-03 that time), there has been one commit related to handling this information in april: 9b90eea #3917

Image (top document is what i just entered) so no issue will arise.

Ideally we would check this on importing before multiplying to milliseconds, but the proposed change is a simple and effective safeguard if this happens in the database

@robertrub
Copy link
Author

Froze again this morning, around 6:25 AM. I'm on Android 15 OneUI 7.0 now.

Screenshot_20250529_065554_One UI Home.jpg

Screenshot_20250529_065703_AAPS.jpg

Screenshot_20250526_105600_AAPS.jpg

AndroidAPS_LOG_1748494720699.log.zip

@robertrub
Copy link
Author

When I look in the treatments tab, the only thing near 6:25 is this. And it is a bit strange, 14 min not 15 min !temp basal.

Screenshot_20250529_070714_AAPS.jpg

@WesSec
Copy link

WesSec commented May 29, 2025

@robertrub by any chance are you able to pull a logcat from the time around the freeze?

Adb.exe logcat > log.txt

or in android studio in the left lower bottom (here you can filter for androidAPS which)

Logcat doesn't go back in time very long, depending on how many logs often an hour or 2.

@robertrub
Copy link
Author

One more hint, my phone was on the charging stand, at 6:25 I woke up and single or double tapped the screen to se the time and BG (shown byxDrip)...

As for the logs, I sent the logs from AAPS and I think it's a bit late for the phone logs 😞

@robertrub
Copy link
Author

I see other "non 5 min" basal rate changes.

Screenshot_20250529_090238_AAPS.jpg

@MilosKozak
Copy link
Contributor

@jbr7rr this seems to be Medtrum pump or driver issue

@vanelsberg
Copy link
Contributor

vanelsberg commented Jun 7, 2025

@robertrub Assuming you can do a repro of the freeze?
And you are using xDrip+: for BG source only?

Or is AAPS maybe also syncing/uploading data to xDrip+?
If so, could you try if freezing also happens with syncing data to xDrip disabled (so only BG source)?

@MilosKozak
Q: Full resync also syncing to xDrip follower: is this be design?

When debugging AAPS from Android Studio i use NS as BG source (config builder) while also downloading data from NSv3.

  • Using physical phone (Samsung Note 9) for debugging which performs well.
  • Using DASH as pump (connected to a DASH simulator service over BT).
  • In addition, AAPS is syncing all data to xDrip+
    This way the phone is effectively mirroring activity of my main phone.
    In general, this work just fine.

However, I noticed that when I reset the database and then do a full NSv3 resync it does not only back-sync all data from NS but at some point, it also starts syncing all data to the xDrip+ follower client. Android Studio debugger in logcat showed AAPS had a hard time keeping up, GC, mem swap and continuously complaining on "too much activity on main tread". After some time AAPS seemed to get what looked like a "freeze" while still receiving BG values? To get out, only way I found was stopping the app.

Additional notes:

  • When merging the "State DB" PR i did not see the freezing (at least on several tests resyncing after an AAPS DB reset)
  • This looks to be a different problem then the "freezing" I mentioned experiencing earlier where BG values from BYODA somehow got blocked from AAPS. I think this is an OS problem.

@robertrub
Copy link
Author

Hi @vanelsberg
No, I can't trigger the freeze. It happens all by itself ;)
I use (recent) nightly xDrip, BG sent to AAPS only, AAPS uploads everything to NS only. Using AAPS dev , rarely older than 7-10 days.
I didn't have any freeze problems for around 7-10 days.
I tried upload data to xDrip for an hour only, in order to see what data looked like in xDrip. Worked OK.

@vanelsberg
Copy link
Contributor

Hi @robertrub

No, I can't trigger the freeze.

Ok. I think the "freezing" you were reporting is a different one then mine:

(1) this morning installed latest dev without merging the StateDB PR on my main phone. This required a database reset as I had been running with the PR for some time. Half way resyncing data from NS, AAPS looked up with the wait/close pop-up. Waiting did not solve so exit AAPS. On restart it was fine, so after letting it stabilize for a few minutes tried a full resync again. 2nd resync completed where it left off successfully.
Will open a new issue for this,

(2) Apart from above, I did experience a "freeze" that is similar to what you described twice:
AAPS suddenly stopped receiving BG values causing loop to stop doing its work. As far as I could see somehow BYODA (which was registering BG values as expected) was somehow blocked from sending BG values to AAPS. Think this is an OS issue, suspecting Google's Play Protect updating causing this.

@robertrub
Copy link
Author

AAPS suddenly stopped receiving BG values causing loop to stop doing its work. As far as I could see somehow BYODA was ... somehow blocked from sending BG values to AAPS.

In my several freeze cases, AAPS didn't just stop receiving BG values, it also did NOT react to any taps etc. The UI (or the full app) was dead or frozen.

@vanelsberg
Copy link
Contributor

...The UI (or the full app) was dead or frozen.

OK, so now to me this gets complicated with 3 different "freeze" situations 😕

  1. AAPS freezing, not UI not responding.
  2. AAPS Freezing (wait/exit) while doing a full NSv3 resync.
  3. AAPS "freezing" (in loop stopping), not receiving BG values.

Now question is, are these different, or maybe somehow related?

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

No branches or pull requests

6 participants