Version: v79.0.3945.94 and v79.0.3945.100
Arch: arm64
Android version: 8.0
Device model: p10 lite
Is this bug about the SystemWebView?
No
Is the bug reproducible with latest version?
Yes
Can the bug be reproduced with corresponding Chromium version?
No
Is the bug a crash?
Yes
Describe the bug
When 'open links in incognito tabs always' is enabled, opening links from external apps example youtube, gmail, makes bromite to crash on launch. This doesn't happen if bromite is already running in the background, the link successfully opens in a new tab.
Latest working version is v78.0.3904.130.
Link to pastebin logcat https://defuse.ca/b/1OTHi8dc
Issue https://github.com/bromite/bromite/issues/450 might be related.
Steps to reproduce the bug
Enable always open incognito mode and try open link with random apps
@randomshell as told in previous comment, you need to upload the logcat here and not on pastebin websites.
The crash appears to be:
W System.err: java.lang.IllegalStateException: Attempting to open tab in wrong model
W System.err: at ay0.b(PG:44)
W System.err: at Nx0.b(PG:51)
W System.err: at Gx0.a(PG:128)
W System.err: at Gx0.a(PG:3)
W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.a(PG:154)
W System.err: at yr.a(PG:105)
W System.err: at yr.a(PG:99)
W System.err: at as.a(PG:63)
W System.err: at as.b(PG:62)
W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.B(PG:22)
W System.err: at OZ.run(PG:2)
W System.err: at EZ.run(PG:7)
W System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
W System.err: at android.os.MessageQueue.next(MessageQueue.java:376)
W System.err: at android.os.Looper.loop(Looper.java:244)
W System.err: at android.app.ActivityThread.main(ActivityThread.java:6706)
W System.err: at java.lang.reflect.Method.invoke(Native Method)
W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
@csagan5 I'm sorry I need to recover my 2fa credentials and I'm stuck with the mobile app for now.
I read #135 and I don't have custom tab intents enabled, if it makes a difference. I can try and see if changing the option I get the same logs.
I have the same issue which yields the same results. It's only appeared after the last few updates. Issue occurs on a fresh phone with the latest Bromite installed. Only setting changed is the aforementioned incognito mode. This is annoying as hell.
i am affected by this issue too. using android 10 on pixel 4 xl. here's the complete logcat:
01-20 08:21:14.583 27512 27512 W ProcessService1: type=1400 audit(0.0:8102): avc: denied { getattr } for path="/data/data/org.bromite.bromite" dev="dm-5" ino=92060 scontext=u:r:isolated_app:s0:c181,c291,c512,c768 tcontext=u:object_r:app_data_file:s0:c36,c257,c512,c768 tclass=dir permissive=0
01-20 08:21:14.597 27418 27418 W System.err: java.lang.IllegalStateException: Attempting to open tab in wrong model
01-20 08:21:14.600 27418 27418 W System.err: at ay0.b(PG:44)
01-20 08:21:14.600 27418 27418 W System.err: at Nx0.b(PG:51)
01-20 08:21:14.600 27418 27418 W System.err: at Gx0.a(PG:128)
01-20 08:21:14.600 27418 27418 W System.err: at Gx0.a(PG:3)
01-20 08:21:14.600 27418 27418 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.a(PG:144)
01-20 08:21:14.600 27418 27418 W System.err: at yr.a(PG:105)
01-20 08:21:14.600 27418 27418 W System.err: at yr.a(PG:99)
01-20 08:21:14.600 27418 27418 W System.err: at as.a(PG:63)
01-20 08:21:14.600 27418 27418 W System.err: at as.b(PG:62)
01-20 08:21:14.600 27418 27418 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.B(PG:22)
01-20 08:21:14.600 27418 27418 W System.err: at OZ.run(PG:2)
01-20 08:21:14.600 27418 27418 W System.err: at EZ.run(PG:7)
01-20 08:21:14.600 27418 27418 W System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
01-20 08:21:14.600 27418 27418 W System.err: at android.os.MessageQueue.next(MessageQueue.java:336)
01-20 08:21:14.600 27418 27418 W System.err: at android.os.Looper.loop(Looper.java:174)
01-20 08:21:14.600 27418 27418 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7356)
01-20 08:21:14.600 27418 27418 W System.err: at java.lang.reflect.Method.invoke(Native Method)
01-20 08:21:14.600 27418 27418 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
01-20 08:21:14.600 27418 27418 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
01-20 08:21:14.602 27418 27418 F chromium: [FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
01-20 08:21:14.603 27512 27512 I cr_ChildProcessService: Creating new ChildProcessService pid=27512
01-20 08:21:14.612 27512 27532 I cr_Linker: Using linker: org.chromium.base.library_loader.LegacyLinker
01-20 08:21:14.615 27512 27537 I cr_LibraryLoader: Loading chrome from within /data/app/org.bromite.bromite-a9aDB4OB5HLTEOSTA4ksTQ==/base.apk
01-20 08:21:14.629 27457 27511 I cr_LibraryLoader: Time to load native libraries: 79 ms
01-20 08:21:14.632 27457 27511 I chromium: [INFO:library_loader_hooks.cc(51)] Chromium logging enabled: level = 0, default verbosity = 0
01-20 08:21:14.632 27457 27511 I cr_LibraryLoader: Expected native library version number "79.0.3945.123", actual native library version number "79.0.3945.123"
01-20 08:21:14.646 27512 27537 I cr_LibraryLoader: Time to load native libraries: 31 ms
01-20 08:21:14.647 27512 27537 I chromium: [INFO:library_loader_hooks.cc(51)] Chromium logging enabled: level = 0, default verbosity = 0
01-20 08:21:14.647 27512 27537 I cr_LibraryLoader: Expected native library version number "79.0.3945.123", actual native library version number "79.0.3945.123"
01-20 08:21:14.684 27538 27538 E chromium: [0120/082114.684086:ERROR:file_io_posix.cc(147)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: Permission denied (13)
01-20 08:21:14.689 27418 27418 F libc : Fatal signal 5 (SIGTRAP), code -6 (SI_TKILL) in tid 27418 (bromite.bromite), pid 27418 (bromite.bromite)
01-20 08:21:14.696 1627 1627 D InterruptionStateProvider: No heads up: unimportant notification: 0|org.bromite.bromite|100|incognito_tabs_open|10292
01-20 08:21:14.699 1627 1627 D InterruptionStateProvider: No heads up: unimportant notification: 0|org.bromite.bromite|100|incognito_tabs_open|10292
01-20 08:21:14.718 27558 27558 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
01-20 08:21:14.720 1047 1047 I /system/bin/tombstoned: received crash request for pid 27418
01-20 08:21:14.722 27558 27558 I crash_dump64: performing dump of process 27418 (target tid = 27418)
01-20 08:21:14.727 27558 27558 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-20 08:21:14.727 27558 27558 F DEBUG : Build fingerprint: 'google/coral/coral:10/QQ1B.200105.004/6031802:user/release-keys'
01-20 08:21:14.727 27558 27558 F DEBUG : Revision: 'MP1.0'
01-20 08:21:14.727 27558 27558 F DEBUG : ABI: 'arm64'
01-20 08:21:14.727 27558 27558 F DEBUG : Timestamp: 2020-01-20 08:21:14+0800
01-20 08:21:14.727 27558 27558 F DEBUG : pid: 27418, tid: 27418, name: bromite.bromite >>> org.bromite.bromite <<<
01-20 08:21:14.727 27558 27558 F DEBUG : uid: 10292
01-20 08:21:14.727 27558 27558 F DEBUG : signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr --------
01-20 08:21:14.727 27558 27558 F DEBUG : Abort message: '[FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
01-20 08:21:14.727 27558 27558 F DEBUG : '
01-20 08:21:14.727 27558 27558 F DEBUG : x0 0000000000000000 x1 0000000000000081 x2 000000007fffffff x3 0000000000000000
01-20 08:21:14.727 27558 27558 F DEBUG : x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7f7f7f
01-20 08:21:14.727 27558 27558 F DEBUG : x8 0000000000000000 x9 0000000000000000 x10 0000000000000001 x11 0000000000000000
01-20 08:21:14.727 27558 27558 F DEBUG : x12 00000076c2dd3720 x13 ffffffffffffffff x14 0000000000000004 x15 ffffffffffffffff
01-20 08:21:14.727 27558 27558 F DEBUG : x16 00000077ca273950 x17 00000077ca203220 x18 00000077ccd42000 x19 0000007fc11426a0
01-20 08:21:14.727 27558 27558 F DEBUG : x20 0000007fc11426a8 x21 0000007fc11426b0 x22 0000007fc11421f0 x23 00000077ca26d578
01-20 08:21:14.727 27558 27558 F DEBUG : x24 00000076d0c93000 x25 00000077cc07e020 x26 000000000000004f x27 0000000000000000
01-20 08:21:14.727 27558 27558 F DEBUG : x28 0000007fc11421f0 x29 0000007fc1142640
01-20 08:21:14.727 27558 27558 F DEBUG : sp 0000007fc11421e0 lr 00000076ce08dc90 pc 00000076ce08de84
01-20 08:21:14.727 27558 27558 F DEBUG :
01-20 08:21:14.727 27558 27558 F DEBUG : backtrace:
01-20 08:21:14.727 27558 27558 F DEBUG : #00 pc 000000000203be84 /data/app/org.bromite.bromite-a9aDB4OB5HLTEOSTA4ksTQ==/base.apk!libchrome.so (offset 0xbf9000) (BuildId: 30387dd7b3a616fd80e21b9d941a40185023d9f5)
01-20 08:21:15.042 1047 1047 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_00
01-20 08:21:15.045 1307 27562 I DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
01-20 08:21:15.045 1307 1384 I BootReceiver: Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
01-20 08:21:15.045 1307 27561 W ActivityTaskManager: Force finishing activity org.bromite.bromite/org.chromium.chrome.browser.ChromeTabbedActivity
checking the crash from the dropbox dir:
Package: org.bromite.bromite v1578618851 (79.0.3945.123)
Foreground: Yes
Build: google/coral/coral:10/QQ1B.200105.004/6031802:user/release-keys
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/coral/coral:10/QQ1B.200105.004/6031802:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm64'
Timestamp: 2020-01-20 08:21:14+0800
pid: 27418, tid: 27418, name: bromite.bromite >>> org.bromite.bromite <<<
uid: 10292
signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
'
x0 0000000000000000 x1 0000000000000081 x2 000000007fffffff x3 0000000000000000
x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7f7f7f
x8 0000000000000000 x9 0000000000000000 x10 0000000000000001 x11 0000000000000000
x12 00000076c2dd3720 x13 ffffffffffffffff x14 0000000000000004 x15 ffffffffffffffff
x16 00000077ca273950 x17 00000077ca203220 x18 00000077ccd42000 x19 0000007fc11426a0
x20 0000007fc11426a8 x21 0000007fc11426b0 x22 0000007fc11421f0 x23 00000077ca26d578
x24 00000076d0c93000 x25 00000077cc07e020 x26 000000000000004f x27 0000000000000000
x28 0000007fc11421f0 x29 0000007fc1142640
sp 0000007fc11421e0 lr 00000076ce08dc90 pc 00000076ce08de84
backtrace:
#00 pc 000000000203be84 /data/app/org.bromite.bromite-a9aDB4OB5HLTEOSTA4ksTQ==/base.apk!libchrome.so (offset 0xbf9000) (BuildId: 30387dd7b3a616fd80e21b9d941a40185023d9f5)
i can attach the whole tombstone file if needed.
I read #135 and I don't have custom tab intents enabled, if it makes a difference. I can try and see if changing the option I get the same logs.
Both this issue and #135 share the common cause, but toggling the custom tab intents option does not affect this one.
@norbertc the stacktrace points to the same exception I mentioned before, Attempting to open tab in wrong model. The tombstone file is not needed.
Quite a big issue indeed...
maybe I found the solution, however to be verified:
--- chrome/android/java/src/org.original/chromium/chrome/browser/IntentHandler.java 2020-04-18 11:42:04.362583772 +0200
+++ chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java 2020-04-17 18:06:48.167859794 +0200
@@ -56,4 +56,6 @@
import org.chromium.ui.base.PageTransition;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1052,4 +1054,7 @@
if (appId == null
|| IntentUtils.safeGetBooleanExtra(intent, Browser.EXTRA_CREATE_NEW_TAB, false)) {
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return TabOpenType.OPEN_NEW_INCOGNITO_TAB; // CM: Always Incognito
+ }
return TabOpenType.OPEN_NEW_TAB;
}
--- chrome/android/java/src/org.original/chromium/chrome/browser/ChromeTabbedActivity.java 2020-04-18 12:04:07.930218655 +0200
+++ chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java 2020-04-18 11:53:21.649106951 +0200
@@ -1378,9 +1378,4 @@
break;
case TabOpenType.OPEN_NEW_INCOGNITO_TAB:
- if (!TextUtils.equals(externalAppId, getPackageName())) {
- assert false : "Only Chrome is allowed to open incognito tabs";
- Log.e(TAG, "Only Chrome is allowed to open incognito tabs");
- return;
- }
if (!IncognitoUtils.isIncognitoModeEnabled()) {
@@ -2016,4 +2011,10 @@
}
+ // CM: always incognito
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return getTabCreator(true).launchUrlFromExternalApp(url, referer, headers,
+ externalAppId, forceNewTab, intent, mIntentHandlingTimeMs);
+ }
+
return getTabCreator(false).launchUrlFromExternalApp(url, referer, headers,
externalAppId, forceNewTab, intent, mIntentHandlingTimeMs);
you must first apply the Add-an-always-incognito-mode.patch
I'm sorry I can't be more precise, but unfortunately I'm using a not very powerful PC, the first compilation took 2 days and only after that I realized I had the wrong flags..
could I ask you to verify it?
@uazo I have applied your patch and built it, the result is here: https://fdroid.bromite.org/bromite/arm64_ChromeModernPublic_patched.apk
Does it solve the issue?
@uazo I have applied your patch and built it, the result is here: https://fdroid.bromite.org/bromite/arm64_ChromeModernPublic_patched.apk
yes, I confirm that it works for me!
thank you very much
Woohoo great news! Looking forward to an official release containing this! 馃憤
@uazo ok, I will verify as well. I was also working on a fix for this but I was on a different path and I had not been successful.
Can you please also test if #135 is still happening with this patch?
no, currently for #135 doesn't work.
same log:
04-18 16:09:15.501 29529 29529 W System.err: java.lang.IllegalStateException: Attempting to open tab in wrong model
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.TabModelImpl.addTab(TabModelImpl.java:158)
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.IncognitoTabModel.addTab(IncognitoTabModel.java:249)
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.ChromeTabCreator.createNewTab(ChromeTabCreator.java:241)
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.ChromeTabCreator.createNewTab(ChromeTabCreator.java:120)
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.ChromeTabCreator.launchUrl(ChromeTabCreator.java:298)
04-18 16:09:15.502 29529 29529 W System.err: at org.chromium.chrome.browser.tabmodel.ChromeTabCreator.launchUrlFromExternalApp(ChromeTabCreator.java:358)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.launchIntent(ChromeTabbedActivity.java:2024)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.access$400(ChromeTabbedActivity.java:182)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity$InternalIntentDelegate.openNewTab(ChromeTabbedActivity.java:1464)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity$InternalIntentDelegate.processUrlViewIntent(ChromeTabbedActivity.java:1343)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.IntentHandler.processUrlViewIntent(IntentHandler.java:478)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.IntentHandler.onNewIntent(IntentHandler.java:466)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.ChromeTabbedActivity.initializeState(ChromeTabbedActivity.java:1157)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.init.ChromeBrowserInitializer.lambda$handlePostNativeStartup$5$ChromeBrowserInitializer(ChromeBrowserInitializer.java:293)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.init.ChromeBrowserInitializer$$Lambda$6.run(Unknown Source:2)
04-18 16:09:15.503 29529 29529 W System.err: at org.chromium.chrome.browser.init.ChainedTasks$1.run(ChainedTasks.java:33)
04-18 16:09:15.504 29529 29529 W System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
04-18 16:09:15.504 29529 29529 W System.err: at android.os.MessageQueue.next(MessageQueue.java:326)
04-18 16:09:15.504 29529 29529 W System.err: at android.os.Looper.loop(Looper.java:160)
04-18 16:09:15.504 29529 29529 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6718)
04-18 16:09:15.504 29529 29529 W System.err: at java.lang.reflect.Method.invoke(Native Method)
Let me check
--- chrome/android/java/src/org.original/chromium/chrome/browser/IntentHandler.java 2020-04-18 11:42:04.362583772 +0200
+++ chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java 2020-04-18 17:08:23.850301782 +0200
@@ -56,4 +56,6 @@
import org.chromium.ui.base.PageTransition;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1048,4 +1050,8 @@
}
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return TabOpenType.OPEN_NEW_INCOGNITO_TAB; // CM: Always Incognito
+ }
+
String appId = IntentUtils.safeGetStringExtra(intent, Browser.EXTRA_APPLICATION_ID);
// Due to users complaints, we are NOT reusing tabs for apps that do not specify an appId.
^^^ this is changed
--- chrome/android/java/src/org.original/chromium/chrome/browser/ChromeTabbedActivity.java 2020-04-18 12:04:07.930218655 +0200
+++ chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java 2020-04-18 11:53:21.649106951 +0200
@@ -1378,9 +1378,4 @@
break;
case TabOpenType.OPEN_NEW_INCOGNITO_TAB:
- if (!TextUtils.equals(externalAppId, getPackageName())) {
- assert false : "Only Chrome is allowed to open incognito tabs";
- Log.e(TAG, "Only Chrome is allowed to open incognito tabs");
- return;
- }
if (!IncognitoUtils.isIncognitoModeEnabled()) {
@@ -2016,4 +2011,10 @@
}
+ // CM: always incognito
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return getTabCreator(true).launchUrlFromExternalApp(url, referer, headers,
+ externalAppId, forceNewTab, intent, mIntentHandlingTimeMs);
+ }
+
return getTabCreator(false).launchUrlFromExternalApp(url, referer, headers,
externalAppId, forceNewTab, intent, mIntentHandlingTimeMs);
^^^ this is the same as above
it seems that chromium does not support in any way the reuse of the incognito tab if opened by an external intent, perhaps for security reasons.
anyway, it shouldn't crash now ..
it seems that chromium does not support in any way the reuse of the incognito tab if opened by an external intent, perhaps for security reasons.
anyway, it shouldn't crash now ..
I see. Your change would make any intent open a new incognito tab. I have built it here: https://fdroid.bromite.org/bromite/arm64_ChromeModernPublic_patched_v2.apk
I see. Your change would make any intent open a new incognito tab.
I'm very sorry, you are right, that's probably not a good thing.
please wait before merge, I would like to check if we are breaking some security policy, specially by removing "Only Chrome is allowed to open incognito tabs"
I see. Your change would make any intent open a new incognito tab.
I'm very sorry, you are right, that's probably not a good thing.
I mentioned it as an observation. I cannot tell if it is good or not, but of course I see that the code in Chromium is taking special care of the different combinations and there must be reasons.
please wait before merge, I would like to check if we are breaking some security policy, specially by removing "Only Chrome is allowed to open incognito tabs"
There is also the logic about appId and tab re-use, which is unclear to me. By the way, does this patch actually fix the crash in #135?
I think the change is safe and we can consider it same as having the incognito flag always set. See how I changed it in PR #529 which incorporate/replaces your proposed changes.
We can discuss the changes there.
Fixed in 81.0.4044.127
thanks a lot
Most helpful comment
I see. Your change would make any intent open a new incognito tab. I have built it here: https://fdroid.bromite.org/bromite/arm64_ChromeModernPublic_patched_v2.apk