New issue
Advanced search Search tips

Issue 733856 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 825911
Owner: ----
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug
Team-Security-UX



Sign in to add a comment

Android Connection Info: addResetCertDecisionsButton has bad assert (mNativeConnectionInfoPopup != 0)

Project Member Reported by lgar...@chromium.org, Jun 15 2017

Issue description

Chrome Version: ToT
OS: Android

What steps will reproduce the problem?
(1) Build and run Chrome for Android with `is_debug=true use_goma=true enable_nacl=false dcheck_always_on=true`
(2) Visit expired.badssl.com and click through the interstitial.
(3) Open Page Info press "Details".

What is the expected result?
Connection Info shows.

What happens instead?
The app crashes.

I'll track down why this assert exists (and fails).
 
So, the problem is that the initialization of the connection info popup goes something like this:

- ConnectionInfoPopup() constructor (Java)
- nativeInit() -> Init() (C++)
- ConnectionInfoPopupAndroid() (C++)
- get security info, construct PageInfo, PresentSiteIdentity, etc.
- addResetCertDecisionsButton() (Java)

Now, mNativeConnectionInfoPopup will not have a value until nativeInit() in the constructor returns – but we're still doing work for nativeInit()!

This has been around since the introduction of ConnectionInfoPopup.java:
https://codereview.chromium.org/1100283002
The code came refactored – but mostly wholesale from https://chromium.googlesource.com/chromium/src/+/64c23723b3f3b67d0aab3e605645ae434f6affad/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopupLegacy.java
I'm guessing at some point the connection info was not sent to the Java code until the main object was constructed?

Given that the code has been functioning on non-debug builds for a long time, my conclusion here is that we should just take out the assert. It's a bit sad that no one ever wrote tests or tried to open connection info after clicking through an interstitial on a build with debug checks.
I can't figure out how to get an old Clank checkout (`gclient sync` seems to always update `src` and `src/clank` to today), so I'm just going to send a CL to remove the assert.
I'm trying to add a test to exercise that code path: https://codereview.chromium.org/2948453002

However, I'm having trouble calling ConnectionInfoPopup.show() (which calls the private constructor).

org.chromium.chrome.browser.page_info.ConnectionInfoPopupTest.showConnectionInfoPopup
java.lang.NullPointerException
	at org.robolectric.shadows.ShadowViewConfiguration.setup(ShadowViewConfiguration.java:77)
	at org.robolectric.shadows.ShadowViewConfiguration.get(ShadowViewConfiguration.java:94)
	at android.view.ViewConfiguration.get(ViewConfiguration.java)
	at android.view.View.__constructor__(View.java:4026)
	at android.view.View.<init>(View.java)
	at android.view.ViewGroup.<init>(ViewGroup.java)
	at android.widget.LinearLayout.<init>(LinearLayout.java)
	at org.chromium.chrome.browser.page_info.ConnectionInfoPopup.<init>(ConnectionInfoPopup.java:57)
	at org.chromium.chrome.browser.page_info.ConnectionInfoPopup.show(ConnectionInfoPopup.java:242)
	at org.chromium.chrome.browser.page_info.ConnectionInfoPopupTest.showConnectionInfoPopup(ConnectionInfoPopupTest.java:36)

Comment 4 by est...@chromium.org, Nov 10 2017

Labels: Hotlist-EnamelAndFriendsFixIt
Owner: ----
Status: Available (was: Assigned)

Comment 6 by est...@chromium.org, Feb 18 2018

Labels: -Hotlist-EnamelAndFriendsFixIt

Comment 7 by est...@chromium.org, Jun 13 2018

Cc: carlosil@chromium.org cthomp@chromium.org
Carlos, Chris, am I remembering correctly that one of you fixed this at some point?

Comment 8 by cthomp@chromium.org, Jun 13 2018

Mergedinto: 825911
Status: Duplicate (was: Available)
Yep, looks like this is the same as  Issue 825911 . Duping into that one since it was where the fix CL pointed.

Sign in to add a comment