harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r644304 - in /harmony/enhanced/drlvm/trunk/vm: port/src/crash_handler/linux/native_unwind_os.cpp vmcore/src/util/linux/ia32_em64t/signals_common.cpp
Date Thu, 03 Apr 2008 13:22:00 GMT
Author: gshimansky
Date: Thu Apr  3 06:21:51 2008
New Revision: 644304

URL: http://svn.apache.org/viewvc?rev=644304&view=rev
Log:
Applied patch from HARMONY-5683
[drlvm][signals] Crash handler often can't print stack on Linux


Modified:
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp?rev=644304&r1=644303&r2=644304&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp Thu
Apr  3 06:21:51 2008
@@ -16,6 +16,7 @@
  */
 
 
+#include <unistd.h>
 #include <pthread.h>
 #include "port_modules.h"
 #include "native_unwind.h"
@@ -65,6 +66,15 @@
         return false;
 
     pthread_attr_destroy(&pthread_attr);
+
+    if ((size_t)sp < (size_t)seg->base)
+    {
+        size_t page_size = (size_t)sysconf(_SC_PAGE_SIZE);
+        size_t base = (size_t)sp & ~(page_size - 1);
+        seg->size += (size_t)seg->base - base;
+        seg->base = (void*)base;
+    }
+
     return true;
 
 /*    for (native_module_t* module = context->modules; module; module = module->next)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp?rev=644304&r1=644303&r2=644304&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp Thu
Apr  3 06:21:51 2008
@@ -157,7 +157,7 @@
 
     // maps unmapped part of the stack
     res = (char*) mmap(stack_addr - stack_size, stack_mapping_size,
-            PROT_READ | PROT_WRITE, STACK_MMAP_ATTRS, -1, 0);
+            PROT_READ | PROT_WRITE | PROT_EXEC, STACK_MMAP_ATTRS, -1, 0);
 
     // stack should be mapped, checks result
     assert(res == (stack_addr - stack_size));



Mime
View raw message