]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
This was segfaulting on ppc64-linux, even natively. These changes
authorJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:50:48 +0000 (03:50 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:50:48 +0000 (03:50 +0000)
stop it doing that.  Am not convinced this is a good fix -- I don't
really understand how this program works.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5557

memcheck/tests/stack_switch.c

index 03e86cc3e248f5c4afcacc0f9c35f98b2b486221..290bbb14d79be680ab3addb77030bb490607bbb4 100644 (file)
@@ -24,6 +24,7 @@ static int thread_main(void *arg)
 
    memset( buffer, 1, sizeof( buffer ) );
 
+   sleep(2); /* ppc64-linux hack */
    return memchr( buffer, 1, sizeof( buffer ) ) == NULL;
 }
 
@@ -33,7 +34,8 @@ int main(int argc, char **argv)
    int stackid;
    pid_t pid;
 
-   if ( ( stack = mmap( NULL, STACK_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 ) ) == MAP_FAILED )
+   /* "2*" is a ppc64-linux hack */
+   if ( ( stack = mmap( NULL, 2* STACK_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 ) ) == MAP_FAILED )
    {
       perror( "mmap" );
       exit( 1 );