If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Avoid the recursive call to nssToken_NotifyCertsNotVisible when a token is removed and re-inserted

NEW
Assigned to

Status

NSS
Libraries
P5
enhancement
14 years ago
a year ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

14 years ago
In bug 212112, we reported a recursive deadlock when a token is
removed and re-inserted with the following stack trace:

(gdb) where
#0  0x90034828 in semaphore_wait_trap ()
#1  0x90009d18 in pthread_mutex_lock ()
#2  0x003a45a0 in PR_Lock (lock=0xf3ce60) at
../../../../mozilla/nsprpub/pr/src/pthreads/ptsynch.c:190
#3  0x0095f868 in nssTrustDomain_RemoveTokenCertsFromCache (td=0xf46bb8,
token=0xf4b838) at tdcache.c:486
#4  0x008ef4f0 in nssToken_NotifyCertsNotVisible (tok=0xf4b838) at dev3hack.c:311
#5  0x00967a14 in nssSlot_IsTokenPresent (slot=0xf4c248) at devslot.c:360
#6  0x00967ac4 in nssSlot_GetToken (slot=0xf4c248) at devslot.c:403
#7  0x0095e808 in nssTrustDomain_FindTrustForCertificate (td=0xf46bb8,
c=0x37c3e80) at trustdomain.c:1194
#8  0x00965d60 in nssTrust_GetCERTCertTrustForCert (c=0x37c3e80, cc=0x37c4660)
at pki3hack.c:537
#9  0x009663f0 in fill_CERTCertificateFields (c=0x37c3e80, cc=0x37c4660,
forced=1) at pki3hack.c:690
#10 0x00966508 in stan_GetCERTCertificate (c=0x37c3e80, forceUpdate=1) at
pki3hack.c:718
#11 0x00966594 in STAN_ForceCERTCertificateUpdate (c=0x37c3e80) at pki3hack.c:734
#12 0x0095f8fc in nssTrustDomain_RemoveTokenCertsFromCache (td=0xf46bb8,
token=0xf4b838) at tdcache.c:492
#13 0x008ef4f0 in nssToken_NotifyCertsNotVisible (tok=0xf4b838) at dev3hack.c:311
#14 0x00967a14 in nssSlot_IsTokenPresent (slot=0xf4c248) at devslot.c:360
#15 0x0096bed0 in nssToken_IsPresent (token=0xf4b838) at devtoken.c:1620
#16 0x00911120 in pk11_IsPresentCertLoad (slot=0xf45140, loadCerts=1) at
pk11slot.c:2012
#17 0x0091131c in PK11_IsPresent (slot=0xf45140) at pk11slot.c:2059
#18 0x0090da28 in PK11_FindSlotByName (name=0x3628ba0 "AOL Key") at pk11slot.c:584

We checked in a fix so that the recursive call to
nssToken_NotifyCertsNotVisible won't result in a recursive deadlock
on td->cache->lock, but we should be able to avoid the recursive
call to nssToken_NotifyCertsNotVisible.  That's the subject of this
bug.  I marked this bug as an enhancement request because the
recursive call doesn't have any known ill effects.
QA Contact: bishakhabanerjee → jason.m.reid
QA Contact: jason.m.reid → libraries
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.