[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR (M) 8224079: ExceptionJniWrapper for the Strace test suite
From:       Chris Plummer <chris.plummer () oracle ! com>
Date:       2019-05-17 18:43:48
Message-ID: 6768087b-cf5f-9a11-0954-c3aa16c9373b () oracle ! com
[Download RAW message or body]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi JC,<br>
      <br>
      I guess this code is a bit different in that it expects to see
      some errors and has code to specifically deal with them. What is  
      your plan on updating the callers of this method:<br>
      <br>
                                     case ThreadController.NATIVE_TYPE:<br>
                                             result = recursionNative(depth, 0, false);<br>
      <br>
                                             if (result == 1) {<br>
                                                     log.display("Fatal error (OutOfMemoryError
      or "<br>
                                                                     + "StackOverflow) is thrown in
      native method of "<br>
                                                                     + " thread " + num);<br>
                                                     return;<br>
                                             } else if (result == 2) {<br>
                                                     log.complain("Unexpected exception is
      thrown in native "<br>
                                                                     + "method of thread " + num);<br>
                                                     strace001.testFailed = true;<br>
                                                     return;<br>
                                             }<br>
                                             break;<br>
      <br>
      Won't your changes result in the exception being propagated rather
      then returning a 1 or a 2?<br>
      <br>
      Chris<br>
      <br>
      On 5/16/19 3:56 PM, Jean Christophe Beyler wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAF9BGBzV_z8b9w_ebQX869NCUvM9YpQSDa_5Ypw2LgOSua2xQw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">Hi all,
            <div><br>
            </div>
            <div>I was wanting to continue on deploying the
              ExceptionJniWrapper and the first on the list was this one
              C++ file. It is used by various Strace tests and I thought
              I'd stop at just this one to make it easier for reviewing.</div>
            <div><br>
            </div>
            <div>Webrev:  <a
                href="http://cr.openjdk.java.net/%7Ejcbeyler/8224079/webrev.00/"
                moz-do-not-send="true">http://cr.openjdk.java.net/~jcbeyler/8224079/webrev.00/</a></div>
            <div>Bug:  <a
                href="https://bugs.openjdk.java.net/browse/JDK-8224079"
                moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8224079</a></div>
            <div><br>
            </div>
            <div>The biggest thing to note is that the error messages
              change a bit, originally if the native code noticed a
              problem it would return either 1 or 2, providing a message
              in Java land:</div>
            <div>
              <div><br>
              </div>
              <div>      a return of 1 would provide a message containing
                (OutOfMemoryError or StackOverflow)  </div>
              <div>      a return of 2 would provide a generic message
                such as   Unexpected exception...</div>
              <div><br>
              </div>
              <div>Now 1 would give just a generic internal error but it
                would be with a message such as:</div>
              <div>
                <div>FATAL ERROR in native method: JNI method
                  CallIntMethod : internal error from
                  StackTraceController.cpp : 48</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
                <div><span style="white-space:pre">	</span>at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)</div>
                <div><span style="white-space:pre">	</span>at
                  nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
                  Method)</div>
              </div>
              <div>....</div>
              <div><br>
              </div>
              <div>and you would guess it is either an OOM or a  stack
                overflow. And 2 actually now gives you which method
                failed. So it's a win for the 2 case, for the 1 there is
                an extra step that, for me, seemed relatively straight
                forward.</div>
              <div><br>
              </div>
              <div>I can change the code slightly for the 1 case to make
                the error message more specific and closer to the
                original but I was not sure it was worth it.... What do
                you all think?</div>
              <div><br>
              </div>
              <div dir="ltr" class="gmail_signature">
                <div dir="ltr">
                  <div>Thanks for your help,<br>
                  </div>
                  <div>Jc</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic