Closed Bug 31120 Opened 25 years ago Closed 24 years ago

ntio.c: _PR_Unblock_IO_Wait sets the wrong thr_bound_cpu.

Categories

(NSPR :: NSPR, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

This bug was introduced when we added PR_NT_CancelIo
in NSPR 3.5.

In ntio.c, function _PR_Unblock_IO_Wait, we have:
    thr->md.thr_bound_cpu = me->cpu;
where 'thr' is the (local) thread being interrupted,
and 'me' is the thread calling PR_Interrupt.  This is
incorrect. The CPU of 'me' is irrelevant here.  'me'
may even be a global thread and have no CPU.

That line should be:
    thr->md.thr_bound_cpu = cpu;
which means 'thr' should be bound to its current CPU.
(The local variable 'cpu' is initialized to 'thr->cpu'.)
I agree, thr->cpu, and not me->cpu, should be used.

Srinivas
I suggest that we check in this fix on
the 3.5 and 4.0 release branches so that
it will be included in the 3.5.2 and 4.0.1
patches, if we decide to do 3.5.2 or 4.0.1.
Status: NEW → ASSIGNED
The fix was checked in on the main trunk.
/cvsroot/mozilla/nsprpub/pr/src/md/windows/ntio.c, revision 3.22
Added a new test intrio.c that reproduces this bug.
It hits an assertion failure in ntio.c: _PR_MD_PAUSE_CPU.
Merged the fix into NSPRPUB_RELEASE_4_0_BRANCH.
/cvsroot/mozilla/nsprpub/pr/src/md/windows/ntio.c, revision 3.20.4.8

Merged the fix into NSPRPUB_CLIENT_BRANCH.
/cvsroot/mozilla/nsprpub/pr/src/md/windows/ntio.c, revision 3.21.2.1

This fix will be in NSPR 4.0.1.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.0.1
You need to log in before you can comment on or make changes to this bug.