Bug 222236 - UserMediaPermissionRequestManagerProxy may be released while computing capture device list
Summary: UserMediaPermissionRequestManagerProxy may be released while computing captur...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
: 223476 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-20 13:41 PST by Eric Carlson
Modified: 2021-03-19 10:45 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.22 KB, patch)
2021-02-20 13:51 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing (2.18 KB, patch)
2021-02-22 08:49 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch (1.68 KB, patch)
2021-02-22 15:09 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2021-02-20 13:41:00 PST
UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList should NULL-check after computing capture device list
Comment 1 Eric Carlson 2021-02-20 13:41:28 PST
<rdar://74480265>
Comment 2 Eric Carlson 2021-02-20 13:51:22 PST
Created attachment 421110 [details]
Patch
Comment 3 Peng Liu 2021-02-20 14:20:26 PST
Comment on attachment 421110 [details]
Patch

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

> Source/WebKit/ChangeLog:3
> +        UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList may be released

Sounds like UserMediaPermissionRequestManagerProxy may be released?
Comment 4 youenn fablet 2021-02-21 00:26:28 PST
Comment on attachment 421110 [details]
Patch

I guess the issue is log identifier, that is subtle… maybe this is an indication we should not site this in lambdas but just weakptr.
Comment 5 Eric Carlson 2021-02-22 08:49:11 PST
Created attachment 421198 [details]
Patch for landing
Comment 6 EWS 2021-02-22 11:44:54 PST
Committed r273265: <https://commits.webkit.org/r273265>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421198 [details].
Comment 7 Darin Adler 2021-02-22 11:47:28 PST
Comment on attachment 421198 [details]
Patch for landing

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

> Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:741
> -        if (weakThis)
> -            m_hasFilteredDeviceList = !revealIdsAndLabels;
> -
> +        weakThis->m_hasFilteredDeviceList = !revealIdsAndLabels;

Why capture "this" but use "weakThis" here?
Comment 8 Eric Carlson 2021-02-22 15:09:10 PST
Reopening to attach new patch.
Comment 9 Eric Carlson 2021-02-22 15:09:11 PST
Created attachment 421244 [details]
Patch
Comment 10 Eric Carlson 2021-02-22 15:10:18 PST
Comment on attachment 421198 [details]
Patch for landing

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

>> Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:741
>> +        weakThis->m_hasFilteredDeviceList = !revealIdsAndLabels;
> 
> Why capture "this" but use "weakThis" here?

Oops, that is left over from a bigger refactoring I (tried to) undo to make this a more targeted change. I'll remove it in a follow.
Comment 11 EWS 2021-02-22 17:11:02 PST
Committed r273289: <https://commits.webkit.org/r273289>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421244 [details].
Comment 12 Eric Carlson 2021-03-19 10:45:34 PDT
*** Bug 223476 has been marked as a duplicate of this bug. ***