Enable PKCS11 module logging in optimized builds

RESOLVED FIXED in 3.12.2

Status

NSS
Build
P2
enhancement
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Nelson Bolyard (seldom reads bugmail), Assigned: Nelson Bolyard (seldom reads bugmail))

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

The most helpful tool for debugging problems with PKCS#11 modules is 
the PKCS#11 module logging facility in NSS.  Unfortunately, it is presently
only found in debug builds.  So, every time some user in the field has a 
problem, we have to find a way to get that user a debug build to log the 
problems.  This has recently become MUCH more difficult to do on Windows.

So, I propose that we enable the PKCS#11 module logger by default in 
Optimized builds.  This can be done by a very small change to the file
nss/lib/pk11wrap/pk11load.c near line 51, which reads

51 #ifdef DEBUG
52 #define DEBUG_MODULE 1
53 #endif

Simply removing lines 51 and 53 would do.  

Alternatively, changing line 51 to read 

#if defined(DEBUG) || defined(some other symbol)

and then defining that other symbol in the Makefile would also do.
Created attachment 341311 [details] [diff] [review]
patch v1

Bob, please review this tiny patch
Attachment #341311 - Flags: review?(rrelyea)

Updated

9 years ago
Attachment #341311 - Flags: review?(rrelyea) → review+

Comment 2

9 years ago
Comment on attachment 341311 [details] [diff] [review]
patch v1

r+

I see no problem enabling this debugging even in optimized builds.
Created attachment 341330 [details] [diff] [review]
patch v2

Sorry, that last patch was necessary but not sufficient.
This patch adds one more line, and really works! :)
Attachment #341311 - Attachment is obsolete: true
Attachment #341330 - Flags: review?(rrelyea)

Comment 4

9 years ago
Comment on attachment 341330 [details] [diff] [review]
patch v2

Is this needed for PR_Log if debug isn't defined?

bob
Bob asked,
> Is this needed for PR_Log if debug isn't defined?

Yes.  Without it, all the debug_module code for PR_Logging is a no-op.
It still computes the statistics, which are output to stdout, but does 
none of the logging.

Comment 6

9 years ago
Comment on attachment 341330 [details] [diff] [review]
patch v2

r+
Attachment #341330 - Flags: review?(rrelyea) → review+
Thanks, Bob,

Checking in pk11load.c; new revision: 1.25; previous revision: 1.24
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Assignee)

Updated

9 years ago
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.