8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace

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
This commit is contained in:
Daniel D. Daugherty 2013-07-04 21:10:17 -07:00
parent 5de65fba93
commit 765f5cd4e7
11 changed files with 351 additions and 232 deletions

View file

@ -507,16 +507,16 @@ class os: AllStatic {
// Symbol lookup, find nearest function name; basically it implements
// dladdr() for all platforms. Name of the nearest function is copied
// to buf. Distance from its base address is returned as offset.
// to buf. Distance from its base address is optionally returned as offset.
// If function name is not found, buf[0] is set to '\0' and offset is
// set to -1.
// set to -1 (if offset is non-NULL).
static bool dll_address_to_function_name(address addr, char* buf,
int buflen, int* offset);
// Locate DLL/DSO. On success, full path of the library is copied to
// buf, and offset is set to be the distance between addr and the
// library's base address. On failure, buf[0] is set to '\0' and
// offset is set to -1.
// buf, and offset is optionally set to be the distance between addr
// and the library's base address. On failure, buf[0] is set to '\0'
// and offset is set to -1 (if offset is non-NULL).
static bool dll_address_to_library_name(address addr, char* buf,
int buflen, int* offset);