Bug 194240 - Filter out Overconstrainederror.constraint when getUserMedia is not granted
Summary: Filter out Overconstrainederror.constraint when getUserMedia is not granted
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on: 194482
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-04 13:51 PST by youenn fablet
Modified: 2019-02-11 10:49 PST (History)
6 users (show)

See Also:


Attachments
Patch (46.65 KB, patch)
2019-02-05 09:22 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Rebasing (48.66 KB, patch)
2019-02-06 10:32 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (49.02 KB, patch)
2019-02-07 10:56 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (48.96 KB, patch)
2019-02-07 15:09 PST, youenn fablet
no flags Details | Formatted Diff | Diff
GTK fix (48.82 KB, patch)
2019-02-11 09:53 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2019-02-04 13:51:19 PST
Filter out Overconstrainederror.constraint when getUserMedia is not granted
Comment 1 youenn fablet 2019-02-05 09:22:18 PST
Created attachment 361196 [details]
Patch
Comment 2 youenn fablet 2019-02-06 10:32:04 PST
Created attachment 361304 [details]
Rebasing
Comment 3 youenn fablet 2019-02-07 10:56:24 PST
Created attachment 361417 [details]
Patch
Comment 4 Eric Carlson 2019-02-07 14:06:44 PST
Comment on attachment 361417 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=361417&action=review

> Source/WebKit/ChangeLog:8
> +        Make sure in UIProcess to filter out constraint if either the page had not gum granted

Nit: "filter out constraint if either the page had not gum granted" => "filter out the failed constraint name if either the page has not granted gUM"

> Source/WebKit/ChangeLog:9
> +        or it has not persistent access.

Nit: "it has not persistent access" => "it does not have persistent access"
Comment 5 youenn fablet 2019-02-07 15:09:54 PST
Created attachment 361457 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2019-02-07 15:49:05 PST
Comment on attachment 361457 [details]
Patch for landing

Clearing flags on attachment: 361457

Committed r241167: <https://trac.webkit.org/changeset/241167>
Comment 7 WebKit Commit Bot 2019-02-07 15:49:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-02-07 15:50:38 PST
<rdar://problem/47900857>
Comment 9 Philippe Normand 2019-02-10 11:40:04 PST
This broke the GTK Release mediastream tests:

Thread 1 (Thread 0x7f85423464c0 (LWP 95867)):
#0  0x00007f8551069987 in _ZN6WebKit38UserMediaPermissionRequestManagerProxy34requestUserMediaPermissionForFrameEmmON3WTF3RefIN7WebCore14SecurityOriginENS1_13DumbPtrTraitsIS4_EEEES8_ONS3_18MediaStreamRequestE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007f85510967ca in _ZN6WebKit12WebPageProxy34requestUserMediaPermissionForFrameEmmRKN7WebCore18SecurityOriginDataES4_ONS1_18MediaStreamRequestE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2  0x00007f8550ec15bc in _ZN3IPC13handleMessageIN8Messages12WebPageProxy34RequestUserMediaPermissionForFrameEN6WebKit12WebPageProxyEMS5_FvmmRKN7WebCore18SecurityOriginDataES9_ONS6_18MediaStreamRequestEEEEvRNS_7DecoderEPT0_T1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3  0x00007f8550eafe6c in _ZN6WebKit12WebPageProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4  0x00007f8550fc2d09 in _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#5  0x00007f85510bcaf2 in _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6  0x00007f8550fbbe4f in _ZN3IPC10Connection15dispatchMessageERNS_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7  0x00007f8550fbd6bb in _ZN3IPC10Connection15dispatchMessageESt10unique_ptrINS_7DecoderESt14default_deleteIS2_EE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8  0x00007f8550fbe553 in _ZN3IPC10Connection24dispatchIncomingMessagesEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9  0x0000559724407aa8 in _ZN3WTF7RunLoop11performWorkEv ()
#10 0x000055972446d4d9 in _ZZN3WTF7RunLoopC4EvENUlPvE_4_FUNES1_ ()
#11 0x00007f854eac165a in g_main_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3182
#12 g_main_context_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3847
#13 0x00007f854eac19e8 in g_main_context_iterate () at ../../Source/glib-2.58.1/glib/gmain.c:3920
#14 0x00007f854eac1d02 in g_main_loop_run () at ../../Source/glib-2.58.1/glib/gmain.c:4116
#15 0x000055972446df20 in _ZN3WTF7RunLoop3runEv ()
#16 0x00005597243ec8b2 in _ZN3WTR14TestController16platformRunUntilERbN3WTF7SecondsE ()
#17 0x00005597243d4fa1 in _ZN3WTR14TestInvocation6invokeEv ()
#18 0x00005597243c96c2 in _ZN3WTR14TestController7runTestEPKc ()
#19 0x00005597243c9e7b in _ZN3WTR14TestController20runTestingServerLoopEv ()
#20 0x00005597243ca208 in _ZN3WTR14TestControllerC2EiPPKc ()
#21 0x00005597243bb8c1 in main ()
Comment 10 WebKit Commit Bot 2019-02-10 11:42:04 PST
Re-opened since this is blocked by bug 194482
Comment 11 youenn fablet 2019-02-10 21:17:19 PST
Philippe, any idea why the patch broke the GTK build? nullptr dereference ? uaf?
Comment 12 youenn fablet 2019-02-10 22:56:26 PST
OK, I think this is again the use of a variable while moving in a lambda that is causing the issue.
> getUserMediaPermissionInfo(frameID, request->userMediaDocumentSecurityOrigin(), request->topLevelDocumentSecurityOrigin(), [this, request = request.releaseNonNull()](Optional<bool> hasPersistentAccess) mutable {

Will fix it and reland it.
If you have time, let me know if this is not the case.
Comment 13 youenn fablet 2019-02-11 09:53:28 PST
Created attachment 361689 [details]
GTK fix
Comment 14 WebKit Commit Bot 2019-02-11 10:49:16 PST
Comment on attachment 361689 [details]
GTK fix

Clearing flags on attachment: 361689

Committed r241270: <https://trac.webkit.org/changeset/241270>
Comment 15 WebKit Commit Bot 2019-02-11 10:49:18 PST
All reviewed patches have been landed.  Closing bug.