Re: hints on debugging memory corruption...

2011-02-10 Thread Richard Henderson
On 02/10/2011 10:58 AM, Dodji Seketeli wrote: >> Set --param ggc-min-heapsize to a very large value. > > That wouldn't work for pieces of code that explicitly call > ggc_collect, would it? > Sure it does. The first thing that ggc_collect does is determine if enough work has been done to warrant

Re: hints on debugging memory corruption...

2011-02-10 Thread Dodji Seketeli
Richard Henderson writes: > On 02/10/2011 06:32 AM, Dodji Seketeli wrote: >> For the sake of archiving these tricks how do you postpone garbage >> collection in practise? > > Set --param ggc-min-heapsize to a very large value. That wouldn't work for pieces of code that explicitly call ggc_collec

Re: hints on debugging memory corruption...

2011-02-10 Thread Basile Starynkevitch
On Thu, 10 Feb 2011 15:32:39 +0100 Dodji Seketeli wrote: > Joern Rennecke writes: > > > Quoting Tom Tromey : > > > >>> "Basile" == Basile Starynkevitch writes: > >> > >> Basile> So I need to understand who is writing the 0x101 in that field. > > > > > >> One thing to watch out for is that

Re: hints on debugging memory corruption...

2011-02-10 Thread Richard Henderson
On 02/10/2011 06:32 AM, Dodji Seketeli wrote: > For the sake of archiving these tricks how do you postpone garbage > collection in practise? Set --param ggc-min-heapsize to a very large value. r~

Re: hints on debugging memory corruption...

2011-02-10 Thread Dodji Seketeli
Joern Rennecke writes: > Quoting Tom Tromey : > >>> "Basile" == Basile Starynkevitch writes: >> >> Basile> So I need to understand who is writing the 0x101 in that field. > > >> One thing to watch out for is that the memory can be recycled. I've >> been very confused whenever I've forgotten

Re: hints on debugging memory corruption...

2011-02-04 Thread Joern Rennecke
Quoting Tom Tromey : "Basile" == Basile Starynkevitch writes: Basile> So I need to understand who is writing the 0x101 in that field. One thing to watch out for is that the memory can be recycled. I've been very confused whenever I've forgotten this. I have a hack for the GC (appended -

Re: hints on debugging memory corruption...

2011-02-04 Thread Tom Tromey
> "Basile" == Basile Starynkevitch writes: Basile> So I need to understand who is writing the 0x101 in that field. valgrind can sometimes catch this, assuming that the write is an invalid one. Basile> An obvious strategy is to use the hardware watchpoint feature of GDB. Basile> However, one

Re: hints on debugging memory corruption...

2011-02-04 Thread Laurynas Biveinis
2011/2/4 Basile Starynkevitch : > An obvious strategy is to use the hardware watchpoint feature of GDB. > However, one cannot nicely put a watchpoint on an address which is not > mmap-ed yet. Actually, you can do this with a recent enough GDB (7.1 AFAIK). It will keep watchpoint disabled until the

Re: hints on debugging memory corruption...

2011-02-04 Thread Joern Rennecke
Quoting Basile Starynkevitch : Hello All (Sorry for such a basic question; very probably there are some GDB tricks that I ignore). In my MELT branch I have now some corrputed memory (maybe because I am inserting a pass at the wrong place in the pass tree). At some point, I call bb_debug, and i

Re: hints on debugging memory corruption...

2011-02-04 Thread Ian Lance Taylor
Basile Starynkevitch writes: > In my MELT branch I have now some corrputed memory (maybe because I am > inserting a pass at the wrong place in the pass tree). At some point, I call > bb_debug, and it crashes because the field bb_next contains 0x101 (which is > not a valid adress). > > So I need t

Re: hints on debugging memory corruption...

2011-02-04 Thread Richard Henderson
On 02/04/2011 07:42 AM, Basile Starynkevitch wrote: > An obvious strategy is to use the hardware watchpoint feature of GDB. > However, one cannot nicely put a watchpoint on an address which is not > mmap-ed yet. I typically find the location at which the object containing the address is allocated.