< prev index next >

src/share/vm/utilities/vmError.cpp

Print this page
rev 8910 : full patch for jfr
   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 922 
 923     // first time
 924     first_error_tid = mytid;
 925     set_error_reported();
 926 
 927     if (ShowMessageBoxOnError || PauseAtExit) {
 928       show_message_box(buffer, sizeof(buffer));
 929 
 930       // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
 931       // WatcherThread can kill JVM if the error handler hangs.
 932       ShowMessageBoxOnError = false;
 933     }
 934 
 935     // Write a minidump on Windows, check core dump limits on Linux/Solaris
 936     os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer));
 937 
 938     // reset signal handlers or exception filter; make sure recursive crashes
 939     // are handled properly.
 940     reset_signal_handlers();
 941 








 942   } else {
 943     // If UseOsErrorReporting we call this for each level of the call stack
 944     // while searching for the exception handler.  Only the first level needs
 945     // to be reported.
 946     if (UseOSErrorReporting && log_done) return;
 947 
 948     // This is not the first error, see if it happened in a different thread
 949     // or in the same thread during error reporting.
 950     if (first_error_tid != mytid) {
 951       char msgbuf[64];
 952       jio_snprintf(msgbuf, sizeof(msgbuf),
 953                    "[thread " INT64_FORMAT " also had an error]",
 954                    mytid);
 955       out.print_raw_cr(msgbuf);
 956 
 957       // error reporting is not MT-safe, block current thread
 958       os::infinite_sleep();
 959 
 960     } else {
 961       if (recursive_error_count++ > 30) {


   1 /*
   2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 922 
 923     // first time
 924     first_error_tid = mytid;
 925     set_error_reported();
 926 
 927     if (ShowMessageBoxOnError || PauseAtExit) {
 928       show_message_box(buffer, sizeof(buffer));
 929 
 930       // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
 931       // WatcherThread can kill JVM if the error handler hangs.
 932       ShowMessageBoxOnError = false;
 933     }
 934 
 935     // Write a minidump on Windows, check core dump limits on Linux/Solaris
 936     os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer));
 937 
 938     // reset signal handlers or exception filter; make sure recursive crashes
 939     // are handled properly.
 940     reset_signal_handlers();
 941 
 942     EventShutdown e;
 943     if (e.should_commit()) {
 944       e.set_reason("VM Error");
 945       e.commit();
 946     }
 947 
 948     TRACE_VM_ERROR();
 949 
 950   } else {
 951     // If UseOsErrorReporting we call this for each level of the call stack
 952     // while searching for the exception handler.  Only the first level needs
 953     // to be reported.
 954     if (UseOSErrorReporting && log_done) return;
 955 
 956     // This is not the first error, see if it happened in a different thread
 957     // or in the same thread during error reporting.
 958     if (first_error_tid != mytid) {
 959       char msgbuf[64];
 960       jio_snprintf(msgbuf, sizeof(msgbuf),
 961                    "[thread " INT64_FORMAT " also had an error]",
 962                    mytid);
 963       out.print_raw_cr(msgbuf);
 964 
 965       // error reporting is not MT-safe, block current thread
 966       os::infinite_sleep();
 967 
 968     } else {
 969       if (recursive_error_count++ > 30) {


< prev index next >