diff 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
line wrap: on
line diff
--- a/src/share/vm/runtime/os.hpp	Thu Jul 04 04:03:28 2013 -0700
+++ b/src/share/vm/runtime/os.hpp	Thu Jul 04 21:10:17 2013 -0700
@@ -507,16 +507,16 @@
 
   // 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);