Closed Bug 58514 Opened 24 years ago Closed 24 years ago

nspr logging is broken

Categories

(Core :: XPCOM, defect, P3)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla0.8

People

(Reporter: danm.moz, Assigned: danm.moz)

References

Details

(Whiteboard: fixed on trunk)

Today's build, set NSPR_LOG_FILE=<some file name> and launch Mozilla. It 
crashes early on in library initialization, before main(), offering no 
opportunity to debug. Very annoying.
  This happens because the new logging code in XPCOM is failing to open the log 
file, and leaving a dangling pointer. This patch fixes the logging failure and 
the crash should logging fail for some other reason:

--- nsLogging.cpp-1.10	Mon Oct 30 14:34:40 2000
+++ nsLogging.cpp	Mon Oct 30 14:15:33 2000
@@ -245,6 +245,7 @@
         rv = gLoggingService->Init();
         if (NS_FAILED(rv)) {
             delete gLoggingService;
+            gLoggingService = nsnull;
             return rv; 
         }
         // Note that there's no AddRef here. That's because when the service 
manager
@@ -607,7 +608,7 @@
         filePtr = stderr;
     }
     else {
-        filePtr = ::fopen(filePath, "W");
+        filePtr = ::fopen(filePath, "w");
         if (filePtr == nsnull)
             return NS_ERROR_FAILURE;
         mCloseFile = PR_TRUE;
r=warren

Sorry about that Dan. Who would have thought the case would matter there?
Curse those humorless stdlib authors.
Assignee: warren → danm
Whiteboard: fixed on trunk
Target Milestone: --- → M19
Blocks: 58541
.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla0.8
You need to log in before you can comment on or make changes to this bug.