comparison src/os_cpu/linux_x86/vm/os_linux_x86.cpp @ 8763:9ef47379df20

8010144: [parfait] Null pointer deference in hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Summary: add null check to signal handler Reviewed-by: dcubed
author morris
date Sat, 16 Mar 2013 07:41:09 -0700
parents 9058789475af
children b9a918201d47 746b070f5022
comparison
equal deleted inserted replaced
8762:0a2deac0bbfb 8763:9ef47379df20
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