comparison src/share/vm/runtime/os.hpp @ 11092:59b052799158

8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace Summary: Dl_info struct should only be used if dladdr() has returned non-zero (no errors) and always check the dladdr() return value; Dl_info.dli_sname and Dl_info.dli_saddr fields should only be used if non-NULL; update/improve runtime/6888954/vmerrors.sh test Reviewed-by: dsamersoff, zgu, hseigel, coleenp
author dcubed
date Thu, 04 Jul 2013 21:10:17 -0700
parents a837fa3d3f86
children a74ec8831c7b 5e3b6f79d280
comparison
equal deleted inserted replaced
11091:a55aa67bce1a 11092:59b052799158
505 static bool dll_build_name(char* buffer, size_t size, 505 static bool dll_build_name(char* buffer, size_t size,
506 const char* pathname, const char* fname); 506 const char* pathname, const char* fname);
507 507
508 // Symbol lookup, find nearest function name; basically it implements 508 // Symbol lookup, find nearest function name; basically it implements
509 // dladdr() for all platforms. Name of the nearest function is copied 509 // dladdr() for all platforms. Name of the nearest function is copied
510 // to buf. Distance from its base address is returned as offset. 510 // to buf. Distance from its base address is optionally returned as offset.
511 // If function name is not found, buf[0] is set to '\0' and offset is 511 // If function name is not found, buf[0] is set to '\0' and offset is
512 // set to -1. 512 // set to -1 (if offset is non-NULL).
513 static bool dll_address_to_function_name(address addr, char* buf, 513 static bool dll_address_to_function_name(address addr, char* buf,
514 int buflen, int* offset); 514 int buflen, int* offset);
515 515
516 // Locate DLL/DSO. On success, full path of the library is copied to 516 // Locate DLL/DSO. On success, full path of the library is copied to
517 // buf, and offset is set to be the distance between addr and the 517 // buf, and offset is optionally set to be the distance between addr
518 // library's base address. On failure, buf[0] is set to '\0' and 518 // and the library's base address. On failure, buf[0] is set to '\0'
519 // offset is set to -1. 519 // and offset is set to -1 (if offset is non-NULL).
520 static bool dll_address_to_library_name(address addr, char* buf, 520 static bool dll_address_to_library_name(address addr, char* buf,
521 int buflen, int* offset); 521 int buflen, int* offset);
522 522
523 // Find out whether the pc is in the static code for jvm.dll/libjvm.so. 523 // Find out whether the pc is in the static code for jvm.dll/libjvm.so.
524 static bool address_is_in_vm(address addr); 524 static bool address_is_in_vm(address addr);