Re: [Valgrind-users] Debugging a GC with valgrind

2011-01-21 Thread WAROQUIERS Philippe
 
 8
 #define RZ_SZB (128)
 char *sp = /* stack pointer value */;
 char vbits[RZ_SZB] = {0};
 VALGRIND_GET_VBITS(sp-RZ_SZB, vbits, RZ_SZB);
 VALGRIND_MAKE_MEM_DEFINED(sp-RZ_SZB, RZ_SZB);
 /* ... scan the red zone here ... */
 VALGRIND_SET_VBITS(sp-RZ_SZB, vbits, RZ_SZB);
 8

I can try that, but really the problem isn't reading 
uninitialised values.

My theory is gc is deleting reachable store: the actual bug is NOT
reading some thing it should not be :)
...
That would be nice but it is unclear. Consider: the only way** 
a GC could cause 
the problem of an over-write would be to delete a reachable object.

** unless there were some stupid bug in the GC, I did have one: chasing
pointers down with recursion .. blows the stack on a long enough list.
...

I understood that this GC is directly calling malloc/free for each
object
(so there is GC pool management).
Then valgrind memcheck is (supposed to be) able to detect that GC is
freeing
a piece of memory, which is then dereferenced.

You might need to increase the 
list of freed objects but kept in a corner to detect such bugs
by using the option
   --freelist-vol=

If GC is maintaining its own mempool, then valgrind mempool requests
needs to be used.

If the application is multi-threaded, it might also be a race condition.
You could try helgrind or drd.

Philippe


 
This message and any files transmitted with it are legally privileged and 
intended for the sole use of the individual(s) or entity to whom they are 
addressed. If you are not the intended recipient, please notify the sender by 
reply and delete the message and any attachments from your system. Any 
unauthorised use or disclosure of the content of this message is strictly 
prohibited and may be unlawful.
 
Nothing in this e-mail message amounts to a contractual or legal commitment on 
the part of EUROCONTROL, unless it is confirmed by appropriately signed hard 
copy.
 
Any views expressed in this message are those of the sender.

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] AIX 5.3 - Valgrind 3.3.1

2011-01-21 Thread Stutz Oliver
There is not much in the Net about AIX-Valgrind but i have found posts from 
people who claim that 3.3.0/1 runs.
 
 
The ./configure works Properly for me... but here i get stuck, the question is 
why is that, i have no clue what the -C stands for otherwise i could eventually 
replace it.
 
 
 
 
[] make
make  all-am
make -C ../VEX CC=gcc AR=ar pub/libvex_guest_offsets.h
make: Not a recognized flag: C
usage: make [-einqrst] [-k|-S] [-d[A|adg[1|2]mstv]] [-D variable] [-f makefile 
] [-j [jobs]] [variable=value ...] [target ...]
make: 1254-004 The error code from the last command is 2.
 

Stop.
make: 1254-004 The error code from the last command is 2.
 

Stop.
 
Thanks , Oliver
 


Based on previous e-mail correspondence with you and/or an agreement reached 
with you, we consider ourselves authorized to contact you via unsecured e-mail. 
Warning: 
(a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality, 
potential manipulation of contents and/or sender's address, incorrect recipient 
(misdirection), viruses etc. We assume no responsi-bility for any loss or 
damage resulting from the use of e-mails. We recommend in particular that you 
do NOT SEND ANY SENSITIVE INFORMATION, that you do not include details of the 
previous message in any reply, and that you enter e-mail address(es) manually 
every time you write an e-mail. 
(b) As a matter of principle, we do NOT accept any ORDERS, revocations of 
orders or authorizations, blocking of credit cards, etc., sent by e-mail Should 
such an e-mail nevertheless be received, we are not obliged to act on or 
respond to the e-mail. 
Please notify us immediately if you received this e-mail by mistake or if you 
do not wish to receive any further e-mail correspondence. If you have received 
this e-mail by mistake, please completely delete it (and any attachments) and 
do not forward it or inform any other person of its contents.--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] AIX 5.3 - Valgrind 3.3.1

2011-01-21 Thread Stutz Oliver
 
I'am now using Gmake, i can compile the memchecker with the hack:
 
http://unix.derkeiler.com/Newsgroups/comp.unix.aix/2004-11/0553.html 
 
unfortunately it will only make it compile and coredump if i start it. Has 
anybody a clue what my real issue is here? 
 
I have added the -lcrypt flag and also created a dummy file with the undefined 
symbols. I would assume that on a real load i will not work because the 
referenced library doesn't exist. Question here would be how do i handle this 
in AIX 5.3 when i don't have a static linked binary for crypt.
 
Thanks for all the responses already.
 
ld: 0711-317 ERROR: Undefined symbol: encrypted_pw_passlen
ld: 0711-317 ERROR: Undefined symbol: max_history_size
ld: 0711-317 ERROR: Undefined symbol: crypt_r
ld: 0711-317 ERROR: Undefined symbol: getpass_auto
ld: 0711-317 ERROR: Undefined symbol: max_pw_passlen
 
 

 Igmar Palsenberg ig...@palsenberg.com 1/21/2011 12:02 pm 



The ./configure works Properly for me... but here i get stuck, the question is 
why is that, i have no clue what the -C stands for otherwise i could eventually 
replace it.


install GNU make. Don't even bother porting to the AIX make.


Igmar


Based on previous e-mail correspondence with you and/or an agreement reached 
with you, we consider ourselves authorized to contact you via unsecured e-mail. 
Warning: 
(a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality, 
potential manipulation of contents and/or sender's address, incorrect recipient 
(misdirection), viruses etc. We assume no responsi-bility for any loss or 
damage resulting from the use of e-mails. We recommend in particular that you 
do NOT SEND ANY SENSITIVE INFORMATION, that you do not include details of the 
previous message in any reply, and that you enter e-mail address(es) manually 
every time you write an e-mail. 
(b) As a matter of principle, we do NOT accept any ORDERS, revocations of 
orders or authorizations, blocking of credit cards, etc., sent by e-mail Should 
such an e-mail nevertheless be received, we are not obliged to act on or 
respond to the e-mail. 
Please notify us immediately if you received this e-mail by mistake or if you 
do not wish to receive any further e-mail correspondence. If you have received 
this e-mail by mistake, please completely delete it (and any attachments) and 
do not forward it or inform any other person of its contents.--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] AIX 5.3 - Valgrind 3.3.1

2011-01-21 Thread Oliver Schneider
On 2011-01-21 08:59, Stutz Oliver wrote:
 There is not much in the Net about AIX-Valgrind but i have found posts from 
 people who claim that 3.3.0/1 runs.
  
  
 The ./configure works Properly for me... but here i get stuck, the question 
 is why is that, i have no clue what the -C stands for otherwise i could 
 eventually replace it.
  
  
  
  
 [] make
 make  all-am
 make -C ../VEX CC=gcc AR=ar pub/libvex_guest_offsets.h
 make: Not a recognized flag: C
 usage: make [-einqrst] [-k|-S] [-d[A|adg[1|2]mstv]] [-D variable] [-f 
 makefile ] [-j [jobs]] [variable=value ...] [target ...]
 make: 1254-004 The error code from the last command is 2.
  
 
 Stop.
 make: 1254-004 The error code from the last command is 2.
  
 
 Stop.
  
 Thanks , Oliver
You're using some (or the) AIX make command. Try writing a small
wrapper script that passes any and all parameters on to an installed GNU
make and manipulate the PATH before invoking the build, to make sure
your script is found under the name make before any other binary/script.

-C in GNU make changes into the directory given as parameter to the switch.


// Oliver



signature.asc
Description: OpenPGP digital signature
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] Fwd: Re: AIX 5.3 - Valgrind 3.3.1

2011-01-21 Thread Stutz Oliver
I have now added the -lcrypt flag and it actually can resolve the symbols 
found in libc.a
 
The Problem is that Valgrind Coredumps immediately after start with sig 4 Has 
nobody a Static Linked Valgrind for AIX 5.3?
 
We also used OBJECT_MODE=64 and the other time with 32
 
The 64 bit version will stop at compile time with some assembler problem 
llong and the 32 bit version finished but coredumps on execution
 
Thanks,
 
Oliver

_
 
I'am now using Gmake, i can compile the memchecker with the hack:
 
http://unix.derkeiler.com/Newsgroups/comp.unix.aix/2004-11/0553.html 
 
unfortunately it will only make it compile and coredump if i start it. Has 
anybody a clue what my real issue is here? 
 
I have added the -lcrypt flag and also created a dummy file with the undefined 
symbols. I would assume that on a real load i will not work because the 
referenced library doesn't exist. Question here would be how do i handle this 
in AIX 5.3 when i don't have a static linked binary for crypt.
 
Thanks for all the responses already.
 
ld: 0711-317 ERROR: Undefined symbol: encrypted_pw_passlen
ld: 0711-317 ERROR: Undefined symbol: max_history_size
ld: 0711-317 ERROR: Undefined symbol: crypt_r
ld: 0711-317 ERROR: Undefined symbol: getpass_auto
ld: 0711-317 ERROR: Undefined symbol: max_pw_passlen
 
 

 Igmar Palsenberg ig...@palsenberg.com 1/21/2011 12:02 pm 



The ./configure works Properly for me... but here i get stuck, the question is 
why is that, i have no clue what the -C stands for otherwise i could eventually 
replace it.


install GNU make. Don't even bother porting to the AIX make.


Igmar


Based on previous e-mail correspondence with you and/or an agreement reached 
with you, we consider ourselves authorized to contact you via unsecured e-mail. 
Warning: 
(a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality, 
potential manipulation of contents and/or sender's address, incorrect recipient 
(misdirection), viruses etc. We assume no responsi-bility for any loss or 
damage resulting from the use of e-mails. We recommend in particular that you 
do NOT SEND ANY SENSITIVE INFORMATION, that you do not include details of the 
previous message in any reply, and that you enter e-mail address(es) manually 
every time you write an e-mail. 
(b) As a matter of principle, we do NOT accept any ORDERS, revocations of 
orders or authorizations, blocking of credit cards, etc., sent by e-mail Should 
such an e-mail nevertheless be received, we are not obliged to act on or 
respond to the e-mail. 
Please notify us immediately if you received this e-mail by mistake or if you 
do not wish to receive any further e-mail correspondence. If you have received 
this e-mail by mistake, please completely delete it (and any attachments) and 
do not forward it or inform any other person of its contents.--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] AIX 5.3 - Valgrind 3.3.1

2011-01-21 Thread Julian Seward

IIRC, you need to be running a 64-bit kernel.  V will segfault on AIX
if you're running a 32-bit kernel.

Also I thought 3.4.1 worked on AIX5.3.  It's generally better than 3.3.1,
if only because then you'll have origin tracking for Memcheck.

J

On Friday, January 21, 2011, Stutz Oliver wrote:
 There is not much in the Net about AIX-Valgrind but i have found posts from
 people who claim that 3.3.0/1 runs.
 
 
 The ./configure works Properly for me... but here i get stuck, the question
 is why is that, i have no clue what the -C stands for otherwise i could
 eventually replace it.
 
 
 
 
 [] make
 make  all-am
 make -C ../VEX CC=gcc AR=ar pub/libvex_guest_offsets.h
 make: Not a recognized flag: C
 usage: make [-einqrst] [-k|-S] [-d[A|adg[1|2]mstv]] [-D variable] [-f
 makefile ] [-j [jobs]] [variable=value ...] [target ...] make: 1254-004
 The error code from the last command is 2.
 
 
 Stop.
 make: 1254-004 The error code from the last command is 2.
 
 
 Stop.
 
 Thanks , Oliver
 
 
 
 Based on previous e-mail correspondence with you and/or an agreement
 reached with you, we consider ourselves authorized to contact you via
 unsecured e-mail. Warning:
 (a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality,
 potential manipulation of contents and/or sender's address, incorrect
 recipient (misdirection), viruses etc. We assume no responsi-bility for
 any loss or damage resulting from the use of e-mails. We recommend in
 particular that you do NOT SEND ANY SENSITIVE INFORMATION, that you do not
 include details of the previous message in any reply, and that you enter
 e-mail address(es) manually every time you write an e-mail. (b) As a
 matter of principle, we do NOT accept any ORDERS, revocations of orders or
 authorizations, blocking of credit cards, etc., sent by e-mail Should such
 an e-mail nevertheless be received, we are not obliged to act on or
 respond to the e-mail. Please notify us immediately if you received this
 e-mail by mistake or if you do not wish to receive any further e-mail
 correspondence. If you have received this e-mail by mistake, please
 completely delete it (and any attachments) and do not forward it or inform
 any other person of its contents.


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Debugging a GC with valgrind

2011-01-21 Thread Dave Goodell
On Jan 20, 2011, at 6:43 PM CST, john skaller wrote:

 
 OK, so I do this now:
...
if(debug)
  fprintf(stderr, Check if *%p=%p is a pointer\n,i,*(void**)i);
scan_object(*(void**)i, reclimit);
...
 The VALGRIND macro there doesn't seem to be working, I must be
 doing something wrong. I'm trying to just mark the whole stack as defined.
 
 Here's output:
...

The way that I read this output is that your range variable and the data in 
that range is probably defined because Valgrind isn't flagging i or the value 
at address i when you perform the Check if fprintf above.  Rather, it's 
flagging an fprintf inside of scan_object on line 451, whose output you did not 
include.  Maybe it's the reclimit variable?

 ==7159==  Uninitialised value was created by a stack allocation
 ==7159==at 0x1E492: 
 flx::gc::collector::flx_collector_t::mark(std::vectorflx::pthread::memory_range_t,
  std::allocatorflx::pthread::memory_range_t *) (flx_collector.cpp:337)

It's odd that the stack allocation is attributed to line 337, which AFAICT is 
the line where scan_object is called.  Is there some sort of odd automatic C++ 
temporary allocation happening here that I can't see because some other code 
isn't shown here or (more likely) my C++ is too rusty somehow?  Perhaps under 
optimization an uninitialized and otherwise-unused reclimit variable only gets 
created at the time that the arguments to scan_object are pushed onto the stack?

-Dave


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Debugging a GC with valgrind

2011-01-21 Thread john skaller

On 22/01/2011, at 2:30 AM, Dave Goodell wrote:

 On Jan 20, 2011, at 6:43 PM CST, john skaller wrote:
 
 
 OK, so I do this now:
 ...
   if(debug)
 fprintf(stderr, Check if *%p=%p is a pointer\n,i,*(void**)i);
   scan_object(*(void**)i, reclimit);
 ...
 The VALGRIND macro there doesn't seem to be working, I must be
 doing something wrong. I'm trying to just mark the whole stack as defined.
 
 Here's output:
 ...
 
 The way that I read this output is that your range variable and the data in 
 that range is probably defined because Valgrind isn't flagging i or the value 
 at address i when you perform the Check if fprintf above.  

Good point..

 Rather, it's flagging an fprintf inside of scan_object on line 451, whose 
 output you did not include.  Maybe it's the reclimit variable?

I shouldn't think so, though it's hard to be sure of anything.

Scan object look to see if the pointer value it gets is actually a pointer 
into the heap.
If so, it looks at the pointer inside the pointed at object (recursively). I 
know where the
pointers are because I know the type of every heap object.

It doesn't chase down the pointer unless its an actual pointer into the heap:
it doesn't chase ints, raw C pointers (not Felix heap allocated), or pointers 
into the stack or static storage.

In this program there is only ONE data structure on the heap: list nodes.
Which contain exactly one pointer (to the next node). There are no list
nodes on the stack.

The pointers used for lists are actually tagged pointers:

struct _uctor_ { int variant; void *data; };
variant = 0 means end of list and 1 means a node with data in it is being 
pointed at.
[So a node the last node has a value in it and a pointer with variant 0 and 
data=NULL].

It is the variant which is sometimes overwritten with a value like 99762976,
it should be only 0 or 1, my has switches on the variant, which include
a wildcard for values other than 0 or 1, which cause a diagnostic to be
printed match failure and then abort the program.

 
 ==7159==  Uninitialised value was created by a stack allocation
 ==7159==at 0x1E492: 
 flx::gc::collector::flx_collector_t::mark(std::vectorflx::pthread::memory_range_t,
  std::allocatorflx::pthread::memory_range_t *) (flx_collector.cpp:337)
 
 It's odd that the stack allocation is attributed to line 337, which AFAICT is 
 the line where scan_object is called.  Is there some sort of odd automatic 
 C++ temporary allocation happening here that I can't see because some other 
 code isn't shown here or (more likely) my C++ is too rusty somehow?  

I don't think so.

 Perhaps under optimization an uninitialized and otherwise-unused reclimit 
 variable only gets created at the time that the arguments to scan_object are 
 pushed onto the stack?


Well that's possible, but I'm doing a debug build, I *think* that doesn't do 
C++ optimisation
(normally I run with -O3 on gcc).

The nasty thing is now it is working, some quirk has changed something.. :)


--
john skaller
skal...@users.sourceforge.net





--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users