JDK-4320231 : FRAME_POP event is sent when a method terminates by throwing an exception
  • Type: Bug
  • Component: vm-legacy
  • Sub-Component: jvmdi
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-03-09
  • Updated: 2002-08-30
  • Resolved: 2002-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.3.1 rc1Fixed 1.4.0Fixed
Related Reports
Relates :  
Description

Name: dkC59003			Date: 03/09/2000



Kestrel HotSpot build 1.3rc2-V fails the test 
nsk/jvmdi/NotifyFramePop/nframepop001 from testbase_nsk.

The spec states in the Frame Events description:
"If a method terminates by throwing an exception to its
caller, neither a method exit event nor a frame pop event will be generated." 
But the HotSpot VM does generate JVMDI_EVENT_FRAME_POP event when 
the method meth2 throws Throwable exception.

Classic and HotSpot 1.3rc2-V on Solaris pass the test.

To reproduce the bug run
doit.bat <jdk root directory>
in
/net/sqesvr/vsn/GammaBase/Bugs/<this bug number>

When running on winNT the test outputs:

>doit G:\ld24\java\hotspot\jdk1.3.0\win32
...
java version "1.3.0rc2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc2-V)
Java HotSpot(TM) Client VM (build 1.3.0rc2-V, mixed mode)

FRAME_POP event sent

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: ladybird-rc1 merlin-beta INTEGRATED IN: ladybird-rc1 merlin-beta VERIFIED IN: ladybird-rc1 merlin-rc1
14-06-2004

SUGGESTED FIX mandy.chung@eng 2001-03-01 1) InterpreterRuntime::exception_handler_for_exception() calls jvmdi::post_exception_catch_event() when an exception is thrown even if it is forwarded to its caller. 2) jvmdi::post_exception_catch_event() removes a frame pop for the method if the exception is not caught by itself but forwarded to its caller. 3) jvmdi::post_method_exit_event() checks if an exception has been thrown but not caught, do not post any method exit event.
11-06-2004

EVALUATION committing to Ladybird mandy.chung@eng 2001-02-26 jvmdi::post_exception_catch_event() handles all exception catch events. It does attempt to remove any pending framepop events with fp < current_frame's fp. However, it is called only when an exception is detected to be caught in the current frame/method. For any exception that is forwarded to its caller and not handled by the current method, the current active frame will be removed first and then forward the exception to its caller frame to handle. When a frame is removed, method_exit event is notified. Since the framepop event for this frame is still pending, a frame pop event will be posted, violating the specification. Similarly, if method_exit event is enabled, method_exit event is also posted unexpectedly. Also, uncover another bug in jvmdi::post_method_exit_event(). METHOD_EXIT event is disabled unexpectedly (METHOD_EXIT is enabled by the agent) when all pending framepop events are notified. It is a bug in post_method_exit_event() that resets method_exit_on flag without checking if METHOD_EXIT is enabled. mandy.chung@eng 2001-03-01 The fix for 4320231 together with the method exit fix fix 4409241.
01-03-2001