nspr logging is broken

RESOLVED FIXED in mozilla0.8

Status

()

Core
XPCOM
P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: Dan M, Assigned: Dan M)

Tracking

Trunk
mozilla0.8
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed on trunk)

(Assignee)

Description

18 years ago
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;

Comment 1

18 years ago
r=warren

Sorry about that Dan. Who would have thought the case would matter there?
(Assignee)

Comment 2

18 years ago
Curse those humorless stdlib authors.
Assignee: warren → danm
(Assignee)

Updated

18 years ago
Whiteboard: fixed on trunk
Target Milestone: --- → M19

Updated

18 years ago
Blocks: 58541
(Assignee)

Comment 3

18 years ago
.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla0.8
You need to log in before you can comment on or make changes to this bug.