Closed Bug 1402818 Opened 8 years ago Closed 8 years ago

Assertion failed: IsGUIThread(false) in mouse_cursor_monitor_win.cc

Categories

(Core :: WebRTC: Audio/Video, defect, P2)

57 Branch
Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: pehrsons, Assigned: dminor)

References

Details

Attachments

(1 file, 1 obsolete file)

See https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1cda02d4f1fae6c85e96f82ac13690299fca3c1 Or, if that is gone when you load it, enable test_getUserMedia_basicScreenshare.html on windows debug and run on try. This started happening with the changes done to that test in bug 1380346.
This assertion was added in the branch 57 update, check blame at [1] and it is not present in upstream webrtc.org [2] as the IsGUIThread checks are our code. I'm going to suggest that this was added by accident, when we were adding the IsGUIThread to the methods that require them. [1] http://searchfox.org/mozilla-central/rev/f6dc0e40b51a37c34e1683865395e72e7fca592c/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_win.cc#112 [2] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor_win.cc?q=MouseCursorMonitorWin&sq=package:chromium&l=102
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Attachment #8911772 - Flags: review?(rjesup)
Here's a try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=106483ae106cfe7b3b3dd1d25b6575a24a8767ac I just wrote the patch myself for try, but content is the same.
(In reply to Dan Minor [:dminor] from comment #1) > This assertion was added in the branch 57 update, check blame at [1] and it > is not present in upstream webrtc.org [2] as the IsGUIThread checks are our > code. I'm going to suggest that this was added by accident, when we were > adding the IsGUIThread to the methods that require them. We added a bunch of IsGUIThread() assertions after fixing a problem with not being on a UI thread in bug 1060738 (jimm), including this one. You're just seeing the changes we're carrying being merged forward; if a change is part of the "rollup" patch, it likely was there before the update. Check out the changeset before the webrtc.org landing to verify. The really odd thing is that this was called from PlatformUIThread::Run().... 8-/ ??!
Comment on attachment 8911772 [details] [diff] [review] Remove IsGUIThread() assertion from Capture() Review of attachment 8911772 [details] [diff] [review]: ----------------------------------------------------------------- This was added on purpose, and we *should* be running on a UI thread unless that class is entirely broken in the webrtc.org 57 update. Asserting is right, I believe. If PlatformUIThread isn't a UI thread, we need to make it one ASAP.
Attachment #8911772 - Flags: review?(rjesup) → review-
> We added a bunch of IsGUIThread() assertions after fixing a problem with not > being on a UI thread in bug 1060738 (jimm), including this one. You're just > seeing the changes we're carrying being merged forward; if a change is part > of the "rollup" patch, it likely was there before the update. Check out the > changeset before the webrtc.org landing to verify. > Yes, you're right and I should know better, I've been bitten by this before.
After the call to ApplyConstraints() the same thread which previously was running ok fails the IsGUIThread() assertion the very next time Capture() is called. I see garbage values in the local variables in the debugger, so maybe we're failing to stop the thread after some data is freed, I'm not certain yet. At any rate, it looks like the PlatformUIThread is a UI thread right up to the point after ApplyConstraints is called.
Attachment #8911772 - Attachment is obsolete: true
Attachment #8913396 - Flags: review?(apehrson)
Comment on attachment 8913396 [details] [diff] [review] Set hwnd_ to NULL in Stop() Review of attachment 8913396 [details] [diff] [review]: ----------------------------------------------------------------- This makes sense, thanks! Can you uplift this to webrtc.org?
Attachment #8913396 - Flags: review?(apehrson) → review+
(In reply to Andreas Pehrson [:pehrsons] from comment #10) > Comment on attachment 8913396 [details] [diff] [review] > Set hwnd_ to NULL in Stop() > > Review of attachment 8913396 [details] [diff] [review]: > ----------------------------------------------------------------- > > This makes sense, thanks! Can you uplift this to webrtc.org? Thanks! Unless I'm misreading blame for the second time on this bug :) PlatformUIThread is our code and does not exist upstream. I guess at some point we should try to either upstream the whole thing or determine what we're doing differently that we require the changes.
Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/835180921387 Set hwnd_ to NULL in PlatformUIThread::Stop(); r=pehrsons
(In reply to Dan Minor [:dminor] from comment #13) > (In reply to Andreas Pehrson [:pehrsons] from comment #10) > > Comment on attachment 8913396 [details] [diff] [review] > > Set hwnd_ to NULL in Stop() > > > > Review of attachment 8913396 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > This makes sense, thanks! Can you uplift this to webrtc.org? > > Thanks! Unless I'm misreading blame for the second time on this bug :) > PlatformUIThread is our code and does not exist upstream. I guess at some > point we should try to either upstream the whole thing or determine what > we're doing differently that we require the changes. Right, thanks for checking that!
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Do we want to uplift that to 57?
Flags: needinfo?(dminor)
Comment on attachment 8913396 [details] [diff] [review] Set hwnd_ to NULL in Stop() Approval Request Comment [Feature/Bug causing the regression]: This problem was present when this code was initially landed in Bug 1060738. [User impact if declined]: Running code that accesses UI functionality on Windows from a non-UI thread can lead to crashes. Without this fix, if Stop() and then Start() is called on the thread, what was previously a UI thread will no longer be one. [Is this code covered by automated tests?]: Yes, this issue was discovered by modifying one of our screen sharing unit tests. [Has the fix been verified in Nightly?]: Yes. [Needs manual test from QE? If yes, steps to reproduce]: No. [List of other uplifts needed for the feature/fix]: None. [Is the change risky?]: No. [Why is the change risky/not risky?]: This just resets a variable so that initialization will happen properly if we call Stop() then Start(). [String changes made/needed]: None.
Flags: needinfo?(dminor)
Attachment #8913396 - Flags: approval-mozilla-beta?
Comment on attachment 8913396 [details] [diff] [review] Set hwnd_ to NULL in Stop() This is not a new regression, recommend letting this fix ride the 58 train.
Attachment #8913396 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: