Re: [Valgrind-users] Why valgrind tool massif does not print xtree callstack? (arm)

2020-12-22 Thread Łukasz Bolda
>> What does memcheck give if you use --xtree-memory=full ?

It found some errors for example:

1 errors in context 1 of 12:
Invalid read of size 4
At 0x48F2064: CORBA::Stream::~Stream() (in /usr/lib/libOErb.so)
 Address 0x4fc0748 is 0 bytes inside a block of size 12 free'd
At 0x4848314: operator delete(void*) (in 
/home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/vgpreload_memcheck-arm-linux.so)
 Block was alloc'd at
At 0x4847154: operator new(unsigned in, std::nothrow_t const&) (in 
/home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/vgpreload_memcheck-arm-linux.so)

Rest of errors are verry similar.

>> Can you try the same gdb+vgdb+ break malloc experiment using --tool=none ?

(gdb) monitor v.info scheduler

Host stacktrace:
==2445== at 0x58031810: ??? (in 
/home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/none-arm-linux)

sched status:
running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 2445)
==2445==at 0x41D46: service_main(int, char const**, bool) 
(serviceMain.cpp:22)
==2445==by 0x41D1F: main (serviceMain.cpp:17)
client stack range: [0x7DE5C000 0xDE5DFFF] client SP: 0x7DE5D708
valgrind stack range: [0x41EBD00 0x41FBCFF] top usage: 25472 of 1048576

(gdb)


Best regards,
Łukasz Bolda

-Original Message-
From: Philippe Waroquiers  
Sent: Monday, December 14, 2020 9:23 PM
To: Łukasz Bolda ; 
valgrind-users@lists.sourceforge.net
Subject: Re: [Valgrind-users] Why valgrind tool massif does not print xtree 
callstack? (arm)

Strange ... 'v.info scheduler' shows that valgrind can compute a correct guest 
stack trace, but the output file is not correct.

It looks like with gdb+vgdb, you cannot put a breakpoint on a redirected 
function:
 valgrind/massif redirects malloc function to its own implementation, and so  
the breakpoint is not reached (at least for me, on amd64 platform).

Also, the host stack trace is empty in the below 'v.info scheduler' output.


Does memcheck give the same unexpected behaviour for its (leak) reports ?

What does memcheck give if you use --xtree-memory=full ?

Can you try the same gdb+vgdb+ break malloc experiment using --tool=none ?

Thanks

Philippe



On Mon, 2020-12-14 at 10:26 +0100, Łukasz Bolda wrote:
> I'm using valgrind 3.14.0 from 
> http://ftp.debian.org/debian/pool/main/v/valgrind/
> Cause it's stable version.
> 
> I did not compile this application.
> 
> Right now i'm trying latest valgrind 3.16.1 and it changed from this:
> 99.87% (20,675,133B) (heap allocation functions) malloc/new/new[], 
> --alloc-fns, etc.
> ->99.87% (20,675,133B) 0x: ???
> 
> to this (different app, but the only change is from 0x to 0x0):
> 99.82% (46,610B) (heap allocation functions) malloc/new/new[], --alloc-fns, 
> etc.
> ->99.82% (46,610B) 0x0: ???
> 
> 
> Using "(gdb) break malloc" and then "(gdb) bt"produces regular 
> callstack
> 
> 
> Also using  gdb+vgdb is producing correct backtrace:
> (gdb) monitor v.info scheduler
> 
> Host stacktrace:
> ==1543== at 0x5800B148: ??? (in 
> /home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/massif-arm
> -linux)
> 
> sched status:
>   running_tid=1
> 
> Thread 1: status = VgTs_Runnable (lwpid 1543)
> ==1543==  at 0x42826: service_main(int, char const**, bool) 
> (serviceMain.cpp:155)
> ==1543==  by 0x41D1F: main (serviceMain.cpp:17)
> client stack range: [0x7DDE5000 0xDDE8FFF] client SP: 0x7DDE86A8 
> valgrind stack range: [0x41E82000 0x41F81FFF] top usage: 25600 of 
> 1048576
> 
> Thread 2: status = VgTs_WaitSys syscall 285 (lwpid 1560)
> (...)
> Thread 3: status = VgTs_WaitSys syscall 285 (lwpid 1561)
> (...)
> 
> 
> Thank you for helping me!
> 
> Best regards,
> Łukasz Bolda
> 
> 
> -----Original Message-----
> From: Philippe Waroquiers 
> Sent: Friday, December 11, 2020 4:31 PM
> To: Łukasz Bolda ; 
> valgrind-users@lists.sourceforge.net
> Subject: Re: [Valgrind-users] Why valgrind tool massif does not print 
> xtree callstack? (arm)
> 
> Which version of valgrind are you using ?
> You much better should use the last released version (or a more recent GIT 
> version).
> 
> Have you compiled your application with -g ?
> 
> In case you debug your native executable with gdb and put a break on malloc, 
> is gdb backtrace command giving a good stack trace ?
> 
> If you then debug using  gdb+vgdb your executable running under valgrind, is 
> then the gdb backtrace correct ?
> And when positioned on the break point, what is the output of
>(gdb) monitor v.info scheduler
> 
> Thanks
> Philippe
> 
> On Fri, 2020-12-11 at 15:02 +0100, Łukasz Bolda wrote:
> > Hello!
> > This is my first message on this list, so I'd like to say hi to everyone!
> > 
> &

Re: [Valgrind-users] Why valgrind tool massif does not print xtree callstack? (arm)

2020-12-14 Thread Philippe Waroquiers
Strange ... 'v.info scheduler' shows that valgrind can compute a correct guest
stack trace, but the output file is not correct.

It looks like with gdb+vgdb, you cannot put a breakpoint on a redirected 
function:
 valgrind/massif redirects malloc function to its own implementation, and so
 the breakpoint is not reached (at least for me, on amd64 platform).

Also, the host stack trace is empty in the below 'v.info scheduler' output.


Does memcheck give the same unexpected behaviour for its (leak) reports ?

What does memcheck give if you use --xtree-memory=full ?

Can you try the same gdb+vgdb+ break malloc experiment using --tool=none ?

Thanks

Philippe



On Mon, 2020-12-14 at 10:26 +0100, Łukasz Bolda wrote:
> I'm using valgrind 3.14.0 from 
> http://ftp.debian.org/debian/pool/main/v/valgrind/
> Cause it's stable version.
> 
> I did not compile this application.
> 
> Right now i'm trying latest valgrind 3.16.1 and it changed from this:
> 99.87% (20,675,133B) (heap allocation functions) malloc/new/new[], 
> --alloc-fns, etc.
> ->99.87% (20,675,133B) 0x: ???
> 
> to this (different app, but the only change is from 0x to 0x0):
> 99.82% (46,610B) (heap allocation functions) malloc/new/new[], --alloc-fns, 
> etc.
> ->99.82% (46,610B) 0x0: ???
> 
> 
> Using "(gdb) break malloc" and then "(gdb) bt"produces regular callstack
> 
> 
> Also using  gdb+vgdb is producing correct backtrace:
> (gdb) monitor v.info scheduler
> 
> Host stacktrace:
> ==1543== at 0x5800B148: ??? (in 
> /home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/massif-arm-linux)
> 
> sched status:
>   running_tid=1
> 
> Thread 1: status = VgTs_Runnable (lwpid 1543)
> ==1543==  at 0x42826: service_main(int, char const**, bool) 
> (serviceMain.cpp:155)
> ==1543==  by 0x41D1F: main (serviceMain.cpp:17)
> client stack range: [0x7DDE5000 0xDDE8FFF] client SP: 0x7DDE86A8
> valgrind stack range: [0x41E82000 0x41F81FFF] top usage: 25600 of 1048576
> 
> Thread 2: status = VgTs_WaitSys syscall 285 (lwpid 1560)
> (...)
> Thread 3: status = VgTs_WaitSys syscall 285 (lwpid 1561)
> (...)
> 
> 
> Thank you for helping me!
> 
> Best regards,
> Łukasz Bolda
> 
> 
> -Original Message-
> From: Philippe Waroquiers  
> Sent: Friday, December 11, 2020 4:31 PM
> To: Łukasz Bolda ; 
> valgrind-users@lists.sourceforge.net
> Subject: Re: [Valgrind-users] Why valgrind tool massif does not print xtree 
> callstack? (arm)
> 
> Which version of valgrind are you using ?
> You much better should use the last released version (or a more recent GIT 
> version).
> 
> Have you compiled your application with -g ?
> 
> In case you debug your native executable with gdb and put a break on malloc, 
> is gdb backtrace command giving a good stack trace ?
> 
> If you then debug using  gdb+vgdb your executable running under valgrind, is 
> then the gdb backtrace correct ?
> And when positioned on the break point, what is the output of
>(gdb) monitor v.info scheduler
> 
> Thanks
> Philippe
> 
> On Fri, 2020-12-11 at 15:02 +0100, Łukasz Bolda wrote:
> > Hello!
> > This is my first message on this list, so I'd like to say hi to everyone!
> > 
> > I'm profiling my software using valgrind tool massif  on arm hardware 
> > with parameters like this:
> > valgrind --tool=massif --massif-out-file=massif.out.%p 
> > --xtree-memory=full --verbose MY_BIN
> > 
> > Unfortuatelly i do not receive any callstack in the results:
> > ms_print massif.out.1234
> > (...)
> > 99.87% (20,675,133B) (heap allocation functions) malloc/new/new[], 
> > --alloc-fns, etc.
> > ->99.87% (20,675,133B) 0x: ???
> > 
> > 
> > What sould i do to receive full callstacks from massif?
> > 
> > Same thing happens when i'm using this tool on system binary for eg. ls.
> > Only 0x is present.
> > 
> > On my x86 machine everything runs fine.
> > 
> > Greetings,
> > Łukasz Bolda
> > 
> > 
> > 
> > 
> > ___
> > Valgrind-users mailing list
> > Valgrind-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/valgrind-users
> 
> 
> ___
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users



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


Re: [Valgrind-users] Why valgrind tool massif does not print xtree callstack? (arm)

2020-12-14 Thread Łukasz Bolda
I'm using valgrind 3.14.0 from 
http://ftp.debian.org/debian/pool/main/v/valgrind/
Cause it's stable version.

I did not compile this application.

Right now i'm trying latest valgrind 3.16.1 and it changed from this:
99.87% (20,675,133B) (heap allocation functions) malloc/new/new[], --alloc-fns, 
etc.
->99.87% (20,675,133B) 0x: ???

to this (different app, but the only change is from 0x to 0x0):
99.82% (46,610B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->99.82% (46,610B) 0x0: ???


Using "(gdb) break malloc" and then "(gdb) bt"produces regular callstack


Also using  gdb+vgdb is producing correct backtrace:
(gdb) monitor v.info scheduler

Host stacktrace:
==1543== at 0x5800B148: ??? (in 
/home/root/lbolda/vg16/usr/lib/arm-linux-gnueabihf/valgrind/massif-arm-linux)

sched status:
running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 1543)
==1543==at 0x42826: service_main(int, char const**, bool) 
(serviceMain.cpp:155)
==1543==by 0x41D1F: main (serviceMain.cpp:17)
client stack range: [0x7DDE5000 0xDDE8FFF] client SP: 0x7DDE86A8
valgrind stack range: [0x41E82000 0x41F81FFF] top usage: 25600 of 1048576

Thread 2: status = VgTs_WaitSys syscall 285 (lwpid 1560)
(...)
Thread 3: status = VgTs_WaitSys syscall 285 (lwpid 1561)
(...)


Thank you for helping me!

Best regards,
Łukasz Bolda


-Original Message-
From: Philippe Waroquiers  
Sent: Friday, December 11, 2020 4:31 PM
To: Łukasz Bolda ; 
valgrind-users@lists.sourceforge.net
Subject: Re: [Valgrind-users] Why valgrind tool massif does not print xtree 
callstack? (arm)

Which version of valgrind are you using ?
You much better should use the last released version (or a more recent GIT 
version).

Have you compiled your application with -g ?

In case you debug your native executable with gdb and put a break on malloc, is 
gdb backtrace command giving a good stack trace ?

If you then debug using  gdb+vgdb your executable running under valgrind, is 
then the gdb backtrace correct ?
And when positioned on the break point, what is the output of
   (gdb) monitor v.info scheduler

Thanks
Philippe

On Fri, 2020-12-11 at 15:02 +0100, Łukasz Bolda wrote:
> Hello!
> This is my first message on this list, so I'd like to say hi to everyone!
> 
> I'm profiling my software using valgrind tool massif  on arm hardware 
> with parameters like this:
> valgrind --tool=massif --massif-out-file=massif.out.%p 
> --xtree-memory=full --verbose MY_BIN
> 
> Unfortuatelly i do not receive any callstack in the results:
> ms_print massif.out.1234
> (...)
> 99.87% (20,675,133B) (heap allocation functions) malloc/new/new[], 
> --alloc-fns, etc.
> ->99.87% (20,675,133B) 0x: ???
> 
> 
> What sould i do to receive full callstacks from massif?
> 
> Same thing happens when i'm using this tool on system binary for eg. ls.
> Only 0x is present.
> 
> On my x86 machine everything runs fine.
> 
> Greetings,
> Łukasz Bolda
> 
> 
> 
> 
> ___
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users



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


Re: [Valgrind-users] Why valgrind tool massif does not print xtree callstack? (arm)

2020-12-11 Thread Philippe Waroquiers
Which version of valgrind are you using ?
You much better should use the last released version (or a more recent GIT 
version).

Have you compiled your application with -g ?

In case you debug your native executable with gdb and put a break on malloc,
is gdb backtrace command giving a good stack trace ?

If you then debug using  gdb+vgdb your executable running under valgrind,
is then the gdb backtrace correct ?
And when positioned on the break point, what is the output of
   (gdb) monitor v.info scheduler

Thanks
Philippe

On Fri, 2020-12-11 at 15:02 +0100, Łukasz Bolda wrote:
> Hello!
> This is my first message on this list, so I'd like to say hi to everyone!
> 
> I'm profiling my software using valgrind tool massif  on arm hardware with
> parameters like this:
> valgrind --tool=massif --massif-out-file=massif.out.%p --xtree-memory=full
> --verbose MY_BIN
> 
> Unfortuatelly i do not receive any callstack in the results:
> ms_print massif.out.1234
> (...)
> 99.87% (20,675,133B) (heap allocation functions) malloc/new/new[],
> --alloc-fns, etc.
> ->99.87% (20,675,133B) 0x: ???
> 
> 
> What sould i do to receive full callstacks from massif?
> 
> Same thing happens when i'm using this tool on system binary for eg. ls.
> Only 0x is present.
> 
> On my x86 machine everything runs fine.
> 
> Greetings,
> Łukasz Bolda
> 
> 
> 
> 
> ___
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users



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


[Valgrind-users] Why valgrind tool massif does not print xtree callstack? (arm)

2020-12-11 Thread Łukasz Bolda
Hello!
This is my first message on this list, so I'd like to say hi to everyone!

I'm profiling my software using valgrind tool massif  on arm hardware with
parameters like this:
valgrind --tool=massif --massif-out-file=massif.out.%p --xtree-memory=full
--verbose MY_BIN

Unfortuatelly i do not receive any callstack in the results:
ms_print massif.out.1234
(...)
99.87% (20,675,133B) (heap allocation functions) malloc/new/new[],
--alloc-fns, etc.
->99.87% (20,675,133B) 0x: ???


What sould i do to receive full callstacks from massif?

Same thing happens when i'm using this tool on system binary for eg. ls.
Only 0x is present.

On my x86 machine everything runs fine.

Greetings,
Łukasz Bolda




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