comparison src/os_cpu/linux_x86/vm/os_linux_x86.cpp @ 20615:ef6b27d844cc

8058715: stability issues when being launched as an embedded JVM via JNI Summary: Use mmap call without MAP_FIXED so we avoid corrupting already allocated memory Reviewed-by: coleenp, dsimms
author dbuck
date Thu, 06 Nov 2014 02:34:01 -0800
parents 78bbf4d43a14
children 7848fc12602b
comparison
equal deleted inserted replaced
20611:3c87c13918fb 20615:ef6b27d844cc
907 * If we are embedded in an app other than launcher (initial != main stack), 907 * If we are embedded in an app other than launcher (initial != main stack),
908 * we don't have much control or understanding of the address space, just let it slide. 908 * we don't have much control or understanding of the address space, just let it slide.
909 */ 909 */
910 char* hint = (char*) (Linux::initial_thread_stack_bottom() - 910 char* hint = (char*) (Linux::initial_thread_stack_bottom() -
911 ((StackYellowPages + StackRedPages + 1) * page_size)); 911 ((StackYellowPages + StackRedPages + 1) * page_size));
912 char* codebuf = os::reserve_memory(page_size, hint); 912 char* codebuf = os::attempt_reserve_memory_at(page_size, hint);
913 if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { 913 if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) {
914 return; // No matter, we tried, best effort. 914 return; // No matter, we tried, best effort.
915 } 915 }
916 if (PrintMiscellaneous && (Verbose || WizardMode)) { 916 if (PrintMiscellaneous && (Verbose || WizardMode)) {
917 tty->print_cr("[CS limit NX emulation work-around, exec code at: %p]", codebuf); 917 tty->print_cr("[CS limit NX emulation work-around, exec code at: %p]", codebuf);