mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Make a copy of the vdso bytes to make valgrind a little quieter.
2007-03-02 Soren Sandmann <sandmann@daimi.au.dk> * process.c (process_get_vdso_bytes): Make a copy of the vdso bytes to make valgrind a little quieter. * binparser.c: Note to self: Save the file, *then* commit. svn path=/trunk/; revision=357
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
5ee13adc34
commit
aaa145ea9b
13
process.c
13
process.c
@ -175,8 +175,19 @@ process_get_vdso_bytes (gsize *length)
|
||||
|
||||
if (strcmp (map->filename, "[vdso]") == 0)
|
||||
{
|
||||
bytes = (guint8 *)map->start;
|
||||
n_bytes = map->end - map->start;
|
||||
|
||||
/* Dup the memory here so that valgrind will only
|
||||
* report one 1 byte invalid read instead of
|
||||
* a ton when the elf parser scans the vdso
|
||||
*
|
||||
* The reason we get a spurious invalid read from
|
||||
* valgrind is that we are getting the address directly
|
||||
* from /proc/maps, and valgrind knows that its mmap()
|
||||
* wrapper never returned that address. But since it
|
||||
* is a legal mapping, it is legal to read it.
|
||||
*/
|
||||
bytes = g_memdup ((guint8 *)map->start, n_bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user