Project

General

Profile

Actions

Bug #1178

closed

Crash showing HTTP Authentication dialog when Browser is in background

Added by Wade Paris 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Next Release
Start date:
03/11/2024
Due date:
% Done:

0%

Estimated time:

Description

When a page requests HTTP Basic Authentication, Privacy Browser crashes if the app does not have focus.

Obscure bug I know, but it is annoying losing tabs/work.

Stack trace attached.

Demo HTTP Auth URLs that trigger the user/pass dialog:
http://httpbin.org/basic-auth/testuser/testpass
https://jigsaw.w3.org/HTTP/Basic/


Files

data_app_crash@1710190109644.txt (2.6 KB) data_app_crash@1710190109644.txt Stacktrace Wade Paris, 03/11/2024 04:30 PM
Actions #1

Updated by Wade Paris 8 months ago

  • Tracker changed from Feature to Bug
Actions #2

Updated by Soren Stoutner 8 months ago

  • Status changed from New to Feedback
  • Assignee set to Soren Stoutner
  • Priority changed from 3.x to Next Release

I am having a hard time replicating this problem. Can you please post a copy of About > Version from inside Privacy Browser?

Actions #3

Updated by Wade Paris 8 months ago

Soren Stoutner wrote in #note-2:

I am having a hard time replicating this problem. Can you please post a copy of About > Version from inside Privacy Browser?

I have pasted the output below.

To clarify, by not in focus I mean I have switched to another app entirely before the auth dialog is requested. Having a sufficiently slow connection might help reproduce. Httpbin.org doesn't appear to be behind Cloudflare so works with Tor.

Chrome (via Brave) and Firefox (via Tor Browser) appear to handle this situation by simply not showing the dialog and letting the page return a 401 Unauthorized response.

==
Privacy Browser
Version 3.17 (version code 73)

Hardware
Brand: google
Manufacturer: Google
Model: Pixel 4 XL
Device: coral
Bootloader: unknown

Software
Android: 8.1.0 (API 27)
Security Patch: 2018-10-05
Build: RP1A.200720.009/6720564:user/release-keys
Kernel: 3.18.79
WebView Provider: com.google.android.webview
WebView Version: 122.0.6261.66

Memory Usage
App Consumed Memory: 14.61 MiB
App Available Memory: 5.08 MiB
App Total Memory: 19.70 MiB
App Maximum Memory: 128.00 MiB
System Consumed Memory: 919.48 MiB
System Available Memory: 1,073.18 MiB
System Total Memory: 1,992.67 MiB

Filter Lists
EasyList: 202402070111
EasyPrivacy: 202402070111
Fanboy’s Annoyance List: 202402070115
Fanboy’s Social Blocking List: 202402070111
UltraList: 1
UltraPrivacy: 3

Package Signature
Issuer DN: CN=FDroid, OU=FDroid, O=fdroid.org, L=ORG, ST=ORG, C=UK
Subject DN: CN=FDroid, OU=FDroid, O=fdroid.org, L=ORG, ST=ORG, C=UK
Start Date: Apr 17, 2016 3:14:13 AM CDT
End Date: Sep 3, 2043 2:14:13 AM CST
Certificate Version: 3
Serial Number: 166629308
Signature Algorithm: SHA256withRSA

Actions #4

Updated by Soren Stoutner 8 months ago

  • Status changed from Feedback to In Progress

Looking closely at the logcat, it looks like this bug is similar to Bug #730: Crash when exiting settings if a proxy dialog is displayed.

Basically, the HTTP authentication code still runs after `onSaveInstanceState`, but it can't produce a dialog in that state.

`onSaveInstanceState` is not always run every time the app is in the background. It only happens when the system decides to recover RAM and kills the app (saving its state for future restoration).

The fix is the same as for #730, which involves delaying the display of the dialog until after the app is restored.

I should be able to include a fix in the next release.

Actions #5

Updated by Soren Stoutner 8 months ago

  • Status changed from In Progress to Feedback

I have prepared a debug build that I think resolves this problem. @Wade Paris, can you please test it out and let me know if it works?

https://nextcloud.stoutner.com/s/zg4pitFtzH4gC8T

The debug build can be install alongside your standard Privacy Browser. If it is helpful for testing, you can export your settings from the standard version and import them into the debug build.

Actions #6

Updated by Soren Stoutner 8 months ago

  • Status changed from Feedback to Closed

Fixed in commit: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=74e8a8368db991ee511c216a298c4ff5201f41de;ds=sidebyside

I am going to close this as I think the above fix is very likely to resolve the issue. However, if you continue to have problems leave a comment and I will reopen the bug report.

Actions

Also available in: Atom PDF