This problem occurs with 1.1.4G:
The problem occurs if an exception occurs in the BreakpointHandler thread. When
this happens, the thread hangs waiting for a response from itself. I've seen
this bug happen twice. Once, the BreakpointHandler got a socket exception, and
the other time during garbage collection it called an AWT finalizer, which got a
NullPointerException. The fix Gordon wrote before his trip was to check for a
system thread before notifying the BreakpointHandler of an exception.
Our proposed fix
A call to isSystemThread is moved from handle_breakpoint to
handle_debugger_event so that we make sure that both exceptions and breakpoints
are ignored in system threads.
*** c:\temp\agent.c Fri Aug 29 10:34:51 1997
--- agent.c Mon Aug 25 16:51:58 1997
***************
*** 112,117 ****
--- 112,122 ----
{
extern bool_t JDB_loadclass_locked(ExecEnv *ee);
+ /* Ignore all events in system threads GVH SAS2 system thread check */
+ if (isSystemThread(hp)) { /* GVH SAS2 system thread check */
+ return; /* GVH SAS2 system thread check */
+ } /* GVH SAS2 system thread check */
+
if (JDB_loadclass_locked(ee)) { /* fix to deadlock - courtesy of SAS
"ARB" */
return;
}
***************
*** 189,208 ****
static void
handle_breakpoint(ExecEnv *ee, unsigned char *pc)
{
! HThread *hp = threadSelf();
long fSystemThread;
! bool_t isSystemThread(HThread *);
if (get_the_bkptQ() == NULL) {
return;
}
/* ignore non-debuggable threads */
! if (isSystemThread(hp)) {
! return;
! }
! handle_debugger_event(hp, pc, ee, NULL, NULL);
}
static void
--- 194,213 ----
static void
handle_breakpoint(ExecEnv *ee, unsigned char *pc)
{
! /* HThread *hp = threadSelf(); GVH SAS2 system thread check */
long fSystemThread;
! /* bool_t isSystemThread(HThread *); GVH SAS2 system thread check */
if (get_the_bkptQ() == NULL) {
return;
}
/* ignore non-debuggable threads */
! /* if (isSystemThread(hp)) { GVH SAS2 system thread check */
! /* return; GVH SAS2 system thread check */
! /* } GVH SAS2 system thread check */
! handle_debugger_event(threadSelf(), pc, ee, NULL, NULL); /* GVH SAS2
system thread check */
}
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.
The problem occurs if an exception occurs in the BreakpointHandler thread. When
this happens, the thread hangs waiting for a response from itself. I've seen
this bug happen twice. Once, the BreakpointHandler got a socket exception, and
the other time during garbage collection it called an AWT finalizer, which got a
NullPointerException. The fix Gordon wrote before his trip was to check for a
system thread before notifying the BreakpointHandler of an exception.
Our proposed fix
A call to isSystemThread is moved from handle_breakpoint to
handle_debugger_event so that we make sure that both exceptions and breakpoints
are ignored in system threads.
*** c:\temp\agent.c Fri Aug 29 10:34:51 1997
--- agent.c Mon Aug 25 16:51:58 1997
***************
*** 112,117 ****
--- 112,122 ----
{
extern bool_t JDB_loadclass_locked(ExecEnv *ee);
+ /* Ignore all events in system threads GVH SAS2 system thread check */
+ if (isSystemThread(hp)) { /* GVH SAS2 system thread check */
+ return; /* GVH SAS2 system thread check */
+ } /* GVH SAS2 system thread check */
+
if (JDB_loadclass_locked(ee)) { /* fix to deadlock - courtesy of SAS
"ARB" */
return;
}
***************
*** 189,208 ****
static void
handle_breakpoint(ExecEnv *ee, unsigned char *pc)
{
! HThread *hp = threadSelf();
long fSystemThread;
! bool_t isSystemThread(HThread *);
if (get_the_bkptQ() == NULL) {
return;
}
/* ignore non-debuggable threads */
! if (isSystemThread(hp)) {
! return;
! }
! handle_debugger_event(hp, pc, ee, NULL, NULL);
}
static void
--- 194,213 ----
static void
handle_breakpoint(ExecEnv *ee, unsigned char *pc)
{
! /* HThread *hp = threadSelf(); GVH SAS2 system thread check */
long fSystemThread;
! /* bool_t isSystemThread(HThread *); GVH SAS2 system thread check */
if (get_the_bkptQ() == NULL) {
return;
}
/* ignore non-debuggable threads */
! /* if (isSystemThread(hp)) { GVH SAS2 system thread check */
! /* return; GVH SAS2 system thread check */
! /* } GVH SAS2 system thread check */
! handle_debugger_event(threadSelf(), pc, ee, NULL, NULL); /* GVH SAS2
system thread check */
}
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.