Closed Bug 1682240 Opened 10 months ago Closed 5 months ago

Firefox hangs due to proxy server authentication: [@ __pthread_cond_wait | _MD_WaitUnixProcess | nsAuthSambaNTLM::Shutdown ]

Categories

(Core :: Networking, defect, P2)

Firefox 83
x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: tessarakt, Assigned: valentin)

Details

(Whiteboard: [necko-triaged])

Crash Data

Attachments

(2 files)

From time to time, my Firefox just hangs. When sending SIGABRT, I get a stack trace like this: [@ __pthread_cond_wait | _MD_WaitUnixProcess | nsAuthSambaNTLM::Shutdown ]

This seems to be similar to bug 1662550 ...

Hi Jens,

Can you please include your about:support information?

Setting a component for this in order to get the dev team involved.
(If the team feels it's an incorrect one please feel free to change it to a more appropriate one.)

Best, Clara

Component: Untriaged → Security
Flags: needinfo?(blog)
Product: Firefox → Core
Flags: needinfo?(blog)

(In reply to Clara Guerrero from comment #1)

Hi Jens,

Can you please include your about:support information?

Setting a component for this in order to get the dev team involved.
(If the team feels it's an incorrect one please feel free to change it to a more appropriate one.)

Best, Clara

Hi Clara,

thanks for looking into this. The about:support raw data is attached.

Best, Jens

Component: Security → Networking
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]

Taking a look.

3 libxul.so nsAuthSambaNTLM::Shutdown() extensions/auth/nsAuthSambaNTLM.cpp:41 cfi
4 libxul.so nsAuthSambaNTLM::Release() extensions/auth/nsAuthSambaNTLM.cpp:46 cfi
5 libxul.so nsIAuthModule::CreateInstance(char const*) extensions/auth/nsIAuthModule.cpp:44 cfi
6 libxul.so mozilla::net::nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel*, char const*, bool, nsISupports**, nsISupports**, bool*) netwerk/protocol/http/nsHttpNTLMAuth.cpp:191 cfi
7 libxul.so mozilla::net::nsHttpChannelAuthProvider::GetCredentialsForChallenge(char const*, char const*, bool, nsIHttpAuthenticator*, nsTString<char>&) netwerk/protocol/http/nsHttpChannelAuthProvider.cpp:726 cfi
8 libxul.so mozilla::net::nsHttpChannelAuthProvider::GetCredentials(char const*, bool, nsTString<char>&) netwerk/protocol/http/nsHttpChannelAuthProvider.cpp:561 cfi
9 libxul.so mozilla::net::nsHttpChannelAuthProvider::OnAuthCancelled(nsISupports*, bool) netwerk/protocol/http/nsHttpChannelAuthProvider.cpp:1328 cfi
10 libxul.so mozilla::net::nsHttpChannelAuthProvider::OnCredsGenerated(char const*, unsigned int, nsresult, nsISupports*, nsISupports*) netwerk/protocol/http/nsHttpChannelAuthProvider.cpp:1370

Assignee: nobody → valentin.gosu

So from what I can tell the following steps happen:

We instantiate the nsAuthSambaNTLM object, then call SpawnNTLMAuthHelper which fails probably somewhere in these lines. Since the failure occurs, we then try to free the only instance of the service, which calls Shutdown from the destructor, and we hang here.
Arguably we could try calling PR_KillProcess instead of PR_WaitProcess.

Crash Signature: [@ nsAuthSambaNTLM::GetNextToken] [@ shutdownhang | __pthread_cond_wait | _MD_WaitUnixProcess | nsAuthSambaNTLM::Shutdown] [@ __pthread_cond_wait | _MD_WaitUnixProcess | nsAuthSambaNTLM::Shutdown] [@ shutdownhang | __pthread_cond_wait | _MD_WaitUnixPro…

This avoids hangs when the process might be unresponsive.

Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ce25b430ba5b
Kill ntlm_auth process instead of waiting for it to complete r=necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch

Hi Jens,

The bug should be fixed in the latest Nightly.
We have little automated testing for samba NTLM auth, so could you check that the auth still works correctly for you and hopefully that there are no hangs/crashes anymore?

Thanks!

Flags: needinfo?(blog)

(In reply to Valentin Gosu [:valentin] (he/him) from comment #10)

The bug should be fixed in the latest Nightly.
We have little automated testing for samba NTLM auth, so could you check that the auth still works correctly for you and hopefully that there are no hangs/crashes anymore?

Hi Valentin,

the bug is quite hard to provoke anyway. I didn't manage now (with the release version of Firefox). I imagine it's highly timing-dependent, or triggered by some strange behaviour of the proxy.

Anyway, I now tested with Firefox 91.0a1 (2021-06-13). Authentication works in general.

BR, Jens

Flags: needinfo?(blog)

Thank you for checking!

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.