Support proper set-permission for all permissions
Categories
(Remote Protocol :: Marionette, enhancement, P2)
Tracking
(firefox124 fixed)
Tracking | Status | |
---|---|---|
firefox124 | --- | fixed |
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
(Whiteboard: [webdriver:m10][webdriver:external])
Attachments
(2 files, 1 obsolete file)
Assignee | ||
Comment 1•8 months ago
|
||
Updated•8 months ago
|
Assignee | ||
Comment 2•8 months ago
|
||
Fixing one test to set permission properly and another to not trigger external network request.
Depends on D198836
Assignee | ||
Comment 3•8 months ago
|
||
test_driver.set_permission()
should now just work with the marionette pref.
Depends on D198957
Comment 6•8 months ago
|
||
Backed out for causing Android PermissionManager related wpt crashes.
- Backout link
- Push with failures
- Failure Log
- Failure line: PROCESS-CRASH | MOZ_ASSERT(PermissionAvailable(prin, aType)) [@ mozilla::PermissionManager::CommonTestPermissionInternal] | /notifications/permission.html
Assignee | ||
Comment 8•8 months ago
•
|
||
The build failure bug 1877157 is blocking me from investigating further. That's an Android debug build specific crash and never happens elsewhere. 🤔
Assignee | ||
Comment 9•8 months ago
|
||
Hi Tim, can you help me investigating the crash in comment #6? This patch does not touch permission manager but only adding calls to nsIPermissionManager with add/removeFromPrincipal, which somehow makes permission not available early enough per the crash stack:
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - 0 libxul.so!mozilla::PermissionManager::CommonTestPermissionInternal(nsIPrincipal*, nsIURI*, mozilla::OriginAttributes const*, int, nsTSubstring<char> const&, unsigned int*, bool, bool) [PermissionManager.cpp:1e79d9e65ec0577bb7d698c86edc6f35b4f92ce8 : 2446 + 0x0]
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rax = 0x000079d95ee0f1f8 rdx = 0x0000000000000001
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rcx = 0x000079d9831ffc20 rbx = 0x000079d96b285d60
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rsi = 0x000079d96c338bf3 rdi = 0x000079d9832015b4
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rbp = 0x000079d96b285e10 rsp = 0x000079d96b285d40
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r8 = 0x0000000000004335 r9 = 0x000079d96b288450
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r10 = 0x000079d96b285640 r11 = 0x0000000000000246
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r12 = 0x0000000000000000 r13 = 0x000079d9574d4900
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r14 = 0x0000000000000000 r15 = 0x000079d958139200
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rip = 0x000079d96322f42c
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - Found by: given as instruction pointer in context
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - 1 libxul.so!mozilla::PermissionManager::CommonTestPermission(nsIPrincipal*, int, nsTSubstring<char> const&, unsigned int*, unsigned int, bool, bool, bool) [PermissionManager.cpp:1e79d9e65ec0577bb7d698c86edc6f35b4f92ce8 : 3883 + 0x1c]
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rbx = 0x0000000000000000 rbp = 0x000079d96b285e90
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rsp = 0x000079d96b285e20 r12 = 0x000079d958139200
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r13 = 0x000079d96b285e58 r14 = 0x0000000000000001
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r15 = 0x000079d9574d4900 rip = 0x000079d96322e96a
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - Found by: call frame info
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - 2 libxul.so!mozilla::PermissionManager::TestPermissionFromPrincipal(nsIPrincipal*, nsTSubstring<char> const&, unsigned int*) [PermissionManager.cpp:1e79d9e65ec0577bb7d698c86edc6f35b4f92ce8 : 2364 + 0x1b]
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rbx = 0x000079d96b285ef0 rbp = 0x000079d96b285ec0
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rsp = 0x000079d96b285ea0 r12 = 0x0000000000000002
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r13 = 0x000079d9574ce4b8 r14 = 0x000079d9574ce490
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r15 = 0x0000000000000030 rip = 0x000079d96322e9f8
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - Found by: call frame info
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - 3 libxul.so!mozilla::PermissionDelegateHandler::PopulateAllDelegatedPermissions() [PermissionDelegateHandler.cpp:1e79d9e65ec0577bb7d698c86edc6f35b4f92ce8 : 295 + 0x13]
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rbx = 0x000079d96b285ef0 rbp = 0x000079d96b286060
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - rsp = 0x000079d96b285ed0 r12 = 0x0000000000000002
[task 2024-01-27T06:57:03.855Z] 06:57:03 INFO - r13 = 0x000079d9574ce4b8 r14 = 0x000079d9574ce490
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - r15 = 0x0000000000000030 rip = 0x000079d96322405f
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - Found by: call frame info
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - 4 libxul.so!nsGlobalWindowInner::InitDocumentDependentState(JSContext*) [nsGlobalWindowInner.cpp:1e79d9e65ec0577bb7d698c86edc6f35b4f92ce8 : 1814 + 0xc]
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - rbx = 0x000079d955a18000 rbp = 0x000079d96b2860b0
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - rsp = 0x000079d96b286070 r12 = 0x000079d96b286070
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - r13 = 0x000079d96b286070 r14 = 0x000079d955a18040
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - r15 = 0x000079d955a180e8 rip = 0x000079d9637fe5d4
[task 2024-01-27T06:57:03.856Z] 06:57:03 INFO - Found by: call frame info
But I'm unsure why the permission would ever be unavailable, can you give me some hint?
Comment 10•8 months ago
|
||
Sorry for the late response.
The permissions for the content process are sent during launching the content process and initiating the window global parent. So, potentially, we will hit the crash if we access permissions anytime before permissions are available in content processes. But your change doesn't seem to introduce permission checks before these two initiations.
Also, the crash is caused by checking permission for permission delegation when initiating the top-level window in the content process. The permission should be available by then unless your patch changes the timing there.
Assignee | ||
Comment 11•8 months ago
|
||
I tried investigating but didn't have luck. I assume that async tasks triggered by each notification constructor would affect something after test run, but preventing task by disabling the permission did not fix the crash. For now I'll modify the test to wait for onshow event, but given this is unsupported on Android, it'll be TIMEOUT/NOTRUN there, which is anyway consistent to other existing test results. We'll probably have to revisit this when implementing onshow support.
Comment 12•8 months ago
|
||
Comment 13•8 months ago
|
||
Backed out for causing crashes at permission.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/50aa532c7ae2d32c3b98288445b5cea48f490975
Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=5df20aa207c28175cc07920a0ce705291926e3fb
Failure log: https://treeherder.mozilla.org/logviewer?job_id=445600810&repo=autoland&lineNumber=2017
Assignee | ||
Comment 14•8 months ago
|
||
Huh, https://treeherder.mozilla.org/jobs?repo=try&revision=a5f9579b0ce1ad08d2a20a64adb8c19f342685a4 was green... 🤔
Comment 16•8 months ago
|
||
Builds were broken already before so probably not a problem with this patch?
Assignee | ||
Comment 17•8 months ago
|
||
I think it's more about the android crash, which still is a thing 🥲
Updated•8 months ago
|
Assignee | ||
Comment 18•8 months ago
|
||
Alright, I think I'll skip the notification side here and do it on bug 1878741 instead as things are complex there than I thought.
Updated•8 months ago
|
Comment 19•8 months ago
|
||
Updated•8 months ago
|
Comment 20•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/08902298c277
https://hg.mozilla.org/mozilla-central/rev/b3966d5a4d29
Comment 21•4 months ago
|
||
Comment on attachment 9373503 [details]
Bug 1875257 - Part 2: Adjust notification tests r=asuth,#dom-worker-reviewers
Revision D198957 was moved to bug 1878741. Setting attachment 9373503 [details] to obsolete.
Updated•2 months ago
|
Description
•