338 } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { |
338 } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { |
339 // BugId 4454115: A read from a MappedByteBuffer can fault |
339 // BugId 4454115: A read from a MappedByteBuffer can fault |
340 // here if the underlying file has been truncated. |
340 // here if the underlying file has been truncated. |
341 // Do not crash the VM in such a case. |
341 // Do not crash the VM in such a case. |
342 CodeBlob* cb = CodeCache::find_blob_unsafe(pc); |
342 CodeBlob* cb = CodeCache::find_blob_unsafe(pc); |
343 nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL; |
343 nmethod* nm = (cb != NULL && cb->is_nmethod()) ? (nmethod*)cb : NULL; |
344 if (nm != NULL && nm->has_unsafe_access()) { |
344 if (nm != NULL && nm->has_unsafe_access()) { |
345 stub = StubRoutines::handler_for_unsafe_access(); |
345 stub = StubRoutines::handler_for_unsafe_access(); |
346 } |
346 } |
347 } |
347 } |
348 else |
348 else |