Add ACCESS_WIFI_STATE permission to TestRunnerActivity
Categories
(GeckoView :: General, defect, P3)
Tracking
(firefox-esr78 unaffected, firefox83 wontfix, firefox84 wontfix, firefox85 fixed, firefox86 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr78 | --- | unaffected |
| firefox83 | --- | wontfix |
| firefox84 | --- | wontfix |
| firefox85 | --- | fixed |
| firefox86 | --- | fixed |
People
(Reporter: marco, Assigned: gbrown)
References
Details
(Keywords: crash, good-first-bug)
Attachments
(3 files)
For ASj1831zRye71eH4q_pzQA, AD says dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html failed, but it actually passed.
There seems to be no failure in the mochitest-plain_raw.log or mochitest-plain_errorsummary.log or in the backing log.
ActiveData is considering the test as failing because it thinks the test is missing test-end: https://activedata.allizom.org/tools/query.html#query_id=R7xEaqNP.
| Assignee | ||
Comment 1•5 years ago
|
||
https://treeherder.mozilla.org/logviewer.html#?job_id=303438375&repo=autoland
https://firefoxci.taskcluster-artifacts.net/ASj1831zRye71eH4q_pzQA/0/public/logs/live_backing.log
[task 2020-05-23T00:05:31.227Z] 00:05:31 INFO - 835 INFO SimpleTest START
[task 2020-05-23T00:05:31.227Z] 00:05:31 INFO - 836 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_availability.html
[task 2020-05-23T00:05:41.672Z] 00:05:41 INFO - 837 INFO TEST-OK | dom/presentation/tests/mochitest/test_presentation_availability.html | took 7284ms
[task 2020-05-23T00:05:41.672Z] 00:05:41 INFO - 838 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_dc_sender.html
[task 2020-05-23T00:05:41.673Z] 00:05:41 INFO - 839 INFO TEST-OK | dom/presentation/tests/mochitest/test_presentation_dc_sender.html | took 276ms
[task 2020-05-23T00:05:41.673Z] 00:05:41 INFO - 840 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html
[task 2020-05-23T00:05:41.674Z] 00:05:41 INFO - 841 INFO TEST-OK | dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html | took 3167ms
[task 2020-05-23T00:05:41.674Z] 00:05:41 INFO - 842 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_reconnect.html
[task 2020-05-23T00:05:41.678Z] 00:05:41 INFO - 843 INFO TEST-OK | dom/presentation/tests/mochitest/test_presentation_reconnect.html | took 269ms
[task 2020-05-23T00:05:41.678Z] 00:05:41 INFO - 844 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html
[task 2020-05-23T00:06:02.673Z] 00:06:02 INFO - wait for org.mozilla.geckoview.test complete; top activity=com.android.launcher3
[task 2020-05-23T00:06:02.781Z] 00:06:02 INFO - remoteautomation.py | Application ran for: 0:00:37.736846
[task 2020-05-23T00:06:03.327Z] 00:06:03 INFO - Stopping web server
[task 2020-05-23T00:06:03.332Z] 00:06:03 INFO - Stopping web socket server
[task 2020-05-23T00:06:03.353Z] 00:06:03 INFO - Stopping ssltunnel
[task 2020-05-23T00:06:03.374Z] 00:06:03 INFO - leakcheck | refcount logging is off, so leaks can't be detected!
[task 2020-05-23T00:06:03.374Z] 00:06:03 INFO - runtests.py | Running tests: end.
[task 2020-05-23T00:06:04.672Z] 00:06:04 INFO - Buffered messages logged at 00:05:40
[task 2020-05-23T00:06:04.672Z] 00:06:04 INFO - 845 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | PresentationRequest should be available.
[task 2020-05-23T00:06:04.672Z] 00:06:04 INFO - 846 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Sender: should have no available device after setup
[task 2020-05-23T00:06:04.673Z] 00:06:04 INFO - 847 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Device should be available.
[task 2020-05-23T00:06:04.673Z] 00:06:04 INFO - 848 INFO Device prompt is triggered.
[task 2020-05-23T00:06:04.673Z] 00:06:04 INFO - 849 INFO A control channel is established.
[task 2020-05-23T00:06:04.673Z] 00:06:04 INFO - 850 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Connection should be available.
[task 2020-05-23T00:06:04.673Z] 00:06:04 INFO - 851 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Connection ID should be set.
[task 2020-05-23T00:06:04.674Z] 00:06:04 INFO - 852 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | The initial state should be connecting.
[task 2020-05-23T00:06:04.674Z] 00:06:04 INFO - 853 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | |connectionavailable| event is fired with a connection.
[task 2020-05-23T00:06:04.674Z] 00:06:04 INFO - 854 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | The connection from promise and the one from |connectionavailable| event should be the same.
[task 2020-05-23T00:06:04.674Z] 00:06:04 INFO - 855 INFO The control channel is opened.
[task 2020-05-23T00:06:04.674Z] 00:06:04 INFO - Buffered messages finished
Logcat shows:
05-23 01:05:40.571 5609 5629 I GeckoDump: ⰲ겿{"action":"test_start","time":1590192340571,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.572 5609 5629 D GeckoViewWebBrowserChrome[C]: shouldLoadURI http://mochi.test:8888/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html
05-23 01:05:40.584 5609 5629 D GeckoViewAutofill[C]: handleEvent: pageshow
05-23 01:05:40.592 5609 5629 D GeckoViewSelectionAction[C]: handleEvent: visibilitychange
05-23 01:05:40.593 5609 5629 D GeckoViewAutofill[C]: handleEvent: pagehide
05-23 01:05:40.610 5609 5629 D GeckoViewContent[C]: handleEvent: DOMTitleChanged
05-23 01:05:40.628 5609 5629 D GeckoViewContent[C]: handleEvent: DOMContentLoaded
05-23 01:05:40.632 5609 5629 D GeckoViewAutofill[C]: handleEvent: pageshow
05-23 01:05:40.666 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340666,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"PresentationRequest should be available.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.669 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340669,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"Sender: should have no available device after setup","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.674 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340673,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"Device should be available.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.683 5609 5629 I GeckoDump: ⰲ겿{"action":"log","time":1590192340681,"thread":null,"pid":null,"source":"mochitest","level":"INFO","message":"Device prompt is triggered.","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.686 5609 5629 I GeckoDump: ⰲ겿{"action":"log","time":1590192340686,"thread":null,"pid":null,"source":"mochitest","level":"INFO","message":"A control channel is established.","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.687 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340687,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"Connection should be available.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.688 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340687,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"Connection ID should be set.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.688 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340688,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"The initial state should be connecting.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.689 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340689,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"|connectionavailable| event is fired with a connection.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.689 5609 5629 I GeckoDump: ⰲ겿{"action":"test_status","time":1590192340689,"thread":null,"pid":null,"source":"mochitest","test":"/tests/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html","subtest":"The connection from promise and the one from |connectionavailable| event should be the same.","status":"PASS","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.690 5583 5583 D AndroidRuntime: Shutting down VM
--------- beginning of crash
05-23 01:05:40.690 5583 5583 E AndroidRuntime: FATAL EXCEPTION: main
05-23 01:05:40.690 5583 5583 E AndroidRuntime: Process: org.mozilla.geckoview.test, PID: 5583
05-23 01:05:40.690 5583 5583 E AndroidRuntime: java.lang.SecurityException: WifiService: Neither user 10062 nor current process has android.permission.ACCESS_WIFI_STATE.
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1683)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1636)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.net.wifi.IWifiManager$Stub$Proxy.getConnectionInfo(IWifiManager.java:1158)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.net.wifi.WifiManager.getConnectionInfo(WifiManager.java:1286)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at org.mozilla.gecko.GeckoNetworkManager.getWifiIPAddress(GeckoNetworkManager.java:456)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at org.mozilla.gecko.GeckoNetworkManager.handleMessage(GeckoNetworkManager.java:442)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at org.mozilla.gecko.EventDispatcher$3.run(EventDispatcher.java:356)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6077)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
05-23 01:05:40.690 5583 5583 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
05-23 01:05:40.691 5609 5629 I GeckoDump: ⰲ겿{"action":"log","time":1590192340691,"thread":null,"pid":null,"source":"mochitest","level":"INFO","message":"The control channel is opened.","js_source":"TestRunner.js"}ⰲ겿
05-23 01:05:40.692 1610 1621 W ActivityManager: Force finishing activity org.mozilla.geckoview.test/.TestRunnerActivity
| Assignee | ||
Comment 2•5 years ago
|
||
From the harness perspective, test_presentation_sender_on_terminate_request.html started, then Firefox was no longer running.
Usually a crash will result in the generation of a minidump, which will trigger a crash report, log a crash, and fail the run. In this case we didn't get a minidump, presumably because the OS forced Firefox down due to the security exception.
Previously, the harness would fail a run if the summary was not printed; I don't know why that didn't happen.
| Assignee | ||
Comment 3•5 years ago
|
||
This seems to be a perma-fail -- it fails in a similar way in every android mochitest log I checked.
| Assignee | ||
Comment 4•5 years ago
|
||
I don't see android.permission.ACCESS_WIFI_STATE in the list of permissions we pm grant:
nor is it in the manifest:
:snorp - Help? (see the SecurityException in comment 1)
Indeed, it looks like we should request that in TestRunnerActivity. We also need to fail gracefully if we don't have it, since our embedded app might not request it. Moving this over to GeckoView and we'll address in the next triage.
Comment 6•5 years ago
|
||
:snorp When you have a chance, please change the name of this bug to better describe the problem as you see it.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Comment 9•5 years ago
|
||
Backed out for failures on test_presentation_sender_on_terminate_request.html (Bug 1662205 )
Backout link: https://hg.mozilla.org/integration/autoland/rev/7cba8f31f9470c053b3faf8811b960856339bb01
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=314510308&repo=autoland&lineNumber=2440
Comment 10•5 years ago
|
||
| bugherder | ||
Comment 11•5 years ago
|
||
Backout merged https://hg.mozilla.org/mozilla-central/rev/7cba8f31f947
| Assignee | ||
Comment 12•5 years ago
|
||
Add the permission to the geckoview manifest, as previously attempted. Also disable failing tests
to enable a green test run. Add permission to adb.py grants list for good measure.
| Assignee | ||
Comment 14•5 years ago
|
||
Thanks for getting this started, :amoya!
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Comment 17•5 years ago
|
||
I've been running tests locally using emulators and I see the following errors frequently.
adb Unable to grant runtime permission android.permission.ACCESS_WIFI_STATE to org.mozilla.geckoview_example
adb Unable to grant runtime permission android.permission.ACCESS_WIFI_STATE to org.mozilla.geckoview.test
geckoview.test has the permission set but still has the error. Out of the following
mobile/android/geckoview/src/main/AndroidManifest.xml
mobile/android/geckoview/src/androidTest/AndroidManifest.xml
mobile/android/geckoview_example/src/main/AndroidManifest.xml
mobile/android/examples/port_messaging_example/app/src/main/AndroidManifest.xml
mobile/android/examples/messaging_example/app/src/main/AndroidManifest.xml
only geckoview.test has this permission. Should this be added to the other manifests? If not, can we remove the permission from adb.py's grant_runtime_permissions ?
| Assignee | ||
Comment 18•5 years ago
|
||
I hadn't noticed this before, but now I see all of our android-em and android-hw tests fail this grant:
[task 2020-12-25T10:51:41.091Z] 10:51:41 INFO - adb Granting important runtime permissions to org.mozilla.geckoview.test
[task 2020-12-25T10:51:42.776Z] 10:51:42 INFO - adb Unable to grant runtime permission android.permission.ACCESS_WIFI_STATE to org.mozilla.geckoview.test due to args: adb wait-for-device shell pm grant org.mozilla.geckoview.test android.permission.ACCESS_WIFI_STATE; echo adb_returncode=$?, exitcode: 1, stdout: Operation not allowed: java.lang.SecurityException: Permission android.permission.ACCESS_WIFI_STATE is not a changeable permission type
I don't understand why ACCESS_WIFI_STATE fails, when, for instance, FOREGROUND_SERVICE is OK. At any rate, since the grant of ACCESS_WIFI_STATE fails, I think it should be removed from the adb.py list.
I think
mobile/android/geckoview/src/androidTest/AndroidManifest.xml
mobile/android/geckoview_example/src/main/AndroidManifest.xml
should be kept in sync -- ACCESS_WIFI_STATE should be added to the geckoview_example manifest.
I don't know much about the other manifests.
:agi -- Should ACCESS_WIFI_STATE be added to any other manifest files? Do you have any insight into why 'pm grant' would fail on android.permission.ACCESS_WIFI_STATE?
I can make the changes, but will wait until we hear back from :agi.
| Assignee | ||
Comment 19•5 years ago
|
||
(In reply to Geoff Brown [:gbrown] from comment #18)
I don't understand why ACCESS_WIFI_STATE fails, when, for instance, FOREGROUND_SERVICE is OK.
Actually, FOREGROUND_SERVICE is not in the adb.py list of grants. FOREGROUND_SERVICE and ACCESS_WIFI_STATE have protection level "normal", while the other permissions, which we successfully grant, are protection level "dangerous". Does that difference explain the ACCESS_WIFI_STATE grant failure?
Comment 20•5 years ago
|
||
(In reply to Geoff Brown [:gbrown] from comment #19)
(In reply to Geoff Brown [:gbrown] from comment #18)
I don't understand why ACCESS_WIFI_STATE fails, when, for instance, FOREGROUND_SERVICE is OK.
Actually, FOREGROUND_SERVICE is not in the adb.py list of grants. FOREGROUND_SERVICE and ACCESS_WIFI_STATE have protection level "normal", while the other permissions, which we successfully grant, are protection level "dangerous". Does that difference explain the ACCESS_WIFI_STATE grant failure?
I think you can only pm grant permissions that are dangerous or present in the manifest:
pm grant, revoke: these commands either grant or revoke permissions
to apps. The permissions must be declared as used in the app's
manifest, be runtime permissions (protection level dangerous),
and the app targeting SDK greater than Lollipop MR1.
I think adding ACCESS_WIFI_STATE to the GVE manifest is the right thing to do here.
| Assignee | ||
Comment 21•5 years ago
|
||
Thanks! Changes coming up...
| Assignee | ||
Comment 22•5 years ago
|
||
Add ACCESS_WIFI_STATE to the gve manifest, same as androidTest.
Remove ACCESS_WIFI_STATE from the list of pm grants, since it is not of
type dangerous.
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
| bugherder | ||
Description
•