assertion needed in PR_Lock

RESOLVED FIXED in 4.2

Status

NSPR
NSPR
P3
normal
RESOLVED FIXED
17 years ago
17 years ago

People

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

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
I was running the mozilla client on NT earlier today and ran into a problem when 
I crashed in PR_Lock because it had been passed a null lock as its parameter.

I think that PR_Lock should assert when it is passed a null lock (rather than 
crashing later (PR_ASSERT(lock->owner != me);) when lock is dereferenced.

This could be fixed by changing the above assertion(s) to something like:
  PR_ASSERT(lock && lock->owner != me);
or by adding a new line near the top (something like):
  PR_ASSERT(lock);
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → 4.2
(Assignee)

Comment 1

17 years ago
Created attachment 37273 [details] [diff] [review]
Proposed patch.
(Assignee)

Comment 2

17 years ago
Fixed on the trunk of NSPR.  I assert that lock is not NULL
in PR_Unlock as well.

Mozilla client won't pick up this change until it switches
to NSPR 4.2.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
Version: 3.1 → 4.0.2
You need to log in before you can comment on or make changes to this bug.