< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47292 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.


1818   }
1819   return result;
1820 }
1821 
1822 void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf,
1823                                        int ebuflen) {
1824   void * result = NULL;
1825   if (LoadExecStackDllInVMThread) {
1826     result = dlopen_helper(filename, ebuf, ebuflen);
1827   }
1828 
1829   // Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
1830   // library that requires an executable stack, or which does not have this
1831   // stack attribute set, dlopen changes the stack attribute to executable. The
1832   // read protection of the guard pages gets lost.
1833   //
1834   // Need to check _stack_is_executable again as multiple VM_LinuxDllLoad
1835   // may have been queued at the same time.
1836 
1837   if (!_stack_is_executable) {
1838     ThreadsListHandle tlh;
1839     JavaThreadIterator jti(tlh.list());
1840     for (JavaThread *jt = jti.first(); jt != NULL; jt = jti.next()) {
1841       if (!jt->stack_guard_zone_unused() &&     // Stack not yet fully initialized
1842           jt->stack_guards_enabled()) {         // No pending stack overflow exceptions
1843         if (!os::guard_memory((char *)jt->stack_end(), jt->stack_guard_zone_size())) {
1844           warning("Attempt to reguard stack yellow zone failed.");
1845         }
1846       }
1847     }
1848   }
1849 
1850   return result;
1851 }
1852 
1853 void* os::dll_lookup(void* handle, const char* name) {
1854   void* res = dlsym(handle, name);
1855   return res;
1856 }
1857 
1858 void* os::get_default_process_handle() {
1859   return (void*)::dlopen(NULL, RTLD_LAZY);
1860 }




1818   }
1819   return result;
1820 }
1821 
1822 void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf,
1823                                        int ebuflen) {
1824   void * result = NULL;
1825   if (LoadExecStackDllInVMThread) {
1826     result = dlopen_helper(filename, ebuf, ebuflen);
1827   }
1828 
1829   // Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
1830   // library that requires an executable stack, or which does not have this
1831   // stack attribute set, dlopen changes the stack attribute to executable. The
1832   // read protection of the guard pages gets lost.
1833   //
1834   // Need to check _stack_is_executable again as multiple VM_LinuxDllLoad
1835   // may have been queued at the same time.
1836 
1837   if (!_stack_is_executable) {
1838     for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {


1839       if (!jt->stack_guard_zone_unused() &&     // Stack not yet fully initialized
1840           jt->stack_guards_enabled()) {         // No pending stack overflow exceptions
1841         if (!os::guard_memory((char *)jt->stack_end(), jt->stack_guard_zone_size())) {
1842           warning("Attempt to reguard stack yellow zone failed.");
1843         }
1844       }
1845     }
1846   }
1847 
1848   return result;
1849 }
1850 
1851 void* os::dll_lookup(void* handle, const char* name) {
1852   void* res = dlsym(handle, name);
1853   return res;
1854 }
1855 
1856 void* os::get_default_process_handle() {
1857   return (void*)::dlopen(NULL, RTLD_LAZY);
1858 }


< prev index next >