It seems this is an issue with the Master Password logic. In 10.5, creating a new Login without setting a master password fails, and setting a master password fails. In 10.0.18 these actions are successful. Maybe this has something do do with the idb migration (?).
/* The flags are defined in the following table: * Bit Flag Mask Meaning */#define CKF_RW_SESSION 0x00000002UL /* session is r/w */#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
@richard could this be related to #40490 (closed)? There aren't too many changes that landed between 10.5a17 and 10.5, and most shouldn't have any impact on PSM/NSS.
So this is a weird one to debug. I suspect this problem has to do with something apart from a code change, as doing a git bisect, and deploying over the broken build, never gets us back to a working state (eg even when going before this broke in our alphas). After bisection failed to find a commit to blame, I started debugging.
I started diving into the failing call when we attempt to set a master password. The call fails as if there were no cert db, and it turns out that's because there is no cert db (despite the pref being set correctly). Much debugging later, i've found it's because our call to InitializeNSSWithFallbacks() (which happens during firefox launch) ends up falling back on to NSS_NoDB_Init() after attempts to read an existing db fails. As to why it fails, I have no idea I'm still digging through.
So the problem here is that tor-launcher-protocol-service (which calls into and will lazily init the nsNSSComponent) was being created too soon due to being pulled in via the TorProtocolService init in BrowserGlue.jsm
Here's the offending JS Stack Trace in case we run into this issue again:
0 get _RNGService() ["jar:file:///home/pospeselr/Code/tor-browser/.binaries/dev/Browser/browser/omni.ja!/chrome/torlauncher/components/tl-protocol.js":1376:28] this = [object Object]1 _crypto_rand_int(aMax = "94") ["jar:file:///home/pospeselr/Code/tor-browser/.binaries/dev/Browser/browser/omni.ja!/chrome/torlauncher/components/tl-protocol.js":1267:18] this = [object Object]2 _generateRandomPassword() ["jar:file:///home/pospeselr/Code/tor-browser/.binaries/dev/Browser/browser/omni.ja!/chrome/torlauncher/components/tl-protocol.js":1186:21] this = [object Object]3 TorProtocolService() ["jar:file:///home/pospeselr/Code/tor-browser/.binaries/dev/Browser/browser/omni.ja!/chrome/torlauncher/components/tl-protocol.js":88:35] this = [object Object]4 <TOP LEVEL> ["jar:file:///home/pospeselr/Code/tor-browser/.binaries/dev/Browser/browser/omni.ja!/chrome/torlauncher/components/tl-protocol.js":1563:26]5 <TOP LEVEL> ["resource:///modules/TorProtocolService.jsm":12:62]6 <TOP LEVEL> ["resource:///modules/BrowserGlue.jsm":20:43]
tl-protocol.js cannot be init'd until after profile-after-change.
Not sure if this is helpful, but this reminds me of issue #33540 (closed), introduced in v9.0.x, where TB fails to create permissions.sqlite even if the prefs to do so are enabled, for unknown reasons.