Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4514252

thrown exception can erase self-suspend request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • vm-legacy
    • None
    • rc1
    • generic
    • generic
    • Verified



        Name: dd4877 Date: 10/12/2001


        daniel.daugherty@Sun 2001-10-12

        While working on the following bug:

        4510838 3/2 self-suspend race with GetCallTrace

        I ran into a case where an external suspend request was made while
        a thread was in state _thread_in_Java. The thread was marked for
        external suspension:

            _external_suspend field was set to true
            _special_runtime_exit_condition was set to _async_suspend

        However, the thread threw an exception at that point resulting
        in the following calls:

          [10] JavaThread::handle_special_runtime_exit_condition(this = 0x3dfb0), line 1
        468 in "thread.cpp"
          [11] ThreadInVMfromJava::~ThreadInVMfromJava(this = 0xffbee304), line 125 in "
        interfaceSupport.hpp"
          [12] Runtime1::throw_div0_exception(thread = 0x3dfb0), line 906 in "c1_Runtime
        1.cpp"
          [13] 0xf9c9f5c8(0xffbee3d4, 0xf1fccc70, 0x3dfb0, 0x1, 0x3dfb0, 0x0), at 0xf9c9
        f5c7

        Because of the pending exception, handle_special_runtime_exit_condition()
        erased the _async_suspend value and did not do the self-suspension. At
        this point, there is still a pending external suspension, but no means
        to get it done. The _external_suspend flag is still set, but the
        _special_runtime_exit_condition field is now _no_async_condition.

        If the thread that called SuspendThread() was waiting for the suspend
        to complete, then it would have to wait an internal suspend (e.g.,
        from a safepoint) to come along and finish the job.

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

              dcubed Daniel Daugherty
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: