> I use git svn instruction for getting the repository.
> it should be no differneces with git svn command.
> Anyway, I will use svn command to redo again.
hi ivo:
after I use svn instead of git svn, I can successfully compile valgrind trunk.
it seems git svn not handle external link ^^

>>> >> I think there is a bug in the massif logic to make a peak detailed
>>> >> snapshot at the moment of munmap: it should try to produce a peak
>>> >> snapshot when releasing the first page of munmap, not when releasing
>>> >> the last page.
>>> > revision 15745 introduces a test for this case, and fixes the bug.
hi Philippe:
I compile the trunk valgrind with ur patch, but I still cannot see the
location of mmap I put in the c file, even I set the --threshold=0.0.
(I attach the c file and mass output as well)
BTW, would you please let me know how to compile and run the programs
in massif/tests?

appreciate all your kind help,
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
void g(void)
      {
	int* test1;
         test1 = malloc(4000);
      }

      void f(void)
      {
	int* test2;
         test2 = malloc(2000);
         g();
      }
int main (int argc, char *argv[])
{
        struct stat sb;
        off_t len;
        char *p;
        int fd;

        if (argc < 2) {
                fprintf (stderr, "usage: %s <file>\n", argv[0]);
                return 1;
        }

        fd = open (argv[1], O_RDONLY);
        if (fd == -1) {
                perror ("open");
                return 1;
        }

        if (fstat (fd, &sb) == -1) {
                perror ("fstat");
                return 1;
        }

        if (!S_ISREG (sb.st_mode)) {
                fprintf (stderr, "%s is not a file\n", argv[1]);
                return 1;
        }
	f();
	g();
        p = mmap (0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
        if (p == MAP_FAILED) {
                perror ("mmap");
                return 1;
        }

        if (close (fd) == -1) {
                perror ("close");
                return 1;
        }
        for (len = 0; len < 128; len++){
                putchar (p[len]);
	}
	printf("\n");
        if (munmap (p, sb.st_size) == -1) {
                perror ("munmap");
                return 1;
        }
	printf("\n");

        return 0;
}

Attachment: mmap_6273
Description: Binary data

------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to