Mercurial > hg > truffle
comparison src/os/solaris/vm/os_solaris.cpp @ 14460:8a9bb7821e28
Merge
author | kvn |
---|---|
date | Wed, 19 Feb 2014 12:08:49 -0800 |
parents | 2c2a99f6cf83 2b8e28fdf503 |
children | bb9356ec5967 |
comparison
equal
deleted
inserted
replaced
14360:e8ef156f0bc9 | 14460:8a9bb7821e28 |
---|---|
2249 st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10); | 2249 st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10); |
2250 st->cr(); | 2250 st->cr(); |
2251 (void) check_addr0(st); | 2251 (void) check_addr0(st); |
2252 } | 2252 } |
2253 | 2253 |
2254 // Taken from /usr/include/sys/machsig.h Supposed to be architecture specific | |
2255 // but they're the same for all the solaris architectures that we support. | |
2256 const char *ill_names[] = { "ILL0", "ILL_ILLOPC", "ILL_ILLOPN", "ILL_ILLADR", | |
2257 "ILL_ILLTRP", "ILL_PRVOPC", "ILL_PRVREG", | |
2258 "ILL_COPROC", "ILL_BADSTK" }; | |
2259 | |
2260 const size_t ill_names_length = (sizeof(ill_names)/sizeof(char *)); | |
2261 | |
2262 const char *fpe_names[] = { "FPE0", "FPE_INTDIV", "FPE_INTOVF", "FPE_FLTDIV", | |
2263 "FPE_FLTOVF", "FPE_FLTUND", "FPE_FLTRES", | |
2264 "FPE_FLTINV", "FPE_FLTSUB" }; | |
2265 const size_t fpe_names_length = (sizeof(fpe_names)/sizeof(char *)); | |
2266 | |
2267 const char *segv_names[] = { "SEGV0", "SEGV_MAPERR", "SEGV_ACCERR" }; | |
2268 const size_t segv_names_length = (sizeof(segv_names)/sizeof(char *)); | |
2269 | |
2270 const char *bus_names[] = { "BUS0", "BUS_ADRALN", "BUS_ADRERR", "BUS_OBJERR" }; | |
2271 const size_t bus_names_length = (sizeof(bus_names)/sizeof(char *)); | |
2272 | |
2273 void os::print_siginfo(outputStream* st, void* siginfo) { | 2254 void os::print_siginfo(outputStream* st, void* siginfo) { |
2274 st->print("siginfo:"); | 2255 const siginfo_t* si = (const siginfo_t*)siginfo; |
2275 | 2256 |
2276 const int buflen = 100; | 2257 os::Posix::print_siginfo_brief(st, si); |
2277 char buf[buflen]; | 2258 |
2278 siginfo_t *si = (siginfo_t*)siginfo; | 2259 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && |
2279 st->print("si_signo=%s: ", os::exception_name(si->si_signo, buf, buflen)); | |
2280 char *err = strerror(si->si_errno); | |
2281 if (si->si_errno != 0 && err != NULL) { | |
2282 st->print("si_errno=%s", err); | |
2283 } else { | |
2284 st->print("si_errno=%d", si->si_errno); | |
2285 } | |
2286 const int c = si->si_code; | |
2287 assert(c > 0, "unexpected si_code"); | |
2288 switch (si->si_signo) { | |
2289 case SIGILL: | |
2290 st->print(", si_code=%d (%s)", c, | |
2291 c >= ill_names_length ? "" : ill_names[c]); | |
2292 st->print(", si_addr=" PTR_FORMAT, si->si_addr); | |
2293 break; | |
2294 case SIGFPE: | |
2295 st->print(", si_code=%d (%s)", c, | |
2296 c >= fpe_names_length ? "" : fpe_names[c]); | |
2297 st->print(", si_addr=" PTR_FORMAT, si->si_addr); | |
2298 break; | |
2299 case SIGSEGV: | |
2300 st->print(", si_code=%d (%s)", c, | |
2301 c >= segv_names_length ? "" : segv_names[c]); | |
2302 st->print(", si_addr=" PTR_FORMAT, si->si_addr); | |
2303 break; | |
2304 case SIGBUS: | |
2305 st->print(", si_code=%d (%s)", c, | |
2306 c >= bus_names_length ? "" : bus_names[c]); | |
2307 st->print(", si_addr=" PTR_FORMAT, si->si_addr); | |
2308 break; | |
2309 default: | |
2310 st->print(", si_code=%d", si->si_code); | |
2311 // no si_addr | |
2312 } | |
2313 | |
2314 if ((si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && | |
2315 UseSharedSpaces) { | 2260 UseSharedSpaces) { |
2316 FileMapInfo* mapinfo = FileMapInfo::current_info(); | 2261 FileMapInfo* mapinfo = FileMapInfo::current_info(); |
2317 if (mapinfo->is_in_shared_space(si->si_addr)) { | 2262 if (mapinfo->is_in_shared_space(si->si_addr)) { |
2318 st->print("\n\nError accessing class data sharing archive." \ | 2263 st->print("\n\nError accessing class data sharing archive." \ |
2319 " Mapped file inaccessible during execution, " \ | 2264 " Mapped file inaccessible during execution, " \ |
2379 st->print("SIG_IGN"); | 2324 st->print("SIG_IGN"); |
2380 } else { | 2325 } else { |
2381 st->print("[%s]", get_signal_handler_name(handler, buf, buflen)); | 2326 st->print("[%s]", get_signal_handler_name(handler, buf, buflen)); |
2382 } | 2327 } |
2383 | 2328 |
2384 st->print(", sa_mask[0]=" PTR32_FORMAT, *(uint32_t*)&sa.sa_mask); | 2329 st->print(", sa_mask[0]="); |
2330 os::Posix::print_signal_set_short(st, &sa.sa_mask); | |
2385 | 2331 |
2386 address rh = VMError::get_resetted_sighandler(sig); | 2332 address rh = VMError::get_resetted_sighandler(sig); |
2387 // May be, handler was resetted by VMError? | 2333 // May be, handler was resetted by VMError? |
2388 if(rh != NULL) { | 2334 if(rh != NULL) { |
2389 handler = rh; | 2335 handler = rh; |
2390 sa.sa_flags = VMError::get_resetted_sigflags(sig); | 2336 sa.sa_flags = VMError::get_resetted_sigflags(sig); |
2391 } | 2337 } |
2392 | 2338 |
2393 st->print(", sa_flags=" PTR32_FORMAT, sa.sa_flags); | 2339 st->print(", sa_flags="); |
2340 os::Posix::print_sa_flags(st, sa.sa_flags); | |
2394 | 2341 |
2395 // Check: is it our handler? | 2342 // Check: is it our handler? |
2396 if(handler == CAST_FROM_FN_PTR(address, signalHandler) || | 2343 if(handler == CAST_FROM_FN_PTR(address, signalHandler) || |
2397 handler == CAST_FROM_FN_PTR(address, sigINTRHandler)) { | 2344 handler == CAST_FROM_FN_PTR(address, sigINTRHandler)) { |
2398 // It is our signal handler | 2345 // It is our signal handler |