]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
possible fix for valgrinding problem on longer running kernels (2.4.18-SuSE, update...
authorDirk Mueller <daywalker@users.sourceforge.net>
Mon, 15 Jul 2002 19:39:51 +0000 (19:39 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Mon, 15 Jul 2002 19:39:51 +0000 (19:39 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@506

coregrind/vg_include.h
coregrind/vg_main.c
coregrind/vg_scheduler.c
vg_include.h
vg_main.c
vg_scheduler.c

index 40506c126b0dc2d8542ee6851ad6ade45bab3beb..31ba8e92158e87313a3e50a4592b1936e4210ecb 100644 (file)
@@ -788,10 +788,12 @@ extern Int     VG_(longjmpd_on_signal);
    the initial stack, which we can't move, is allocated here.
    VG_(scheduler_init) checks this.  Andrea Archelangi's 2.4 kernels
    have been rumoured to start stacks at 0x80000000, so that too is
-   considered.  
+   considered. It seems systems with longer uptimes tend to to use
+   stacks which start at 0x40000000 sometimes.  
 */
 #define VG_STARTUP_STACK_BASE_1  (Addr)0xC0000000
 #define VG_STARTUP_STACK_BASE_2  (Addr)0x80000000
+#define VG_STARTUP_STACK_BASE_3  (Addr)0x40000000
 #define VG_STARTUP_STACK_SMALLERTHAN  0x100000 /* 1024k */
 
 #define VG_STACK_MATCHES_BASE(zzstack, zzbase)                 \
index 1095aa5122e17f01c6bc60ce8df343c4a695abb8..95e772c0c12ce548585cde28b51a8969439fb405 100644 (file)
@@ -599,6 +599,11 @@ static void process_cmd_line_options ( void )
        if (VG_STACK_MATCHES_BASE( VG_(esp_at_startup), 
                                   VG_STARTUP_STACK_BASE_2 )) {
           sp = (UInt*)VG_STARTUP_STACK_BASE_2;
+       } else 
+       if (VG_STACK_MATCHES_BASE( VG_(esp_at_startup), 
+                                  VG_STARTUP_STACK_BASE_3 )) {
+          sp = (UInt*)VG_STARTUP_STACK_BASE_3;
        } else {
           args_grok_error(
              "startup %esp is not near any VG_STARTUP_STACK_BASE_*\n   "
index 12024e0599b7e656cdb471b02237d62f0d61fd0b..823c85908deee18865c738a625150e36dd3a1fbd 100644 (file)
@@ -565,13 +565,15 @@ void VG_(scheduler_init) ( void )
    startup_esp = VG_(baseBlock)[VGOFF_(m_esp)];
 
    if (VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_1)
-       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_2)) {
+       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_2) 
+       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_3)) {
       /* Jolly good! */
    } else {
-      VG_(printf)("%%esp at startup = %p is not near %p or %p; aborting\n", 
+      VG_(printf)("%%esp at startup = %p is not near %p, %p or %p; aborting\n", 
                   (void*)startup_esp, 
                   (void*)VG_STARTUP_STACK_BASE_1,
-                  (void*)VG_STARTUP_STACK_BASE_2 );
+                  (void*)VG_STARTUP_STACK_BASE_2,
+                  (void*)VG_STARTUP_STACK_BASE_3 );
       VG_(panic)("unexpected %esp at startup");
    }
 
index 40506c126b0dc2d8542ee6851ad6ade45bab3beb..31ba8e92158e87313a3e50a4592b1936e4210ecb 100644 (file)
@@ -788,10 +788,12 @@ extern Int     VG_(longjmpd_on_signal);
    the initial stack, which we can't move, is allocated here.
    VG_(scheduler_init) checks this.  Andrea Archelangi's 2.4 kernels
    have been rumoured to start stacks at 0x80000000, so that too is
-   considered.  
+   considered. It seems systems with longer uptimes tend to to use
+   stacks which start at 0x40000000 sometimes.  
 */
 #define VG_STARTUP_STACK_BASE_1  (Addr)0xC0000000
 #define VG_STARTUP_STACK_BASE_2  (Addr)0x80000000
+#define VG_STARTUP_STACK_BASE_3  (Addr)0x40000000
 #define VG_STARTUP_STACK_SMALLERTHAN  0x100000 /* 1024k */
 
 #define VG_STACK_MATCHES_BASE(zzstack, zzbase)                 \
index 1095aa5122e17f01c6bc60ce8df343c4a695abb8..95e772c0c12ce548585cde28b51a8969439fb405 100644 (file)
--- a/vg_main.c
+++ b/vg_main.c
@@ -599,6 +599,11 @@ static void process_cmd_line_options ( void )
        if (VG_STACK_MATCHES_BASE( VG_(esp_at_startup), 
                                   VG_STARTUP_STACK_BASE_2 )) {
           sp = (UInt*)VG_STARTUP_STACK_BASE_2;
+       } else 
+       if (VG_STACK_MATCHES_BASE( VG_(esp_at_startup), 
+                                  VG_STARTUP_STACK_BASE_3 )) {
+          sp = (UInt*)VG_STARTUP_STACK_BASE_3;
        } else {
           args_grok_error(
              "startup %esp is not near any VG_STARTUP_STACK_BASE_*\n   "
index 12024e0599b7e656cdb471b02237d62f0d61fd0b..823c85908deee18865c738a625150e36dd3a1fbd 100644 (file)
@@ -565,13 +565,15 @@ void VG_(scheduler_init) ( void )
    startup_esp = VG_(baseBlock)[VGOFF_(m_esp)];
 
    if (VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_1)
-       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_2)) {
+       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_2) 
+       || VG_STACK_MATCHES_BASE(startup_esp, VG_STARTUP_STACK_BASE_3)) {
       /* Jolly good! */
    } else {
-      VG_(printf)("%%esp at startup = %p is not near %p or %p; aborting\n", 
+      VG_(printf)("%%esp at startup = %p is not near %p, %p or %p; aborting\n", 
                   (void*)startup_esp, 
                   (void*)VG_STARTUP_STACK_BASE_1,
-                  (void*)VG_STARTUP_STACK_BASE_2 );
+                  (void*)VG_STARTUP_STACK_BASE_2,
+                  (void*)VG_STARTUP_STACK_BASE_3 );
       VG_(panic)("unexpected %esp at startup");
    }