Closed Bug 1759794 Opened 2 years ago Closed 2 years ago

Intermittent SUMMARY: ThreadSanitizer: data race /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c:3655:21 in sftk_checkNeedLogin

Categories

(NSS :: Libraries, defect, P5)

Tracking

(firefox-esr91 wontfix, firefox-esr102104+ fixed, firefox101 wontfix, firefox102 wontfix, firefox103 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 104+ fixed
firefox101 --- wontfix
firefox102 --- wontfix
firefox103 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: jschanck)

References

(Blocks 2 open bugs)

Details

(Keywords: csectype-race, intermittent-failure, sec-moderate, Whiteboard: [post-critsmash-triage][adv-main103+r][adv-esr102.2+r])

Attachments

(2 files)

Filed by: mlaza [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=371209072&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/ar5iAbymSBOsFsPaVdJQQg/runs/0/artifacts/public/logs/live_backing.log


[task 2022-03-16T03:27:00.220Z] 03:27:00     INFO - TEST-START | toolkit/components/passwordmgr/test/browser/browser_doorhanger_toggles.js
[task 2022-03-16T03:27:03.941Z] 03:27:03     INFO - GECKO(1597) | MP change from  to omgsecret!
[task 2022-03-16T03:27:05.899Z] 03:27:05     INFO - GECKO(1597) | ==================
[task 2022-03-16T03:27:05.903Z] 03:27:05     INFO - GECKO(1597) | WARNING: ThreadSanitizer: data race (pid=1597)
[task 2022-03-16T03:27:05.904Z] 03:27:05     INFO - GECKO(1597) |   Write of size 4 at 0x7b4c002b5ac8 by main thread:
[task 2022-03-16T03:27:05.905Z] 03:27:05     INFO - GECKO(1597) |     #0 sftk_checkNeedLogin /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c:3655:21 (libsoftokn3.so+0x1ef0f)
[task 2022-03-16T03:27:05.906Z] 03:27:05     INFO - GECKO(1597) |     #1 NSC_GetTokenInfo /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c:3724:21 (libsoftokn3.so+0x1ef0f)
[task 2022-03-16T03:27:05.907Z] 03:27:05     INFO - GECKO(1597) |     #2 PK11_GetTokenInfo /builds/worker/checkouts/gecko/security/nss/lib/pk11wrap/pk11slot.c:1955:11 (libnss3.so+0xa9c26)
[task 2022-03-16T03:27:05.907Z] 03:27:05     INFO - GECKO(1597) |     #3 nsPK11Token::refreshTokenInfo() /builds/worker/checkouts/gecko/security/manager/ssl/nsPK11TokenDB.cpp:57:39 (libxul.so+0x6fe5244)
...
[task 2022-03-16T03:27:06.155Z] 03:27:06     INFO - GECKO(1597) |     #23 MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:306:3 (libxul.so+0x198b00c)
[task 2022-03-16T03:27:06.156Z] 03:27:06     INFO - GECKO(1597) |     #24 nsThread::ThreadFunc(void*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:389:10 (libxul.so+0xfb7bbc)
[task 2022-03-16T03:27:06.157Z] 03:27:06     INFO - GECKO(1597) |     #25 _pt_root /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:201:5 (libnspr4.so+0x44fad)
[task 2022-03-16T03:27:06.157Z] 03:27:06     INFO - GECKO(1597) | SUMMARY: ThreadSanitizer: data race /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c:3655:21 in sftk_checkNeedLogin
[task 2022-03-16T03:27:06.158Z] 03:27:06     INFO - GECKO(1597) | ==================
[task 2022-03-16T03:27:06.159Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.160Z] 03:27:06     INFO - GECKO(1597) | Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=1.00879) Exiting due to channel error.
[task 2022-03-16T03:27:06.161Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.162Z] 03:27:06     INFO - GECKO(1597) | Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=8.0202) Exiting due to channel error.
[task 2022-03-16T03:27:06.162Z] 03:27:06     INFO - GECKO(1597) | Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=4.66881) Exiting due to channel error.
[task 2022-03-16T03:27:06.163Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.165Z] 03:27:06     INFO - GECKO(1597) | Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=592.68) [GFX1-]: Receive IPC close with reason=AbnormalShutdown
[task 2022-03-16T03:27:06.166Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.167Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.168Z] 03:27:06     INFO - GECKO(1597) | Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=595.273) [GFX1-]: Receive IPC close with reason=AbnormalShutdown
[task 2022-03-16T03:27:06.169Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:06.170Z] 03:27:06     INFO - GECKO(1597) | Exiting due to channel error.
[task 2022-03-16T03:27:07.187Z] 03:27:07     INFO - TEST-INFO | Main app process: killed by SIGIOT
[task 2022-03-16T03:27:07.188Z] 03:27:07     INFO - Buffered messages logged at 03:27:00
[task 2022-03-16T03:27:07.188Z] 03:27:07     INFO - Entering test bound common_initialize
[task 2022-03-16T03:27:07.189Z] 03:27:07     INFO - Leaving test bound common_initialize
[task 2022-03-16T03:27:07.189Z] 03:27:07     INFO - Entering test bound setup
[task 2022-03-16T03:27:07.189Z] 03:27:07     INFO - Leaving test bound setup
[task 2022-03-16T03:27:07.195Z] 03:27:07     INFO - Entering test bound test_toggle_password
[task 2022-03-16T03:27:07.195Z] 03:27:07     INFO - Buffered messages logged at 03:27:01
[task 2022-03-16T03:27:07.195Z] 03:27:07     INFO - Opened tab with url: https://example.com/browser/toolkit/components/passwordmgr/test/browser/form_basic.html, waiting for focus
[task 2022-03-16T03:27:07.196Z] 03:27:07     INFO - Waiting for form-processed message
[task 2022-03-16T03:27:07.196Z] 03:27:07     INFO - listenForTestNotification, resolving for message: FormProcessed
[task 2022-03-16T03:27:07.196Z] 03:27:07     INFO - TEST-PASS | toolkit/components/passwordmgr/test/browser/browser_doorhanger_toggles.js | #form-basic-password has the expected initial value - "" == "" - 
Assignee: nobody → nobody
Blocks: tsan
Group: firefox-core-security → crypto-core-security
Component: Password Manager → Libraries
Keywords: csectype-race
Product: Toolkit → NSS
Version: unspecified → other

Looks like a background thread is calling IntermediatePreloadingHealerCallback, which ends up inside NSC_FindObjectsInit on this line:
isLoggedIn = (PRBool)((!slot->needLogin) || slot->isLoggedIn);

Meanwhile, on the main thread JS is calling into nsPK11TokenDB::GetInternalKeyToken() which ends up in sftk_checkNeedLogin on this line:
slot->needLogin = (PRBool)!sftk_hasNullPassword(slot, keyHandle);

Dana, do you know if this is nsNSSComponent needing to hold some mutex or maybe an issue inside NSS itself? Thanks.

Flags: needinfo?(dkeeler)

Given the existence of nsNSSComponent::mMutex, my guess is that this is an issue inside nsNSSComponent.cpp (but I could be wrong), so I'll move it over there.

Assignee: nobody → nobody
Component: Libraries → Security: PSM
Product: NSS → Core
Version: other → unspecified

This is internal to NSS, and should probably be handled there.

Assignee: nobody → nobody
Component: Security: PSM → Libraries
Flags: needinfo?(dkeeler)
Product: Core → NSS
Version: unspecified → other
Blocks: 1763237
Assignee: nobody → jschanck
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.80
Group: crypto-core-security → core-security-release
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main103+r]
No longer blocks: 1780022
Whiteboard: [post-critsmash-triage][adv-main103+r] → [post-critsmash-triage][adv-main103+][adv-main102.2+]
Group: core-security-release
Whiteboard: [post-critsmash-triage][adv-main103+][adv-main102.2+] → [post-critsmash-triage][adv-main103+][adv-esr102.2+]
Whiteboard: [post-critsmash-triage][adv-main103+][adv-esr102.2+] → [post-critsmash-triage][adv-main103+r][adv-esr102.2+r]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: