< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page




1368 
1369       // Timeout handling.
1370       if (_step_did_timeout) {
1371         // The current step had a timeout. Lets continue reporting with the next step.
1372         st->print_raw("[timeout occurred during error reporting in step \"");
1373         st->print_raw(_current_step_info);
1374         st->print_cr("\"] after " INT64_FORMAT " s.",
1375                      (int64_t)
1376                      ((get_current_timestamp() - _step_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
1377       } else if (_reporting_did_timeout) {
1378         // We hit ErrorLogTimeout. Reporting will stop altogether. Let's wrap things
1379         // up, the process is about to be stopped by the WatcherThread.
1380         st->print_cr("------ Timeout during error reporting after " INT64_FORMAT " s. ------",
1381                      (int64_t)
1382                      ((get_current_timestamp() - _reporting_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
1383         st->flush();
1384         // Watcherthread is about to call os::die. Lets just wait.
1385         os::infinite_sleep();
1386       } else {
1387         // Crash or assert during error reporting. Lets continue reporting with the next step.
1388         jio_snprintf(buffer, sizeof(buffer),
1389            "[error occurred during error reporting (%s), id 0x%x]",
1390                    _current_step_info, _id);















1391         st->print_raw_cr(buffer);
1392         st->cr();
1393       }
1394     }
1395   }
1396 
1397   // print to screen
1398   if (!out_done) {
1399     report(&out, false);
1400 
1401     out_done = true;
1402 
1403     _current_step = 0;
1404     _current_step_info = "";
1405   }
1406 
1407   // print to error log file
1408   if (!log_done) {
1409     // see if log file is already open
1410     if (!log.is_open()) {




1368 
1369       // Timeout handling.
1370       if (_step_did_timeout) {
1371         // The current step had a timeout. Lets continue reporting with the next step.
1372         st->print_raw("[timeout occurred during error reporting in step \"");
1373         st->print_raw(_current_step_info);
1374         st->print_cr("\"] after " INT64_FORMAT " s.",
1375                      (int64_t)
1376                      ((get_current_timestamp() - _step_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
1377       } else if (_reporting_did_timeout) {
1378         // We hit ErrorLogTimeout. Reporting will stop altogether. Let's wrap things
1379         // up, the process is about to be stopped by the WatcherThread.
1380         st->print_cr("------ Timeout during error reporting after " INT64_FORMAT " s. ------",
1381                      (int64_t)
1382                      ((get_current_timestamp() - _reporting_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
1383         st->flush();
1384         // Watcherthread is about to call os::die. Lets just wait.
1385         os::infinite_sleep();
1386       } else {
1387         // Crash or assert during error reporting. Lets continue reporting with the next step.
1388         stringStream ss(buffer, sizeof(buffer));
1389         // Note: this string does get parsed by a number of jtreg tests,
1390         // see hotspot/jtreg/runtime/ErrorHandling.
1391         ss.print("[error occurred during error reporting (%s), id 0x%x",
1392                    _current_step_info, id);
1393         char signal_name[64];
1394         if (os::exception_name(id, signal_name, sizeof(signal_name))) {
1395           ss.print(", %s (0x%x) at pc=" PTR_FORMAT, signal_name, id, p2i(pc));
1396         } else {
1397           if (should_report_bug(id)) {
1398             ss.print(", Internal Error (%s:%d)",
1399               filename == NULL ? "??" : filename, lineno);
1400           } else {
1401             ss.print(", Out of Memory Error (%s:%d)",
1402               filename == NULL ? "??" : filename, lineno);
1403           }
1404         }
1405         ss.print("]");
1406         st->print_raw_cr(buffer);
1407         st->cr();
1408       }
1409     }
1410   }
1411 
1412   // print to screen
1413   if (!out_done) {
1414     report(&out, false);
1415 
1416     out_done = true;
1417 
1418     _current_step = 0;
1419     _current_step_info = "";
1420   }
1421 
1422   // print to error log file
1423   if (!log_done) {
1424     // see if log file is already open
1425     if (!log.is_open()) {


< prev index next >