1310 void VMError::report_and_die(Thread* thread, const char* filename, int lineno, size_t size,
1311 VMErrorType vm_err_type, const char* detail_fmt, va_list detail_args) {
1312 report_and_die(vm_err_type, NULL, detail_fmt, detail_args, thread, NULL, NULL, NULL, filename, lineno, size);
1313 }
1314
1315 void VMError::report_and_die(int id, const char* message, const char* detail_fmt, va_list detail_args,
1316 Thread* thread, address pc, void* siginfo, void* context, const char* filename,
1317 int lineno, size_t size)
1318 {
1319 // A single scratch buffer to be used from here on.
1320 // Do not rely on it being preserved across function calls.
1321 static char buffer[O_BUFLEN];
1322
1323 // File descriptor to tty to print an error summary to.
1324 // Hard wired to stdout; see JDK-8215004 (compatibility concerns).
1325 static const int fd_out = 1; // stdout
1326
1327 // File descriptor to the error log file.
1328 static int fd_log = -1;
1329
1330 // Use local fdStream objects only. Do not use global instances whose initialization
1331 // relies on dynamic initialization (see JDK-8214975). Do not rely on these instances
1332 // to carry over into recursions or invocations from other threads.
1333 fdStream out(fd_out);
1334 out.set_scratch_buffer(buffer, sizeof(buffer));
1335
1336 // Depending on the re-entrance depth at this point, fd_log may be -1 or point to an open hs-err file.
1337 fdStream log(fd_log);
1338 log.set_scratch_buffer(buffer, sizeof(buffer));
1339
1340 // How many errors occurred in error handler when reporting first_error.
1341 static int recursive_error_count;
1342
1343 // We will first print a brief message to standard out (verbose = false),
1344 // then save detailed information in log file (verbose = true).
1345 static bool out_done = false; // done printing to standard out
1346 static bool log_done = false; // done saving error log
1347
1348 if (SuppressFatalErrorMessage) {
1349 os::abort(CreateCoredumpOnCrash);
|
1310 void VMError::report_and_die(Thread* thread, const char* filename, int lineno, size_t size,
1311 VMErrorType vm_err_type, const char* detail_fmt, va_list detail_args) {
1312 report_and_die(vm_err_type, NULL, detail_fmt, detail_args, thread, NULL, NULL, NULL, filename, lineno, size);
1313 }
1314
1315 void VMError::report_and_die(int id, const char* message, const char* detail_fmt, va_list detail_args,
1316 Thread* thread, address pc, void* siginfo, void* context, const char* filename,
1317 int lineno, size_t size)
1318 {
1319 // A single scratch buffer to be used from here on.
1320 // Do not rely on it being preserved across function calls.
1321 static char buffer[O_BUFLEN];
1322
1323 // File descriptor to tty to print an error summary to.
1324 // Hard wired to stdout; see JDK-8215004 (compatibility concerns).
1325 static const int fd_out = 1; // stdout
1326
1327 // File descriptor to the error log file.
1328 static int fd_log = -1;
1329
1330 // Disarm assertion poison page, since from this point on we do not need this mechanism anymore and it may
1331 // cause problems in error handling during native OOM, see JDK-8227275.
1332 disarm_assert_poison();
1333
1334 // Use local fdStream objects only. Do not use global instances whose initialization
1335 // relies on dynamic initialization (see JDK-8214975). Do not rely on these instances
1336 // to carry over into recursions or invocations from other threads.
1337 fdStream out(fd_out);
1338 out.set_scratch_buffer(buffer, sizeof(buffer));
1339
1340 // Depending on the re-entrance depth at this point, fd_log may be -1 or point to an open hs-err file.
1341 fdStream log(fd_log);
1342 log.set_scratch_buffer(buffer, sizeof(buffer));
1343
1344 // How many errors occurred in error handler when reporting first_error.
1345 static int recursive_error_count;
1346
1347 // We will first print a brief message to standard out (verbose = false),
1348 // then save detailed information in log file (verbose = true).
1349 static bool out_done = false; // done printing to standard out
1350 static bool log_done = false; // done saving error log
1351
1352 if (SuppressFatalErrorMessage) {
1353 os::abort(CreateCoredumpOnCrash);
|