< prev index next >

src/hotspot/os/aix/misc_aix.cpp

Print this page
rev 51015 : 8207342: error occurred during error reporting (printing register info)
Summary: os::print_location misses a check if the pointer is readable.
Reviewed-by:


  32 
  33 void MiscUtils::init_critsect(MiscUtils::critsect_t* cs) {
  34   const int rc = pthread_mutex_init(cs, NULL);
  35   assert0(rc == 0);
  36 }
  37 
  38 void MiscUtils::free_critsect(MiscUtils::critsect_t* cs) {
  39   const int rc = pthread_mutex_destroy(cs);
  40   assert0(rc == 0);
  41 }
  42 
  43 void MiscUtils::enter_critsect(MiscUtils::critsect_t* cs) {
  44   const int rc = pthread_mutex_lock(cs);
  45   assert0(rc == 0);
  46 }
  47 
  48 void MiscUtils::leave_critsect(MiscUtils::critsect_t* cs) {
  49   const int rc = pthread_mutex_unlock(cs);
  50   assert0(rc == 0);
  51 }
  52 
  53 bool MiscUtils::is_readable_pointer(const void* p) {
  54   if (!CanUseSafeFetch32()) {
  55     return true;
  56   }
  57   int* const aligned = (int*) align_down(p, 4);
  58   int cafebabe = 0xcafebabe;
  59   int deadbeef = 0xdeadbeef;
  60   return (SafeFetch32(aligned, cafebabe) != cafebabe) ||
  61          (SafeFetch32(aligned, deadbeef) != deadbeef);
  62 }
  63 
  64 


  32 
  33 void MiscUtils::init_critsect(MiscUtils::critsect_t* cs) {
  34   const int rc = pthread_mutex_init(cs, NULL);
  35   assert0(rc == 0);
  36 }
  37 
  38 void MiscUtils::free_critsect(MiscUtils::critsect_t* cs) {
  39   const int rc = pthread_mutex_destroy(cs);
  40   assert0(rc == 0);
  41 }
  42 
  43 void MiscUtils::enter_critsect(MiscUtils::critsect_t* cs) {
  44   const int rc = pthread_mutex_lock(cs);
  45   assert0(rc == 0);
  46 }
  47 
  48 void MiscUtils::leave_critsect(MiscUtils::critsect_t* cs) {
  49   const int rc = pthread_mutex_unlock(cs);
  50   assert0(rc == 0);
  51 }













< prev index next >