Closed
Bug 104089
Opened 23 years ago
Closed 22 years ago
Cannot reattach context to its thread because of the bug in Context class
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
WORKSFORME
1.5R4
People
(Reporter: vstroutchkov, Assigned: norrisboyd)
Details
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
BuildID:
The following code:
// reattach cx to its thread
Context current;
if((current = Context.enter(cx)) != cx) {
System.out.println("debugger error: cx = " + cx + " current = " + current);
}
from function org.mozilla.javascript.tools.debugger.Main.interrupted(Context
cx) doesn't work because of the problem in Context.enter(Context cx) function:
else if (cx != null) {
synchronized (cx) {
if (cx.currentThread == null) {
cx.currentThread = t;
threadContexts.put(t, cx);
cx.enterCount++;
}
}
current = cx;
}
When cx.currentThread != null it's not replaced by the current thread as
attempted.
The fragment above should be replaced with something like that:
else if (cx != null) {
synchronized (cx) {
if (cx.currentThread == null || cx.currentThread != t) {
if (cx.currentThread != null) {
threadContexts.remove(cx.currentThread);
cx.enterCount--;
}
cx.currentThread = t;
threadContexts.put(t, cx);
cx.enterCount++;
}
}
current = cx;
}
Reproducible: Always
Steps to Reproduce:
1.Start debugger without parameters.
2.Using browser, run a script containing Context.getCurrentContext() call.
3.The call returns null
Actual Results: My script cannot find the right context because it
still "attached" to another thread.
Comment 1•23 years ago
|
||
Rhino bug -> Rhino product
Assignee: rginda → nboyd
Component: JavaScript Debugger → Core
Product: Browser → Rhino
QA Contact: rginda → pschwartau
Updated•23 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•22 years ago
|
||
The bug description is not applicable any more due to changes in
Context.enter/Context.exit, but as the test case works fine now, I suggest to
close this as fixed.
Comment 3•22 years ago
|
||
Resolving as WORKSFORME -
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
Comment 4•22 years ago
|
||
Marking Verified.
Vitaly, if there is a problem that still exists, please reopen - thanks.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•