2245 st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10); |
2245 st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10); |
2246 st->cr(); |
2246 st->cr(); |
2247 (void) check_addr0(st); |
2247 (void) check_addr0(st); |
2248 } |
2248 } |
2249 |
2249 |
2250 // Taken from /usr/include/sys/machsig.h Supposed to be architecture specific |
|
2251 // but they're the same for all the solaris architectures that we support. |
|
2252 const char *ill_names[] = { "ILL0", "ILL_ILLOPC", "ILL_ILLOPN", "ILL_ILLADR", |
|
2253 "ILL_ILLTRP", "ILL_PRVOPC", "ILL_PRVREG", |
|
2254 "ILL_COPROC", "ILL_BADSTK" }; |
|
2255 |
|
2256 const char *fpe_names[] = { "FPE0", "FPE_INTDIV", "FPE_INTOVF", "FPE_FLTDIV", |
|
2257 "FPE_FLTOVF", "FPE_FLTUND", "FPE_FLTRES", |
|
2258 "FPE_FLTINV", "FPE_FLTSUB" }; |
|
2259 |
|
2260 const char *segv_names[] = { "SEGV0", "SEGV_MAPERR", "SEGV_ACCERR" }; |
|
2261 |
|
2262 const char *bus_names[] = { "BUS0", "BUS_ADRALN", "BUS_ADRERR", "BUS_OBJERR" }; |
|
2263 |
|
2264 void os::print_siginfo(outputStream* st, void* siginfo) { |
2250 void os::print_siginfo(outputStream* st, void* siginfo) { |
2265 st->print("siginfo:"); |
2251 const siginfo_t* si = (const siginfo_t*)siginfo; |
2266 |
2252 |
2267 const int buflen = 100; |
2253 os::Posix::print_siginfo_brief(st, si); |
2268 char buf[buflen]; |
2254 |
2269 siginfo_t *si = (siginfo_t*)siginfo; |
2255 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && |
2270 st->print("si_signo=%s: ", os::exception_name(si->si_signo, buf, buflen)); |
|
2271 char *err = strerror(si->si_errno); |
|
2272 if (si->si_errno != 0 && err != NULL) { |
|
2273 st->print("si_errno=%s", err); |
|
2274 } else { |
|
2275 st->print("si_errno=%d", si->si_errno); |
|
2276 } |
|
2277 const int c = si->si_code; |
|
2278 assert(c > 0, "unexpected si_code"); |
|
2279 switch (si->si_signo) { |
|
2280 case SIGILL: |
|
2281 st->print(", si_code=%d (%s)", c, c > 8 ? "" : ill_names[c]); |
|
2282 st->print(", si_addr=" PTR_FORMAT, si->si_addr); |
|
2283 break; |
|
2284 case SIGFPE: |
|
2285 st->print(", si_code=%d (%s)", c, c > 9 ? "" : fpe_names[c]); |
|
2286 st->print(", si_addr=" PTR_FORMAT, si->si_addr); |
|
2287 break; |
|
2288 case SIGSEGV: |
|
2289 st->print(", si_code=%d (%s)", c, c > 2 ? "" : segv_names[c]); |
|
2290 st->print(", si_addr=" PTR_FORMAT, si->si_addr); |
|
2291 break; |
|
2292 case SIGBUS: |
|
2293 st->print(", si_code=%d (%s)", c, c > 3 ? "" : bus_names[c]); |
|
2294 st->print(", si_addr=" PTR_FORMAT, si->si_addr); |
|
2295 break; |
|
2296 default: |
|
2297 st->print(", si_code=%d", si->si_code); |
|
2298 // no si_addr |
|
2299 } |
|
2300 |
|
2301 if ((si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && |
|
2302 UseSharedSpaces) { |
2256 UseSharedSpaces) { |
2303 FileMapInfo* mapinfo = FileMapInfo::current_info(); |
2257 FileMapInfo* mapinfo = FileMapInfo::current_info(); |
2304 if (mapinfo->is_in_shared_space(si->si_addr)) { |
2258 if (mapinfo->is_in_shared_space(si->si_addr)) { |
2305 st->print("\n\nError accessing class data sharing archive." \ |
2259 st->print("\n\nError accessing class data sharing archive." \ |
2306 " Mapped file inaccessible during execution, " \ |
2260 " Mapped file inaccessible during execution, " \ |
2366 st->print("SIG_IGN"); |
2320 st->print("SIG_IGN"); |
2367 } else { |
2321 } else { |
2368 st->print("[%s]", get_signal_handler_name(handler, buf, buflen)); |
2322 st->print("[%s]", get_signal_handler_name(handler, buf, buflen)); |
2369 } |
2323 } |
2370 |
2324 |
2371 st->print(", sa_mask[0]=" PTR32_FORMAT, *(uint32_t*)&sa.sa_mask); |
2325 st->print(", sa_mask[0]="); |
|
2326 os::Posix::print_signal_set_short(st, &sa.sa_mask); |
2372 |
2327 |
2373 address rh = VMError::get_resetted_sighandler(sig); |
2328 address rh = VMError::get_resetted_sighandler(sig); |
2374 // May be, handler was resetted by VMError? |
2329 // May be, handler was resetted by VMError? |
2375 if(rh != NULL) { |
2330 if(rh != NULL) { |
2376 handler = rh; |
2331 handler = rh; |
2377 sa.sa_flags = VMError::get_resetted_sigflags(sig); |
2332 sa.sa_flags = VMError::get_resetted_sigflags(sig); |
2378 } |
2333 } |
2379 |
2334 |
2380 st->print(", sa_flags=" PTR32_FORMAT, sa.sa_flags); |
2335 st->print(", sa_flags="); |
|
2336 os::Posix::print_sa_flags(st, sa.sa_flags); |
2381 |
2337 |
2382 // Check: is it our handler? |
2338 // Check: is it our handler? |
2383 if(handler == CAST_FROM_FN_PTR(address, signalHandler) || |
2339 if(handler == CAST_FROM_FN_PTR(address, signalHandler) || |
2384 handler == CAST_FROM_FN_PTR(address, sigINTRHandler)) { |
2340 handler == CAST_FROM_FN_PTR(address, sigINTRHandler)) { |
2385 // It is our signal handler |
2341 // It is our signal handler |