Closed Bug 1777518 Opened 2 years ago Closed 2 years ago

Crashing when logging into the computer via remote desktop

Categories

(Core :: Widget: Win32, defect, P2)

Firefox 101
Desktop
Windows 11
defect

Tracking

()

RESOLVED DUPLICATE of bug 1755700
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- fixed
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- fixed

People

(Reporter: yoasif, Assigned: handyman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

From: https://www.reddit.com/r/firefox/comments/vebwxy/firefox_crashes_every_time_i_log_into_the/

As of 3 or 4 weeks ago, Firefox has started crashing every time I log into my computer via remote desktop. I'm using Jump Desktop, if that changes anything. When I log into the computer via remote, Firefox is entirely frozen and trying to click anywhere brings up the "Firefox is not responding" thing and force-closing the program is the only thing that works.

It's definitely related to audio, the problem goes away if you play audio on your computer instead of disabling/playing it on your phone.

mozregression reveals that this was regressed by bug 1617283

Attached file about:support
Regressed by: 1617283
OS: Unspecified → Windows 11
Hardware: Unspecified → Desktop
Severity: -- → S2
Flags: needinfo?(shazib)
Priority: -- → P3

Set release status flags based on info from the regressing bug 1617283

Stephen, you set a needinfo but didn't ask any question. This is also marked S2 but P3, which seems inconsistent.

Flags: needinfo?(spohl.mozilla.bugs)

This is a regression, caused by bug 1617283. The n-i was set for the author of the patch in bug 1617283 to raise awareness and expectation of a fix for this crash.

Flags: needinfo?(spohl.mozilla.bugs)
Priority: P3 → P2
Assignee: nobody → davidp99
Flags: needinfo?(shazib)

Hi Asif, some of the reddit comments and comment 0 suggest a phone might have been involved and Jump Desktop looks to only be available for iOS. Is the bug that Firefox hangs on a Windows 10 machine that you use Jump Desktop to connect to from iOS? And is it the case that this happens for you every time?

Flags: needinfo?(yoasif)
Flags: needinfo?(yoasif)

I'd like to add that I, too, am suffering the same problem. My PC is running Windows 10 21H2 and Firefox 102.0.1. If I log into the PC locally and open Firefox and then switch to Remote Desktop, Firefox hangs with the "Firefox is not responding" error. If I log into the PC remotely and open Firefox, it works fine. I've tried disabling the hardware acceleration feature with no success. In all cases, the computer that I'm using to make the Remote Desktop Connection is also running Windows 10 21H2.

Thanks for the report. I've seen an instance of this too and it looks like a race in CDeviceEnumerator that we are triggering when the system sends AudioSession::OnSessionDisconnected. We then destroy our old AudioContext in an STA thread (main) while creating a new one from the MTA thread that OnSessionDisconnected is reported to and the result is:

thread 20312

ntdll.dll!NtWaitForSingleObject()	Unknown
KERNELBASE.dll!WaitForSingleObjectEx()	Unknown
MMDevAPI.dll!AXB::WaitForOperations()	Unknown
MMDevAPI.dll!CMediaNotifications::UnregisterMediaCallback()	Unknown
MMDevAPI.dll!UnregisterMediaCallback()	Unknown
MMDevAPI.dll!CLocalEndpointEnumerator::UnregisterInternalEndpointNotificationCallback()	Unknown
MMDevAPI.dll!CDeviceEnumerator::SubEnumeratorUnregisterEndpointNotificationCallback()	Unknown
MMDevAPI.dll!CDeviceEnumerator::OnSubEnumeratorChange(struct IMMDeviceEnumerator *,unsigned int,unsigned long)	Unknown
MMDevAPI.dll!CDeviceEnumerator::RefreshSubEnumerator()	Unknown
MMDevAPI.dll!CDeviceEnumerator::GetSubEnumerator()	Unknown
MMDevAPI.dll!CDeviceEnumerator::OnAudioProtocolNotification(unsigned int)	Unknown
MMDevAPI.dll!CDeviceEnumerator::OnAsyncNotification(void)	Unknown
MMDevAPI.dll!CDeviceEnumerator::AsyncNotificationCallback(struct _TP_CALLBACK_INSTANCE *,void *,struct _TP_WORK *)	Unknown
ntdll.dll!TppWorkpExecuteCallback()	Unknown
ntdll.dll!TppWorkerThread()	Unknown
kernel32.dll!BaseThreadInitThunk()	Unknown
mozglue.dll!00007ff99a8e02a8()	Unknown
ntdll.dll!RtlUserThreadStart()	Unknown

thread 20892

[Waiting on lock owned by Thread 20312, double-click or press enter to switch to thread]	
ntdll.dll!NtWaitForAlertByThreadId()	Unknown
ntdll.dll!RtlpWaitOnAddressWithTimeout()	Unknown
ntdll.dll!RtlpWaitOnAddress()	Unknown
ntdll.dll!RtlpWaitOnCriticalSection()	Unknown
ntdll.dll!RtlpEnterCriticalSectionContended()	Unknown
ntdll.dll!RtlEnterCriticalSection()	Unknown
MMDevAPI.dll!CDeviceEnumerator::GetSubEnumerator()	Unknown
MMDevAPI.dll!CDeviceEnumerator::GetDefaultAudioEndpointForPolicy()	Unknown
MMDevAPI.dll!CDeviceEnumerator::GetDefaultAudioEndpoint()	Unknown
xul.dll!mozilla::widget::AudioSession::Start() Line 207	C++
xul.dll!mozilla::widget::AudioSession::OnSessionDisconnected(AudioSessionDisconnectReason aReason) Line 367	C++
AudioSes.dll!CSessionDisconnect::Invoke(class ATL::CComPtr<struct IAudioSessionEvents>)	Unknown
AudioSes.dll!CLockedList<ATL::CComPtr<IAudioSessionEvents>,0,1>::ForEachEntry()	Unknown
AudioSes.dll!CAudioSessionControl::OnAudioSessionEvent()	Unknown
AudioSes.dll!CAudioSessionControl::CAudioSessionNotificationDelegator::OnMediaNotification(struct MEDIA_NOTIFICATION_BLOCK *)	Unknown
MMDevAPI.dll!CMediaNotifications::OnMediaNotificationWorkerHandler()	Unknown
ntdll.dll!TppSimplepExecuteCallback()	Unknown
ntdll.dll!TppWorkerThread()	Unknown
kernel32.dll!BaseThreadInitThunk()	Unknown
mozglue.dll!00007ff99a8e02a8()	Unknown
ntdll.dll!RtlUserThreadStart()	Unknown

thread 7020 (main)

ntdll.dll!NtWaitForSingleObject()	Unknown
KERNELBASE.dll!WaitForSingleObjectEx()	Unknown
MMDevAPI.dll!AXB::WaitForOperations()	Unknown
MMDevAPI.dll!CMediaNotifications::UnregisterMediaCallback()	Unknown
MMDevAPI.dll!UnregisterMediaCallback()	Unknown
AudioSes.dll!CAudioSessionControl::~CAudioSessionControl()	Unknown
AudioSes.dll!CAudioSessionControl::`vector deleting destructor'(unsigned int)	Unknown
AudioSes.dll!Microsoft::WRL::Details::RuntimeClassImpl<struct Microsoft::WRL::RuntimeClassFlags<3>,1,1,0,struct IInspectable,struct IAudioSessionControl,struct IAudioSessionControl2,struct IAudioSessionControlInternal,struct ISimpleAudioVolume,struct IChannelAudioVolume,struct IAudioMeterInformation,struct IPropertyStore,struct ICrossVmMediaNotificationProducer,struct ICrossVmMediaNotificationConsumer,class Microsoft::WRL::FtmBase>::Release(void)	Unknown
[Inline Frame] xul.dll!mozilla::RefPtrTraits<IAudioSessionControl>::Release(IAudioSessionControl * aPtr) Line 50	C++
[Inline Frame] xul.dll!RefPtr<IAudioSessionControl>::ConstRemovingRefPtrTraits<IAudioSessionControl>::Release(IAudioSessionControl * aPtr) Line 381	C++
[Inline Frame] xul.dll!RefPtr<IAudioSessionControl>::~RefPtr() Line 81	C++
[Inline Frame] xul.dll!mozilla::widget::AudioSession::OnSessionDisconnected::<lambda_4>::~() Line 364	C++
[Inline Frame] xul.dll!mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/widget/windows/AudioSession.cpp:364:29'>::~RunnableFunction() Line 522	C++
xul.dll!mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/widget/windows/AudioSession.cpp:364:29'>::~RunnableFunction() Line 522	C++
[Inline Frame] xul.dll!mozilla::RefPtrTraits<mozilla::SchedulerGroup::Runnable>::Release(mozilla::SchedulerGroup::Runnable * aPtr) Line 50	C++
[Inline Frame] xul.dll!RefPtr<mozilla::SchedulerGroup::Runnable>::ConstRemovingRefPtrTraits<mozilla::SchedulerGroup::Runnable>::Release(mozilla::SchedulerGroup::Runnable * aPtr) Line 381	C++
[Inline Frame] xul.dll!RefPtr<mozilla::SchedulerGroup::Runnable>::~RefPtr() Line 81	C++
[Inline Frame] xul.dll!nsThread::GetLabeledRunnableName(nsIRunnable * aEvent, nsTSubstring<char> & aName, mozilla::EventQueuePriority aPriority) Line 998	C++
[Inline Frame] xul.dll!mozilla::RunnableTask::Run() Line 524	C++
xul.dll!mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(const mozilla::detail::BaseAutoLock<mozilla::Mutex &> & aProofOfLock) Line 851	C++
[Inline Frame] xul.dll!mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(const mozilla::detail::BaseAutoLock<mozilla::Mutex &> & aProofOfLock) Line 683	C++
[Inline Frame] xul.dll!mozilla::TaskController::ProcessPendingMTTask(bool aMayWait) Line 461	C++
[Inline Frame] xul.dll!mozilla::TaskController::InitializeInternal::<lambda_1>::operator()() Line 187	C++
[Inline Frame] xul.dll!mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:187:7'>::Run() Line 531	C++
xul.dll!nsThread::ProcessNextEvent(bool aMayWait, bool * aResult) Line 1205	C++
[Inline Frame] xul.dll!NS_ProcessNextEvent(nsIThread * aThread, bool aMayWait) Line 465	C++
xul.dll!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate * aDelegate) Line 85	C++
[Inline Frame] xul.dll!MessageLoop::RunInternal() Line 380	C++
xul.dll!MessageLoop::RunHandler() Line 374	C++
xul.dll!MessageLoop::Run() Line 356	C++
xul.dll!nsBaseAppShell::Run() Line 152	C++
xul.dll!nsAppShell::Run() Line 613	C++
xul.dll!nsAppStartup::Run() Line 296	C++
xul.dll!XREMain::XRE_mainRun() Line 5719	C++
xul.dll!XREMain::XRE_main(int argc, char * * argv, const mozilla::BootstrapConfig & aConfig) Line 5913	C++
xul.dll!XRE_main(int argc, char * * argv, const mozilla::BootstrapConfig & aConfig) Line 5981	C++
firefox.exe!00007ff7f927b83e()	Unknown
firefox.exe!00007ff7f9288fe8()	Unknown
kernel32.dll!BaseThreadInitThunk()	Unknown
ntdll.dll!RtlUserThreadStart()	Unknown

Maybe the answer is to serialize the stopping of the old and starting of the new instead of allowing them to run in parallel.

I'm experiencing the same symptoms. The crashes started happening sometime in the past month or so.

Same symptoms too.
I tried some patterns.
Connect from Win11 to Win11 => Crash
Connect from Win10 to Win11 => Crash
Connect from Win11 to Win10 => No problem
Connect from Mac to Win11 => Crash
ONLY crasshing with Win11 is host.

See Also: → 1779334

Same thing happens for me and also with Thunderbird 102 (didn't happen with Thunderbird 91). I use HP ProBook 455 G7 with Win10 Pro at work. I have it running 24/7 with external monitor connected with USB-C (using USB-PD and DP-Alt) and Firefox and Thunderbird are also running 24/7. When I work locally I don't have any problems, but sometimes I need to connect to it using RDP from my home PC with Win10 Home or from Android using "Remote Desktop Manager" and quite often Firefox or Thunderbird or both will be hang with Not Responding. I force close them, but one time I left them running like that and next day when I logged in locally they were still Not Responding. Same thing happens for my coworker on his laptop, he has the same model and similar "usage patterns".

Comment 7 isn't the real story. It's that the hack inserted to avoid the deadlock with audio code is incomplete. Since we are going to destroy the IAudioSessionControl on the main thread, we need to use an AgileReference for COM thread safety. This makes sense and seems to clear up the remote desktop issue for me, although it may have just changed performance.

Workaround to avoid Firefox hanging when connecting with mstsc.exe / Remote Desktop Connection dialog:
Show Options -> Local Resources -> Remote audio: Settings... -> Remote audio playback: () Do not play; Remote audio recording: () Do not record

Comment 12 was not the real issue either. It seems the only safe way to handle this is as in comment 7 -- only perform Start after Stop has destroyed the old AudioSession. This seems to have resolved the remote desktop issue for me. That's actually part of a bigger crash issue around StartAudioSession and StopAudioSession that is being fixed in bug 1755700.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: